Skip to content
Snippets Groups Projects
Commit da641c61 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

fix: readd purge; buildcache mirror support

parent 65075063
No related branches found
No related tags found
1 merge request!540feat: install environment and push to buildcache with Makefile
......@@ -104,7 +104,17 @@ RUN rm -r /usr/local \
&& cd /opt/spack-environment \
&& source $SPACK_ROOT/share/spack/setup-env.sh \
&& spack env activate --dir /opt/spack-environment/${ENV} \
&& make -C /opt/spack-environment BUILDCACHE=/var/cache/spack-mirror
&& make -C /opt/spack-environment --keep-going SPACK_ENV=${ENV} \
BUILDCACHE_DIR=/var/cache/spack-mirror \
BUILDCACHE_MIRROR=eic-spack
## Optional, nuke the buildcache after install, before (re)caching
## This is useful when going to completely different containers,
## or intermittently to keep the buildcache step from taking too much time
RUN --mount=type=cache,target=/var/cache/spack-mirror,sharing=locked \
cd /opt/spack-environment \
&& [ -z "${CACHE_NUKE}" ] \
|| rm -rf /var/cache/spack-mirror/build_cache/* \
## Extra post-spack steps:
## - Python packages
......
......@@ -7,7 +7,8 @@ export SPACK_COLOR = always
SPACK_ENV ?= dev
BUILDCACHE := $(SPACK_ENV)/cache
BUILDCACHE_DIR := $(SPACK_ENV)/cache
BUILDCACHE_MIRROR :=
.PHONY: all clean
......@@ -19,7 +20,8 @@ endif
$(SPACK_ENV)/push: $(addprefix $(SPACK_ENV)/push/,$($(SPACK_ENV)/SPACK_PACKAGE_IDS))
@mkdir -p $(BUILDCACHE)
$(foreach buildcache, $(BUILDCACHE), $(SPACK) buildcache update-index $(buildcache) ;)
$(foreach buildcache, $(BUILDCACHE_DIR), $(SPACK) buildcache update-index --directory $(buildcache) ;)
$(foreach buildcache, $(BUILDCACHE_MIRROR), $(SPACK) buildcache update-index --mirror-name $(buildcache) ;)
$(SPACK_ENV)/push/%: $(SPACK_ENV)/install/%
@mkdir -p $(dir $@)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment