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

fix: use cache mount for make step

parent 392571a2
No related branches found
No related tags found
1 merge request!540feat: install environment and push to buildcache with Makefile
This commit is part of merge request !540. Comments created here will be created in the context of that merge request.
...@@ -100,8 +100,9 @@ RUN git clone https://github.com/${EICSPACK_ORGREPO}.git ${EICSPACK_ROOT} \ ...@@ -100,8 +100,9 @@ RUN git clone https://github.com/${EICSPACK_ORGREPO}.git ${EICSPACK_ROOT} \
## Setup our custom environment ## Setup our custom environment
COPY --from=spack spack-environment/ /opt/spack-environment/ COPY --from=spack spack-environment/ /opt/spack-environment/
ARG ENV=dev ARG ENV=dev
RUN rm -r /usr/local \ RUN --mount=type=cache,target=/var/cache/spack-mirror,sharing=locked \
&& cd /opt/spack-environment \ cd /opt/spack-environment \
&& rm -r /usr/local \
&& source $SPACK_ROOT/share/spack/setup-env.sh \ && source $SPACK_ROOT/share/spack/setup-env.sh \
&& spack env activate --dir /opt/spack-environment/${ENV} \ && spack env activate --dir /opt/spack-environment/${ENV} \
&& make -C /opt/spack-environment --keep-going SPACK_ENV=${ENV} \ && make -C /opt/spack-environment --keep-going SPACK_ENV=${ENV} \
...@@ -112,9 +113,8 @@ RUN rm -r /usr/local \ ...@@ -112,9 +113,8 @@ RUN rm -r /usr/local \
## This is useful when going to completely different containers, ## This is useful when going to completely different containers,
## or intermittently to keep the buildcache step from taking too much time ## or intermittently to keep the buildcache step from taking too much time
RUN --mount=type=cache,target=/var/cache/spack-mirror,sharing=locked \ RUN --mount=type=cache,target=/var/cache/spack-mirror,sharing=locked \
cd /opt/spack-environment \ [ -z "${CACHE_NUKE}" ] \
&& [ -z "${CACHE_NUKE}" ] \ || rm -rf /var/cache/spack-mirror/build_cache/*
|| rm -rf /var/cache/spack-mirror/build_cache/* \
## Extra post-spack steps: ## Extra post-spack steps:
## - Python packages ## - Python packages
......
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