@@ -159,6 +159,9 @@ ARG TARGETPLATFORM
159159# Open Container Initiative labels
160160LABEL org.opencontainers.image.title="Electron-Ion Collider build concretization image (custom configuration, $TARGETPLATFORM)"
161161
162+ # Set spack environment directory
163+ ENV SPACK_ENV=/opt/spack-environment/${ENV}/epic
164+
162165# # 2. Setup our environment with custom versions (on top of cached layer)
163166# # Note: these default versions are just the very first commit.
164167ARG EDM4EIC_VERSION="8aeb507f93a93257c99985efbce0ec1371e0b331"
@@ -179,8 +182,8 @@ if [ "${EICRECON_VERSION}" != "28108da4a1e8919a05dfdb5f11e114800a2cbe96" ] ; the
179182 spack deconcretize -y --all eicrecon
180183fi
181184if [ "${EPIC_VERSION}" != "c1827f05430b2051df8a0b421db1cbab87165e0b" ] ; then
182- sed -i "/# EPIC_VERSION$/ s/epic\s /epic@git.${EPIC_VERSION}=main /" /opt/spack-environment/${ENV}/spack.yaml
183- sed -i "/# EPIC_VERSION$/ s/epic@main\s /epic@git.${EPIC_VERSION}=main /" /opt/spack-environment/${ENV}/spack.yaml
185+ sed -i "/# EPIC_VERSION$/ s/epic\s /epic@git.${EPIC_VERSION}=main /" /opt/spack-environment/${ENV}/epic/ spack.yaml
186+ sed -i "/# EPIC_VERSION$/ s/epic@main\s /epic@git.${EPIC_VERSION}=main /" /opt/spack-environment/${ENV}/epic/ spack.yaml
184187 spack deconcretize -y --all epic
185188fi
186189if [ "${JUGGLER_VERSION}" != "df87bf1f8643afa8e80bece9d36d6dc26dfe8132" ] ; then
@@ -228,7 +231,6 @@ RUN --mount=type=cache,target=/ccache,id=ccache-${TARGETPLATFORM} \
228231set -e
229232export CCACHE_DIR=/ccache
230233spack ${SPACK_FLAGS} install ${SPACK_INSTALL_FLAGS}
231-
232234spack gc --yes-to-all go go-bootstrap rust rust-bootstrap py-setuptools-rust py-maturin
233235ccache --show-stats
234236ccache --zero-stats
@@ -245,9 +247,15 @@ ARG TARGETPLATFORM
245247# Open Container Initiative labels
246248LABEL org.opencontainers.image.title="Electron-Ion Collider runtime concretization image (custom configuration, $TARGETPLATFORM)"
247249
250+ # Set spack environment directory
251+ ENV SPACK_ENV=/opt/spack-environment/${ENV}/epic
252+
248253COPY --from=builder_installation_custom \
249254 /opt/spack-environment/${ENV}/spack.* \
250255 /opt/spack-environment/${ENV}/
256+ COPY --from=builder_installation_custom \
257+ /opt/spack-environment/${ENV}/epic/spack.* \
258+ /opt/spack-environment/${ENV}/epic/
251259COPY --from=builder_installation_custom \
252260 /opt/spack-environment/packages.yaml \
253261 /opt/spack-environment/
@@ -268,8 +276,9 @@ RUN --mount=type=cache,target=/var/cache/spack \
268276 --mount=type=secret,id=mirrors,target=/opt/spack/etc/spack/mirrors.yaml \
269277 <<EOF
270278set -e
279+ spack env activate --dir ${SPACK_ENV}
271280spack ${SPACK_FLAGS} install ${SPACK_INSTALL_FLAGS} --use-buildcache only
272- spack gc --yes-to-all
281+ spack gc --yes-to-all go go-bootstrap rust rust-bootstrap py-setuptools-rust py-maturin
273282EOF
274283
275284
0 commit comments