Skip to content

Commit 3ce4ff0

Browse files
authored
Lanl/mirrors (#286)
Replace the legacy -c/--cache mechanism with a unified --mirror flag backed by a single mirrors.yaml describing five optional entities: buildcache, bootstrap, sourcemirror, sourcecache, and concretizer cache. - New Mirrors class (mirror.py) validates inputs and renders all spack config eagerly; the builder just writes the files - Mirror config is now a CLI argument, not part of system config - Support read-only (keyless) build caches, armored GPG keys, source caching, and persistent concretization caches - Don't re-index the build cache on every push - Replace docs/build-caches.md with a rewritten docs/mirrors.md - Drop cache.py; add extensive mirror/recipe unit tests
1 parent 6e49f96 commit 3ce4ff0

41 files changed

Lines changed: 2115 additions & 284 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 350 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,26 @@ A tool for building a scientific software stack from a recipe for vClusters on C
55
Read the [documentation](https://eth-cscs.github.io/stackinator/) to get started.
66

77
Create a ticket in our [GitHub issues](https://github.com/eth-cscs/stackinator/issues) if you find a bug, have a feature request or have a question.
8+
9+
## running tests:
10+
11+
Use uv to run the tests, which will in turn ensure that the correct dependencies from `pyproject.toml` are used:
12+
13+
```
14+
uv run pytest
15+
```
16+
17+
Before pushing, apply the linting rules (this calls uv under the hood):
18+
19+
```
20+
./lint
21+
```
22+
## building the docs
23+
24+
The documentation for Stackinator is built from the markdown files in the `docs` path using MkDocs and MkDocs-material.
25+
You can view the latest documentation online at [github.io](https://eth-cscs.github.io/stackinator/)
26+
27+
To view work in progress docs, run the serve script and follow the link it provides to view a local copy of the docs in your browser.
28+
```bash
29+
./serve
30+
```

bin/stack-config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#!/usr/bin/env -S uv run --script
1+
#!/usr/bin/env -S uv run --no-refresh --script
22
# /// script
33
# requires-python = ">=3.12"
44
# dependencies = [
5+
# "python-magic",
56
# "jinja2",
67
# "jsonschema",
78
# "pyYAML",

docs/build-caches.md

Lines changed: 0 additions & 101 deletions
This file was deleted.

docs/building.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
[](){#ref-building}
12
# Building Spack Stacks
23

3-
Once a stack has been [configured](configuring.md) using `stack-config`, it's time to build the software stack.
4+
Once a stack has been [configured][ref-configuring] using `stack-config`, it's time to build the software stack.
45

56
## How to Build
67

@@ -18,7 +19,7 @@ env --ignore-environment PATH=/usr/bin:/bin:`pwd -P`/spack/bin make modules stor
1819
The call to `make` is wrapped with with `env --ignore-env` to unset all environment variables, to improve reproducability of builds.
1920

2021
Build times for stacks typically vary between 30 minutes to 3 hours, depending on the specific packages that have to be built.
21-
Using [build caches](build-caches.md) and building in shared memory (see below) are the most effective methods to speed up builds.
22+
Using [build caches][ref-mirrors] and building in shared memory (see below) are the most effective methods to speed up builds.
2223

2324
## Where to Build
2425

docs/cluster-config.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[](){#ref-cluster-config}
12
# Cluster Configuration
23

34
Spack stacks are built on bare-metal clusters using a minimum of dependencies from the underlying system.
@@ -10,7 +11,7 @@ A cluster configuration is a directory with the following structure:
1011
└─ repos.yaml # optional reference to additional site packages
1112
```
1213

13-
The configuration is provided during the [configuration](configuring.md) step with the `--system/-s` flag.
14+
The configuration is provided during the [configuration][ref-configuring] step with the `--system/-s` flag.
1415
The following example targets the Clariden system at CSCS:
1516

1617
```bash
@@ -93,6 +94,13 @@ packages:
9394
version: ["git.59b6de6a91d9637809677c50cc48b607a91a9acb=main"]
9495
```
9596

97+
### Configuring Spack mirrors
98+
99+
Mirrors and caches are **not** part of the system configuration.
100+
They are supplied per-invocation with `stack-config --mirror <file>`, because the locations involved (build caches, source caches) are often specific to the user running the build and may not be accessible to everyone using a system.
101+
102+
See [Mirrors and Build Caches][ref-mirrors] for the full reference and examples.
103+
96104
## Site and System Configurations
97105

98106
The `repo.yaml` configuration can be used to provide a list of additional Spack package repositories to use on the target system.

docs/configuring.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[](){#ref-configuring}
12
# Configuring Spack Stacks
23

34
Stackinator generates the make files and spack configurations that build the spack environments that are packaged together in the spack stack.
@@ -10,13 +11,14 @@ stack-config --build $BUILD_PATH --recipe $RECIPE_PATH --system $SYSTEM_CONFIG_P
1011

1112
The following flags are required:
1213

13-
* `-b/--build`: the path where the [build](building.md) is to be performed.
14-
* `-r/--recipe`: the path with the [recipe](recipes.md) yaml files that describe the environment.
15-
* `-s/--system`: the path containing the [system configuration](cluster-config.md) for the target cluster.
14+
* `-b/--build`: the path where the [build][ref-building] is to be performed.
15+
* `-r/--recipe`: the path with the [recipe][ref-recipes] yaml files that describe the environment.
16+
* `-s/--system`: the path containing the [system configuration][ref-cluster-config] for the target cluster.
1617

1718
The following flags are optional:
1819

19-
* `-c/--cache`: configure the [build cache](build-caches.md).
20+
* `--mirror`: path to a [mirrors.yaml][ref-mirrors] file configuring build caches and mirrors.
21+
* `-c/--cache`: legacy build cache configuration file (deprecated; use `--mirror`).
2022
* `-m/--mount`: override the [mount point](installing.md) where the stack will be installed.
2123
* `--version`: print the stackinator version.
2224
* `-h/--help`: print help message.

docs/installing.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[](){#ref-installing}
12
# Installing Stacks
23

34
The installation path of the software stack is set when the stack is configured.
@@ -45,4 +46,6 @@ The `store` sub-directory contains the full software stack installation tree.
4546
### SquashFS installation
4647

4748
The `store.squashfs` file is a compressed [SquashFS](https://tldp.org/HOWTO/SquashFS-HOWTO/whatis.html) image of the contents of the `store` path.
48-
This can be mounted at runtime using [`squashfs-mount`](https://github.com/eth-cscs/squashfs-mount) or the [Slurm plugin](https://github.com/eth-cscs/slurm-uenv-mount/), or mounted by a system-administrator using [`mount`](https://man7.org/linux/man-pages/man2/mount.2.html), in order the to take advantage of the benefits of SquashFS over shared file systems.
49+
This can be mounted at runtime using [`uenv`](https://github.com/eth-cscs/uenv) or the uenv Slurm plugin.
50+
51+
Images can also be mounted by a system-administrator using [`mount`](https://man7.org/linux/man-pages/man2/mount.2.html), which is used in production at CSCS to permanantly mount software stacks used by the weather service on their operational cluster when nodes boot.

0 commit comments

Comments
 (0)