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

fix: readd purge; buildcache mirror support

parent 1bf8c780
Branches
Tags
No related merge requests found
This commit is part of merge request !540. Comments created here will be created in the context of that merge request.
......@@ -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.
Please register or to comment