Skip to content

Commit 902b88d

Browse files
authored
Merge pull request #1 from bcumming/lanl/mirrors
Tweaks to lanl mirrors branch by bcumming
2 parents da43eb1 + fc2fef3 commit 902b88d

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,17 @@ 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+
```

bin/stack-config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# /// script
33
# requires-python = ">=3.12"
44
# dependencies = [
5+
# "python-magic",
56
# "jinja2",
67
# "jsonschema",
78
# "pyYAML",

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ license-files = ["LICENSE"]
1111
dynamic = ["version"]
1212
requires-python = ">=3.12"
1313
dependencies = [
14+
"python-magic",
1415
"Jinja2",
1516
"jsonschema",
1617
"PyYAML",

stackinator/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def generate(self, recipe):
233233
spack_version=spack_version,
234234
spack_meta=spack_meta,
235235
gpg_keys=recipe.mirrors.keys,
236-
cache=recipe.mirrors.buildcache,
236+
cache=recipe.build_cache_mirror,
237237
exclude_from_cache=["nvhpc", "cuda", "perl"],
238238
verbose=False,
239239
)

stackinator/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def make_argparser():
8686
"--build",
8787
required=True,
8888
type=str,
89-
help="Where to set up the stackinator build directory. ('/tmp' is not allowed, use '/var/tmp'",
89+
help="Where to set up the stackinator build directory. ('/tmp' is not allowed, use '/var/tmp')",
9090
)
9191
parser.add_argument("--no-bwrap", action="store_true", required=False)
9292
parser.add_argument(

stackinator/recipe.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ def __init__(self, args):
172172
# load the optional mirrors.yaml from system config, and add any additional
173173
# mirrors specified on the command line.
174174
self._logger.debug("Configuring mirrors.")
175-
self.mirrors = mirror.Mirrors(self.system_config_path, args.cache)
176-
self.cache = self.mirrors.build_cache_mirror
175+
self.mirrors = mirror.Mirrors(self.system_config_path, pathlib.Path(args.cache))
177176

178177
# optional post install hook
179178
if self.post_install_hook is not None:
@@ -202,6 +201,13 @@ def spack_repo(self):
202201
return repo_path
203202
return None
204203

204+
# Returns:
205+
# Path: if the recipe specified a build cache mirror
206+
# None: if no build cache mirror is used
207+
@property
208+
def build_cache_mirror(self):
209+
return self.mirrors.build_cache_mirror
210+
205211
# Returns:
206212
# Path: of the recipe extra path if it exists
207213
# None: if there is no user-provided extra path in the recipe
@@ -511,7 +517,7 @@ def compiler_files(self):
511517
)
512518

513519
makefile_template = env.get_template("Makefile.compilers")
514-
push_to_cache = self.cache
520+
push_to_cache = self.build_cache_mirror is not None
515521
files["makefile"] = makefile_template.render(
516522
compilers=self.compilers,
517523
push_to_cache=push_to_cache,
@@ -542,7 +548,7 @@ def environment_files(self):
542548
jenv.filters["py2yaml"] = schema.py2yaml
543549

544550
makefile_template = jenv.get_template("Makefile.environments")
545-
push_to_cache = self.cache is not None
551+
push_to_cache = self.build_cache_mirror is not None
546552
files["makefile"] = makefile_template.render(
547553
environments=self.environments,
548554
push_to_cache=push_to_cache,

0 commit comments

Comments
 (0)