-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Federico Meloni
committed
Nov 20, 2024
1 parent
1f0ebd9
commit 0450997
Showing
4 changed files
with
157 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
############################################################################### | ||
# Repository: ${REPOSITORY}/key4hep-base | ||
# Tag: ${VERSION}-alma9 | ||
############################################################################### | ||
|
||
ARG VERSION=main | ||
ARG REPOSITORY=madbaron | ||
FROM ${REPOSITORY}/mucoll-spack:${VERSION}-alma9 | ||
|
||
# Adding Key4hep repo | ||
ARG KEY4HEP_COMMIT=9f4187ee47dfa1828be936e34c23035818bcd3aa | ||
|
||
RUN source /opt/setup_spack.sh && \ | ||
REPOPATH=${SPACK_ROOT}/var/key4hep-spack && \ | ||
git clone -b base-environment --single-branch https://github.com/key4hep/key4hep-spack ${REPOPATH} && \ | ||
if [ -n "${KEY4HEP_COMMIT}" ]; then \ | ||
cd ${REPOPATH}; \ | ||
git checkout ${KEY4HEP_COMMIT}; \ | ||
fi | ||
|
||
# Apply our patches to spack | ||
COPY apply_patches.sh ./apply_patches.sh | ||
|
||
RUN source /opt/setup_spack.sh && \ | ||
./apply_patches.sh ${SPACK_ROOT}/var/key4hep-spack | ||
|
||
# Add the package repositories | ||
RUN source /opt/setup_spack.sh && \ | ||
spack repo add --scope system ${SPACK_ROOT}/var/key4hep-spack | ||
|
||
# Create the release environment | ||
RUN source /opt/setup_spack.sh && \ | ||
cd ${SPACK_ROOT}/var/key4hep-spack/environments/key4hep-dev-base && \ | ||
spack env activate . && \ | ||
cd - && \ | ||
echo "source /opt/setup_spack.sh" > ${HOME}/setup_env.sh && \ | ||
echo "cd ${SPACK_ROOT}/var/key4hep-spack/environments/key4hep-dev-base" >> ${HOME}/setup_env.sh && \ | ||
echo "spack env activate ." >> ${HOME}/setup_env.sh && \ | ||
echo "cd -" >> ${HOME}/setup_env.sh && \ | ||
echo "spack env status" >> ${HOME}/setup_env.sh | ||
|
||
# Concretizing the stack reusing system packages as external | ||
RUN source ${HOME}/setup_env.sh && \ | ||
spack add key4hep-base-stack && \ | ||
spack concretize --reuse | ||
|
||
# Installing fragments of dependency tree in separate layers for cached debugging | ||
ENV SPACK_INSTALL_OPTS="--only-concrete --no-add --fail-fast" | ||
|
||
RUN source ${HOME}/setup_env.sh && \ | ||
spack spec -NIt && \ | ||
spack install ${SPACK_INSTALL_OPTS} && \ | ||
spack clean -a | ||
|
||
RUN source ${HOME}/setup_env.sh && \ | ||
echo "source ${SPACK_ENV}/.spack-env/view/setup.sh" > /opt/setup_k4base.sh && \ | ||
echo "alias setup_k4base=\"source /opt/setup_k4base.sh\"" >> /etc/profile.d/aliases.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters