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

feat: mv remaining staging layers to builder

parent 79b4a273
Branches
Tags
No related merge requests found
This commit is part of merge request !988. Comments created here will be created in the context of that merge request.
...@@ -6,7 +6,7 @@ ARG RUNTIME_IMAGE="debian_stable_base" ...@@ -6,7 +6,7 @@ ARG RUNTIME_IMAGE="debian_stable_base"
ARG INTERNAL_TAG="testing" ARG INTERNAL_TAG="testing"
## ======================================================================================== ## ========================================================================================
## STAGE0: spack image ## STAGE 0: spack image
## EIC spack image with spack and eic-spack repositories ## EIC spack image with spack and eic-spack repositories
## ======================================================================================== ## ========================================================================================
FROM ${DOCKER_REGISTRY}${BUILDER_IMAGE}:${INTERNAL_TAG} as spack FROM ${DOCKER_REGISTRY}${BUILDER_IMAGE}:${INTERNAL_TAG} as spack
...@@ -133,7 +133,7 @@ EOF ...@@ -133,7 +133,7 @@ EOF
## ======================================================================================== ## ========================================================================================
## STAGE1: builder ## STAGE 1: builder
## EIC builder image with spack environment ## EIC builder image with spack environment
## ======================================================================================== ## ========================================================================================
FROM spack as builder FROM spack as builder
...@@ -244,18 +244,16 @@ set -e ...@@ -244,18 +244,16 @@ set -e
spack env activate --sh --dir ${SPACK_ENV} > /etc/profile.d/z10_spack_environment.sh spack env activate --sh --dir ${SPACK_ENV} > /etc/profile.d/z10_spack_environment.sh
EOF EOF
## make sure we have the entrypoints setup correctly ## Fixup /opt/detector/epic-git.fcf90937193c983c0af2acf1251e01f2e2c3a259_main
ENTRYPOINT [] RUN <<EOF
CMD ["bash", "--rcfile", "/etc/profile", "-l"] shopt -s nullglob
USER 0 cd /opt/detector
WORKDIR / for detector in epic-git.*_* ; do
ln -s ${detector} epic-${detector/*_/}
done
## ======================================================================================== EOF
## STAGE 2: staging image with unnecessariy packages removed and stripped binaries
## ========================================================================================
FROM builder as staging
## Fill jug_info
RUN <<EOF RUN <<EOF
set -ex set -ex
spack debug report | sed "s/^/ - /" | sed "s/\* \*\*//" | sed "s/\*\*//" >> /etc/jug_info spack debug report | sed "s/^/ - /" | sed "s/\* \*\*//" | sed "s/\*\*//" >> /etc/jug_info
...@@ -272,15 +270,6 @@ COPY profile.d/a00_cleanup.sh /etc/profile.d ...@@ -272,15 +270,6 @@ COPY profile.d/a00_cleanup.sh /etc/profile.d
COPY profile.d/z11_jug_env.sh /etc/profile.d COPY profile.d/z11_jug_env.sh /etc/profile.d
COPY singularity.d /.singularity.d COPY singularity.d /.singularity.d
## Fixup /opt/detector/epic-git.fcf90937193c983c0af2acf1251e01f2e2c3a259_main
RUN <<EOF
shopt -s nullglob
cd /opt/detector
for detector in epic-git.*_* ; do
ln -s ${detector} epic-${detector/*_/}
done
EOF
## Add minio client into /opt/local/bin ## Add minio client into /opt/local/bin
ADD --chmod=0755 https://dl.min.io/client/mc/release/linux-amd64/mc /opt/local/bin/mc-amd64 ADD --chmod=0755 https://dl.min.io/client/mc/release/linux-amd64/mc /opt/local/bin/mc-amd64
ADD --chmod=0755 https://dl.min.io/client/mc/release/linux-arm64/mc /opt/local/bin/mc-arm64 ADD --chmod=0755 https://dl.min.io/client/mc/release/linux-arm64/mc /opt/local/bin/mc-arm64
...@@ -294,9 +283,15 @@ for t in ${target[*]} ; do ...@@ -294,9 +283,15 @@ for t in ${target[*]} ; do
done done
EOF EOF
## make sure we have the entrypoints setup correctly
ENTRYPOINT []
CMD ["bash", "--rcfile", "/etc/profile", "-l"]
USER 0
WORKDIR /
## ======================================================================================== ## ========================================================================================
## STAGE 3 ## STAGE 2
## Lean target image ## Lean target image
## ======================================================================================== ## ========================================================================================
FROM ${DOCKER_REGISTRY}${RUNTIME_IMAGE}:${INTERNAL_TAG} as runtime FROM ${DOCKER_REGISTRY}${RUNTIME_IMAGE}:${INTERNAL_TAG} as runtime
...@@ -306,17 +301,17 @@ LABEL maintainer="Sylvester Joosten <sjoosten@anl.gov>" \ ...@@ -306,17 +301,17 @@ LABEL maintainer="Sylvester Joosten <sjoosten@anl.gov>" \
name="jug_xl" \ name="jug_xl" \
march="$TARGETPLATFORM" march="$TARGETPLATFORM"
## copy over everything we need from staging ## copy over everything we need from builder
COPY --from=staging /opt/spack /opt/spack COPY --from=builder /opt/spack /opt/spack
COPY --from=staging /opt/spack-environment /opt/spack-environment COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=staging /opt/software /opt/software COPY --from=builder /opt/software /opt/software
COPY --from=staging /opt/._local /opt/._local COPY --from=builder /opt/._local /opt/._local
COPY --from=staging /opt/._detector /opt/._detector COPY --from=builder /opt/._detector /opt/._detector
COPY --from=staging /etc/profile.d /etc/profile.d COPY --from=builder /etc/profile.d /etc/profile.d
COPY --from=staging /etc/jug_info /etc/jug_info COPY --from=builder /etc/jug_info /etc/jug_info
COPY --from=staging /etc/eic-env.sh /etc/eic-env.sh COPY --from=builder /etc/eic-env.sh /etc/eic-env.sh
COPY --from=staging /.singularity.d /.singularity.d COPY --from=builder /.singularity.d /.singularity.d
COPY --from=staging /usr/bin/docker-shell /usr/bin/docker-shell COPY --from=builder /usr/bin/docker-shell /usr/bin/docker-shell
## Use spack entrypoint. NOTE: Requires `set -ex` in all multi-line scripts! ## Use spack entrypoint. NOTE: Requires `set -ex` in all multi-line scripts!
ENV SPACK_ROOT=/opt/spack ENV SPACK_ROOT=/opt/spack
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment