You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/mirrors.md
+71-2Lines changed: 71 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,11 +61,18 @@ buildcache:
61
61
62
62
| Field | Required | Description |
63
63
|-------|----------|-------------|
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) |
65
65
| `private_key` | no | PGP key used to sign and push packages (see [Keys](#keys)); omit for a read-only cache |
66
66
| `public_key` | no | PGP key used to verify downloaded packages |
67
67
| `name` | no | name Spack registers the mirror under (default `buildcache`) |
68
68
| `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).
69
76
70
77
### Read-only build cache
71
78
@@ -164,7 +171,14 @@ sourcemirror:
164
171
165
172
| Field | Required | Description |
166
173
|-------|----------|-------------|
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).
168
182
169
183
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.
170
184
@@ -174,6 +188,61 @@ Populate a source mirror on an internet-connected system with Spack:
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) |
| `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
+
177
246
## Source cache
178
247
179
248
A source cache is a single, **writable** local directory that Spack fills as it downloads sources.
0 commit comments