Skip to content
Snippets Groups Projects
Commit 36cd8a2f authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

feat(CI,JUSUF): transparent base image

parent a97dd76c
No related branches found
No related tags found
No related merge requests found
......@@ -285,14 +285,33 @@ build-esd-image_JUSUF:
# create a sandbox/image for performing an spack install inside based on some base image/install
- rm -rf $TMPDIR
- mkdir $TMPDIR || true
- apptainer build --fix-perms --force --sandbox ${SANDBOX_ROOT}/ docker://${BUILD_ENV_DOCKER_IMAGE}
- |
cat <<EOF >image.def
Bootstrap: scratch
%setup
mkdir \${APPTAINER_ROOTFS}/bin
# /etc exists
touch \${APPTAINER_ROOTFS}/etc/passwd
touch \${APPTAINER_ROOTFS}/etc/group
touch \${APPTAINER_ROOTFS}/etc/localtime
mkdir \${APPTAINER_ROOTFS}/lib
mkdir \${APPTAINER_ROOTFS}/lib64
mkdir \${APPTAINER_ROOTFS}/usr
mkdir -p \${APPTAINER_ROOTFS}/${INSTALLATION_ROOT}
# JUSUF speciale
mkdir \${APPTAINER_ROOTFS}/p
mkdir -p \${APPTAINER_ROOTFS}/etc/FZJ
# /var exists
EOF
- cat image.def
- apptainer build --fix-perms --force --sandbox ${SANDBOX_ROOT}/ image.def
# run installation script inside future container environment
# => DAG concretization, subsequent cache access + fetching and actual build should be separate steps
- mkdir --mode=0777 -p ${SANDBOX_ROOT}/${INSTALLATION_ROOT}
# begin of fixup for JUSUF
- mkdir --mode=0777 -p ${SANDBOX_ROOT}/p
- mkdir --mode=0777 -p ${SANDBOX_ROOT}/etc/FZJ
# end of fixup for JUSUF
- export APPTAINER_BIND="/bin,/lib,/lib64,/usr,/p,/etc/FZJ"
- apptainer exec --writable --fakeroot --cwd / ${SANDBOX_ROOT} bash -c "which python3"
- apptainer exec --writable --bind ${CI_PROJECT_DIR}:${INSTALLATION_ROOT} --cwd ${INSTALLATION_ROOT} ${SANDBOX_ROOT} bash ./install_spack_env.sh $SPACK_JOBS $INSTALLATION_ROOT ${INSTALLATION_ROOT} $CI_SPACK_ENV "" $UPDATE_SPACK_OCI_CACHES $OCI_CACHE_PREFIX
- echo "export SYSTEMNAME=${SYSTEMNAME}" >> ${SANDBOX_ROOT}/.singularity.d/env/90-environment.sh
- echo ". ${INSTALLATION_ROOT}/vendor/spack/var/spack/environments/${CI_SPACK_ENV}/load_env.sh" >> ${SANDBOX_ROOT}/.singularity.d/env/90-environment.sh
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment