Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f1618bf
added spack source mirrors capability, needs testing
grodzki-lanl Feb 17, 2026
954a690
removed lanl stuff
grodzki-lanl Feb 18, 2026
e2c6462
add source mirrors via config.yaml and retain spack default mirror
grodzki-lanl Feb 24, 2026
69f9bb6
fixed spaces/tabs typo
grodzki-lanl Feb 24, 2026
8b392c2
Added mirror configuration json schema.
Paul-Ferrell Mar 6, 2026
dba9698
Incorporating Makefile changes.
Paul-Ferrell Mar 6, 2026
b0a8071
mirrors
grodzki-lanl Mar 6, 2026
6a044ae
mirrors
grodzki-lanl Mar 6, 2026
0ad5022
validate mirror config
grodzki-lanl Mar 6, 2026
3036013
Updating recipe to handle new mirrors format.
Paul-Ferrell Mar 6, 2026
a1c486d
Updating mirror configuration more.
Paul-Ferrell Mar 6, 2026
2b60683
mirror yaml generator
grodzki-lanl Mar 6, 2026
095862c
update mirrors
grodzki-lanl Mar 6, 2026
31a16f1
validate keys in mirror config and fixed yaml generator
grodzki-lanl Mar 7, 2026
9ef113d
validate keys in mirror config and fixed yaml generator
grodzki-lanl Mar 7, 2026
b9fe48e
connecting mirrors to builder.py
grodzki-lanl Mar 9, 2026
e2ee9ba
Put the mirror manipulation code in a class.
Paul-Ferrell Mar 12, 2026
798a216
preserve cache for makefile
grodzki-lanl Mar 12, 2026
64ff5d2
Adding bootstrap mirror configs.
Paul-Ferrell Mar 12, 2026
d55c152
Reverted to defining the key store path in builder.
Paul-Ferrell Mar 12, 2026
21c507c
Compressed mirror config setup into a single interface.
Paul-Ferrell Mar 12, 2026
d33de01
Catching builder exceptions.
Paul-Ferrell Mar 12, 2026
3eac13d
fixing key setup
grodzki-lanl Mar 12, 2026
d31422c
In progress.
Paul-Ferrell Mar 12, 2026
44612a6
Merge branch 'main' into lanl/mirrors
Paul-Ferrell Mar 13, 2026
d1c1dc1
added GPG key verification
grodzki-lanl Mar 13, 2026
14e77fc
unit tests for mirrors
grodzki-lanl Mar 13, 2026
ff1a35c
mirrors.yaml is now a name:{<config>} mapping
Paul-Ferrell Mar 13, 2026
a19a6d3
Now add mount specific paths to certain mirrors.
Paul-Ferrell Mar 13, 2026
b5c1e7e
updated test mirror format
grodzki-lanl Mar 13, 2026
8f4fa36
Fixed build cache enabling via cmdline.
Paul-Ferrell Mar 13, 2026
4c995ff
Error handling
Paul-Ferrell Mar 13, 2026
98f6407
Adding a unittest.
Paul-Ferrell Mar 13, 2026
780c43f
updated yaml formatting
grodzki-lanl Mar 13, 2026
da5781a
Fixed error message.
Paul-Ferrell Mar 13, 2026
84666d6
debugging
grodzki-lanl Mar 13, 2026
602244c
Minor fix.
Paul-Ferrell Mar 13, 2026
eba1f13
Fixing urls.
Paul-Ferrell Mar 13, 2026
3eadc82
fixed url for testing
grodzki-lanl Mar 13, 2026
2fee464
validated mirror tests
grodzki-lanl Mar 13, 2026
efd5628
added test description
grodzki-lanl Mar 13, 2026
5c5faed
Adding unit tests.
Paul-Ferrell Mar 16, 2026
9829bfc
Unit test tweaking.
Paul-Ferrell Mar 16, 2026
cb2be11
Added unittests for key setup
Paul-Ferrell Mar 16, 2026
e386498
Added test for bad keys.
Paul-Ferrell Mar 16, 2026
f3759c7
added more mirror tests
grodzki-lanl Mar 16, 2026
4f4b127
added test for bad urls
grodzki-lanl Mar 16, 2026
1285fab
added requirements.txt
grodzki-lanl Mar 16, 2026
48621c9
Fixed unittest.
Paul-Ferrell Mar 16, 2026
d3dc3fa
Added one more unittest.
Paul-Ferrell Mar 16, 2026
9eaf7a9
Linting
Paul-Ferrell Mar 16, 2026
da43eb1
Got rid of cache.py
Paul-Ferrell Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
attrs==25.4.0
iniconfig==2.3.0
jsonschema==4.26.0
jsonschema-specifications==2025.9.1
packaging==26.0
pluggy==1.6.0
pygments==2.19.2
pytest==9.0.2
python-magic==0.4.27
pyyaml==6.0.3
referencing==0.37.0
rpds-py==0.30.0
17 changes: 10 additions & 7 deletions stackinator/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import jinja2
import yaml

from . import VERSION, cache, root_logger, spack_util
from . import VERSION, root_logger, spack_util, mirror


def install(src, dst, *, ignore=None, symlinks=False):
Expand Down Expand Up @@ -164,6 +164,7 @@ def environment_meta(self, recipe):
self._environment_meta = meta

def generate(self, recipe):
"""Setup the recipe build environment."""
# make the paths, in case bwrap is not used, directly write to recipe.mount
store_path = self.path / "store" if not recipe.no_bwrap else pathlib.Path(recipe.mount)
tmp_path = self.path / "tmp"
Expand Down Expand Up @@ -226,12 +227,13 @@ def generate(self, recipe):
with (self.path / "Makefile").open("w") as f:
f.write(
makefile_template.render(
cache=recipe.mirror,
modules=recipe.with_modules,
post_install_hook=recipe.post_install_hook,
pre_install_hook=recipe.pre_install_hook,
spack_version=spack_version,
spack_meta=spack_meta,
gpg_keys=recipe.mirrors.keys,
cache=recipe.mirrors.buildcache,
exclude_from_cache=["nvhpc", "cuda", "perl"],
verbose=False,
)
Expand Down Expand Up @@ -312,11 +314,12 @@ def generate(self, recipe):
fid.write(global_packages_yaml)

# generate a mirrors.yaml file if build caches have been configured
if recipe.mirror:
dst = config_path / "mirrors.yaml"
self._logger.debug(f"generate the build cache mirror: {dst}")
with dst.open("w") as fid:
fid.write(cache.generate_mirrors_yaml(recipe.mirror))
self._logger.debug(f"Generating the spack mirror configs in '{config_path}'")
try:
recipe.mirrors.setup_configs(config_path)
except mirror.MirrorError as err:
self._logger.error(f"Could not set up mirrors.\n{err}")
return 1

# Add custom spack package recipes, configured via Spack repos.
# Step 1: copy Spack repos to store_path where they will be used to
Expand Down
58 changes: 0 additions & 58 deletions stackinator/cache.py

This file was deleted.

28 changes: 23 additions & 5 deletions stackinator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,31 @@ def log_header(args):
def make_argparser():
parser = argparse.ArgumentParser(description=("Generate a build configuration for a spack stack from a recipe."))
parser.add_argument("--version", action="version", version=f"stackinator version {VERSION}")
parser.add_argument("-b", "--build", required=True, type=str)
parser.add_argument(
"-b",
"--build",
required=True,
type=str,
help="Where to set up the stackinator build directory. ('/tmp' is not allowed, use '/var/tmp'",
)
parser.add_argument("--no-bwrap", action="store_true", required=False)
parser.add_argument("-r", "--recipe", required=True, type=str)
parser.add_argument("-s", "--system", required=True, type=str)
parser.add_argument(
"-r", "--recipe", required=True, type=str, help="Name of (and/or path to) the Stackinator recipe."
)
parser.add_argument(
"-s", "--system", required=True, type=str, help="Name of (and/or path to) the Stackinator system configuration."
)
parser.add_argument("-d", "--debug", action="store_true")
parser.add_argument("-m", "--mount", required=False, type=str)
parser.add_argument("-c", "--cache", required=False, type=str)
parser.add_argument(
"-m", "--mount", required=False, type=str, help="The mount point where the environment will be located."
)
parser.add_argument(
"-c",
"--cache",
required=False,
type=str,
help="Buildcache location or name (from system config's mirrors.yaml).",
)
parser.add_argument("--develop", action="store_true", required=False)

return parser
Expand Down
Loading