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

feat: install most dependencies in cachable layer, before adding main

parent f4b44273
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !747. Comments created here will be created in the context of that merge request.
...@@ -337,8 +337,12 @@ jug_dev: ...@@ -337,8 +337,12 @@ jug_dev:
--build-arg S3_SECRET_KEY=${S3_SECRET_KEY} --build-arg S3_SECRET_KEY=${S3_SECRET_KEY}
--build-arg JUG_VERSION=${EXPORT_TAG}-${BUILD_TYPE}-$(git rev-parse HEAD) --build-arg JUG_VERSION=${EXPORT_TAG}-${BUILD_TYPE}-$(git rev-parse HEAD)
${IF_BUILD_DEFAULT:+ ${IF_BUILD_DEFAULT:+
--build-arg JUGGLER_VERSION=${JUGGLER_VERSION} ${JUGGLER_VERSION:+--build-arg JUGGLER_VERSION=${JUGGLER_VERSION}}
--build-arg EICRECON_VERSION=${EICRECON_VERSION} ${EICRECON_VERSION:+--build-arg EICRECON_VERSION=${EICRECON_VERSION}}
}
${IF_BUILD_NIGHTLY:+
--build-arg JUGGLER_VERSION=main
--build-arg EICRECON_VERSION=main
} }
--build-arg ENV=${ENV} --build-arg ENV=${ENV}
--build-arg jobs=${JOBS} --build-arg jobs=${JOBS}
......
...@@ -120,11 +120,26 @@ FROM spack as builder ...@@ -120,11 +120,26 @@ FROM spack as builder
## Setup our custom environment (secret mount for write-enabled mirror) ## Setup our custom environment (secret mount for write-enabled mirror)
COPY --from=spack-environment . /opt/spack-environment/ COPY --from=spack-environment . /opt/spack-environment/
ARG ENV=dev ARG ENV=dev
ARG JUGGLER_VERSION="main" ENV SPACK_ENV=/opt/spack-environment/${ENV}
RUN --mount=type=cache,target=/ccache,id=${TARGETPLATFORM} \
--mount=type=cache,target=/var/cache/spack \
--mount=type=secret,id=mirrors,target=/opt/spack/etc/spack/mirrors.yaml \
source $SPACK_ROOT/share/spack/setup-env.sh \
&& export CCACHE_DIR=/ccache \
&& spack buildcache update-index local \
&& spack buildcache update-index eics3rw \
&& spack env activate --dir ${SPACK_ENV} \
&& make --jobs ${jobs} --keep-going --directory /opt/spack-environment \
SPACK_ENV=${SPACK_ENV} \
BUILDCACHE_MIRROR="local eics3rw" \
&& ccache --show-stats \
&& ccache --zero-stats
## Setup our custom environment with custom versions (on top of cached layer)
ARG JUGGLER_VERSION=""
ARG EICRECON_VERSION=""
ADD https://eicweb.phy.anl.gov/api/v4/projects/EIC%2Fjuggler/repository/tree?ref=${JUGGLER_VERSION} /tmp/juggler.json ADD https://eicweb.phy.anl.gov/api/v4/projects/EIC%2Fjuggler/repository/tree?ref=${JUGGLER_VERSION} /tmp/juggler.json
ARG EICRECON_VERSION="main"
ADD https://api.github.com/repos/eic/eicrecon/commits/${EICRECON_VERSION} /tmp/eicrecon.json ADD https://api.github.com/repos/eic/eicrecon/commits/${EICRECON_VERSION} /tmp/eicrecon.json
ENV SPACK_ENV=/opt/spack-environment/${ENV}
RUN --mount=type=cache,target=/ccache,id=${TARGETPLATFORM} \ RUN --mount=type=cache,target=/ccache,id=${TARGETPLATFORM} \
--mount=type=cache,target=/var/cache/spack \ --mount=type=cache,target=/var/cache/spack \
--mount=type=secret,id=mirrors,target=/opt/spack/etc/spack/mirrors.yaml \ --mount=type=secret,id=mirrors,target=/opt/spack/etc/spack/mirrors.yaml \
...@@ -133,8 +148,12 @@ RUN --mount=type=cache,target=/ccache,id=${TARGETPLATFORM} \ ...@@ -133,8 +148,12 @@ RUN --mount=type=cache,target=/ccache,id=${TARGETPLATFORM} \
&& spack buildcache update-index local \ && spack buildcache update-index local \
&& spack buildcache update-index eics3rw \ && spack buildcache update-index eics3rw \
&& spack env activate --dir ${SPACK_ENV} \ && spack env activate --dir ${SPACK_ENV} \
&& spack add juggler@git.${JUGGLER_VERSION} \ && if [ -n ${JUGGLER_VERSION} ] ; then \
&& spack add eicrecon@git.${EICRECON_VERSION} \ spack rm juggler && spack add juggler@git.${JUGGLER_VERSION} ; \
fi \
&& if [ -n ${EICRECON_VERSION} ] ; then \
spack rm eicrecon && spack add eicrecon@git.${EICRECON_VERSION} ; \
fi \
&& make --jobs ${jobs} --keep-going --directory /opt/spack-environment \ && make --jobs ${jobs} --keep-going --directory /opt/spack-environment \
SPACK_ENV=${SPACK_ENV} \ SPACK_ENV=${SPACK_ENV} \
BUILDCACHE_MIRROR="local eics3rw" \ BUILDCACHE_MIRROR="local eics3rw" \
......
...@@ -23,6 +23,7 @@ spack: ...@@ -23,6 +23,7 @@ spack:
- edm4eic - edm4eic
- edm4hep - edm4hep
- eic-smear - eic-smear
- eicrecon
- eigen - eigen
- emacs - emacs
- fastjet - fastjet
...@@ -37,6 +38,7 @@ spack: ...@@ -37,6 +38,7 @@ spack:
- imagemagick - imagemagick
- irt - irt
- jana2 - jana2
- juggler
- lcov - lcov
- lhapdf - lhapdf
- madx - madx
......
...@@ -89,6 +89,9 @@ packages: ...@@ -89,6 +89,9 @@ packages:
eic-smear: eic-smear:
require: require:
- '@1.1.12' - '@1.1.12'
eicrecon:
require:
- '@1.6.1'
eigen: eigen:
require: require:
- '@3.4.0' - '@3.4.0'
...@@ -146,6 +149,9 @@ packages: ...@@ -146,6 +149,9 @@ packages:
require: require:
- '@2.1.1' - '@2.1.1'
- -ipo +podio +root +zmq - -ipo +podio +root +zmq
juggler:
require:
- '@10.1.0'
lcov: lcov:
require: require:
- '@1.16' - '@1.16'
......
...@@ -7,6 +7,7 @@ spack: ...@@ -7,6 +7,7 @@ spack:
- cmake - cmake
- dd4hep - dd4hep
- edm4eic - edm4eic
- eicrecon
- fastjet - fastjet
- fjcontrib - fjcontrib
- gaudi - gaudi
...@@ -15,6 +16,7 @@ spack: ...@@ -15,6 +16,7 @@ spack:
- intel-tbb - intel-tbb
- irt - irt
- jana2 - jana2
- juggler
- npsim -geocad - npsim -geocad
- py-boto3 - py-boto3
- py-jinja2 - py-jinja2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment