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

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

parent 27ab098b
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:
--build-arg S3_SECRET_KEY=${S3_SECRET_KEY}
--build-arg JUG_VERSION=${EXPORT_TAG}-${BUILD_TYPE}-$(git rev-parse HEAD)
${IF_BUILD_DEFAULT:+
--build-arg JUGGLER_VERSION=${JUGGLER_VERSION}
--build-arg EICRECON_VERSION=${EICRECON_VERSION}
${JUGGLER_VERSION:+--build-arg JUGGLER_VERSION=${JUGGLER_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 jobs=${JOBS}
......
......@@ -126,10 +126,6 @@ FROM spack as builder
## Setup our custom environment (secret mount for write-enabled mirror)
COPY --from=spack-environment . /opt/spack-environment/
ARG ENV=dev
ARG JUGGLER_VERSION="main"
ADD https://eicweb.phy.anl.gov/api/v4/projects/EIC%2Fjuggler/repository/commits/${JUGGLER_VERSION} /tmp/juggler.json
ARG EICRECON_VERSION="main"
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} \
--mount=type=cache,target=/var/cache/spack \
......@@ -138,12 +134,36 @@ RUN --mount=type=cache,target=/ccache,id=${TARGETPLATFORM} \
set -e
export CCACHE_DIR=/ccache
find /var/cache/spack/blobs/sha256/ -atime +7 -delete
JUGGLER_VERSION=$(jq -r .id /tmp/juggler.json)
EICRECON_VERSION=$(jq -r .sha /tmp/eicrecon.json)
spack buildcache update-index eics3rw
spack env activate --dir ${SPACK_ENV}
spack add juggler@git.${JUGGLER_VERSION}
spack add eicrecon@git.${EICRECON_VERSION}
spack concretize --fresh --force --quiet
make --jobs ${jobs} --keep-going --directory /opt/spack-environment SPACK_ENV=${SPACK_ENV} BUILDCACHE_MIRROR="local eics3rw"
ccache --show-stats
ccache --zero-stats
EOF
## 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/commits/${JUGGLER_VERSION} /tmp/juggler.json
ADD https://api.github.com/repos/eic/eicrecon/commits/${EICRECON_VERSION} /tmp/eicrecon.json
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 \
<<EOF
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}
if [ -n ${JUGGLER_VERSION} ] ; then
export JUGGLER_VERSION=$(jq -r .id /tmp/juggler.json)
spack rm juggler && spack add juggler@git.${JUGGLER_VERSION}
fi
if [ -n ${EICRECON_VERSION} ] ; then
export EICRECON_VERSION=$(jq -r .sha /tmp/eicrecon.json)
spack rm eicrecon && spack add eicrecon@git.${EICRECON_VERSION}
fi
spack concretize --fresh --force --quiet
make --jobs ${jobs} --keep-going --directory /opt/spack-environment SPACK_ENV=${SPACK_ENV} BUILDCACHE_MIRROR_ONLY_PACKAGE="eics3rw" BUILDCACHE_MIRROR_DEPENDENCIES="eicweb ghcr"
ccache --show-stats
......
......@@ -24,6 +24,7 @@ spack:
- edm4eic
- edm4hep
- eic-smear
- eicrecon
- eigen
- emacs
- fastjet
......@@ -40,6 +41,7 @@ spack:
- iwyu
- jana2
- k4actstracking
- juggler
- k4fwcore
- lcov
- lhapdf
......
......@@ -92,6 +92,9 @@ packages:
eic-smear:
require:
- '@1.1.12'
eicrecon:
require:
- '@1.6.1'
eigen:
require:
- '@3.4.0'
......@@ -160,6 +163,7 @@ packages:
- -ipo +podio +root +zmq
juggler:
require:
- '@10.1.0'
- cxxstd=20
k4actstracking:
require:
......
spack:
include:
include:
- ../concretizer.yaml
- ../packages.yaml
config:
......@@ -9,6 +9,7 @@ spack:
- cmake
- dd4hep -ddeve
- edm4eic
- eicrecon
- fastjet
- fjcontrib
- gaudi
......@@ -17,6 +18,7 @@ spack:
- intel-tbb
- irt
- jana2
- juggler
- npsim -geocad
- py-boto3
- py-jinja2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment