Skip to content

Commit 7ae87fd

Browse files
committed
update docs
1 parent 71e4812 commit 7ae87fd

1 file changed

Lines changed: 71 additions & 2 deletions

File tree

docs/mirrors.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,18 @@ buildcache:
6161
6262
| Field | Required | Description |
6363
|-------|----------|-------------|
64-
| `url` | yes | location of the cache (a `file://` path, or an `http(s)://`, `s3://` or `oci://` URL) |
64+
| `url` | yes¹ | location of the cache (a `file://` path, or an `http(s)://`, `s3://` or `oci://` URL) |
6565
| `private_key` | no | PGP key used to sign and push packages (see [Keys](#keys)); omit for a read-only cache |
6666
| `public_key` | no | PGP key used to verify downloaded packages |
6767
| `name` | no | name Spack registers the mirror under (default `buildcache`) |
6868
| `mount_specific` | no | store the cache in a per-mount-point sub-directory (default `false`) |
69+
| `fetch` / `push` | no¹ | separate read/write [connections](#connections-and-authentication), used instead of a single `url` |
70+
| `binary` | no | the cache holds binary packages (default `true`) |
71+
| `source` | no | the cache also holds package sources (default `false`) |
72+
| `signed` | no | whether Spack signs/verifies binaries with GPG (passed through to Spack) |
73+
| `autopush` | no | Spack pushes each package as soon as it is installed (passed through to Spack) |
74+
75+
¹ Give either a top-level `url` *or* explicit `fetch`/`push` connections — see [Connections and authentication](#connections-and-authentication).
6976

7077
### Read-only build cache
7178

@@ -164,7 +171,14 @@ sourcemirror:
164171

165172
| Field | Required | Description |
166173
|-------|----------|-------------|
167-
| `url` | yes | location of the source mirror |
174+
| `url` | yes¹ | location of the source mirror |
175+
| `fetch` / `push` | no¹ | separate read/write [connections](#connections-and-authentication), used instead of a single `url` |
176+
| `source` | no | the mirror holds package sources (default `true`) |
177+
| `binary` | no | the mirror also holds binary packages (default `false`) |
178+
| `signed` | no | whether Spack signs/verifies binaries with GPG (passed through to Spack) |
179+
| `autopush` | no | Spack pushes to the mirror as soon as a package is installed (passed through to Spack) |
180+
181+
¹ Give either a top-level `url` *or* explicit `fetch`/`push` connections — see [Connections and authentication](#connections-and-authentication).
168182

169183
Source mirrors need no keys: Spack verifies every downloaded source against the checksum in its package recipe, whether it comes from the upstream url or a mirror.
170184

@@ -174,6 +188,61 @@ Populate a source mirror on an internet-connected system with Spack:
174188
spack mirror create --directory /path/to/mirror --all
175189
```
176190

191+
## Connections and authentication
192+
193+
Both the [build cache](#build-cache) and [source mirrors](#source-mirrors) describe *where* and *how* Spack reaches a mirror with the same connection model, taken directly from Spack's own [`mirrors.yaml`](https://spack.readthedocs.io/en/latest/mirrors.html). Stackinator passes these fields through to Spack unchanged.
194+
195+
The simplest form is a single `url`, used for both reading and writing:
196+
197+
```yaml title="mirrors.yaml"
198+
buildcache:
199+
url: file:///capstor/scratch/team/uenv-cache
200+
private_key: $SCRATCH/.keys/spack-push-key.gpg
201+
```
202+
203+
When the read and write endpoints differ, or the mirror needs authentication, replace the top-level `url` with explicit `fetch` and `push` connection blocks. This example is an S3 build cache with credentials supplied through environment variables:
204+
205+
```yaml title="mirrors.yaml"
206+
buildcache:
207+
private_key: $SCRATCH/.keys/spack-push-key.gpg
208+
fetch:
209+
url: s3://my-bucket/buildcache
210+
endpoint_url: https://s3.example.com
211+
access_pair:
212+
id_variable: AWS_ACCESS_KEY_ID
213+
secret_variable: AWS_SECRET_ACCESS_KEY
214+
push:
215+
url: s3://my-bucket/buildcache
216+
endpoint_url: https://s3.example.com
217+
access_pair:
218+
id_variable: AWS_ACCESS_KEY_ID
219+
secret_variable: AWS_SECRET_ACCESS_KEY
220+
```
221+
222+
A connection — whether given as the top-level shorthand or inside a `fetch`/`push` block — accepts:
223+
224+
| Field | Description |
225+
|-------|-------------|
226+
| `url` | location of the mirror (`file://`, `http(s)://`, `s3://` or `oci://`) |
227+
| `endpoint_url` | custom endpoint URL for S3-compatible storage |
228+
| `profile` | AWS profile name to use for S3 authentication |
229+
| `access_token_variable` | environment variable holding an access token for OCI registry authentication |
230+
| `access_pair` | ID + secret credential pair (see below) |
231+
| `view` | mirror view (passed through to Spack) |
232+
233+
`access_pair` holds the credential pair:
234+
235+
| Field | Required | Description |
236+
|-------|----------|-------------|
237+
| `secret_variable` | yes | environment variable holding the secret key |
238+
| `id_variable` | one of | environment variable holding the access key ID |
239+
| `id` | one of | the access key ID as a literal string (prefer `id_variable`) |
240+
241+
!!! warning "Keep secrets out of the file"
242+
Reference credentials through environment variables (`*_variable`) rather than writing them into `mirrors.yaml`. The secret itself is never a required field — only the *name* of the variable that holds it.
243+
244+
See Spack's [mirror documentation](https://spack.readthedocs.io/en/latest/mirrors.html) for the full reference on these fields.
245+
177246
## Source cache
178247

179248
A source cache is a single, **writable** local directory that Spack fills as it downloads sources.

0 commit comments

Comments
 (0)