Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions stackinator/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ def generate(self, recipe):
pre_install_hook=recipe.pre_install_hook,
spack_version=spack_version,
spack_meta=spack_meta,
# pass source_mirrors to Makefile render
source_mirrors=recipe.config.get("source_mirrors", {}),
exclude_from_cache=["nvhpc", "cuda", "perl"],
verbose=False,
)
Expand Down
7 changes: 7 additions & 0 deletions stackinator/schema/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
}
}
},
"source_mirrors" : {
"type" : "object",
"additionalProperties": {
"type" : "string"
},
"default": {}
},
"modules" : {
"type": "boolean"
},
Expand Down
10 changes: 9 additions & 1 deletion stackinator/templates/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,21 @@ pre-install: spack-setup
$(SANDBOX) $(STORE)/pre-install-hook

mirror-setup: spack-setup{% if pre_install_hook %} pre-install{% endif %}

{% if cache %}
$(SANDBOX) $(SPACK) buildcache keys --install --trust
{% if cache.key %}
$(SANDBOX) $(SPACK) gpg trust {{ cache.key }}
{% endif %}
{% endif %}
{% if source_mirrors %}
@echo "Adding mirrors"
{% for name, url in source_mirrors.items() | reverse %}
$(SANDBOX) $(SPACK) mirror add --scope=site {{ name }} {{ url }}
{% endfor %}
@echo "Current mirror list:"
$(SANDBOX) $(SPACK) mirror list
{% endif %}
touch mirror-setup

compilers: mirror-setup
Expand Down