@@ -6,9 +6,9 @@ ARG RUNTIME_IMAGE="debian_stable_base"
66ARG INTERNAL_TAG="master"
77
88# #
9- # # This docker build follows three tracks, in order to ensure that we build all packages
9+ # # This docker build follows two tracks, in order to ensure that we build all packages
1010# # in a builder image, but install them in a runtime image, while at the same time
11- # # avoiding an expensive filesystem copy operation at the end that breaks layering.
11+ # # avoiding a expensive filesystem copy operation at the end that breaks layering.
1212# #
1313# # The build is split in an infrequently-changing default environment, upon which
1414# # an environment with custom versions (e.g. individual commits) is layered. The
@@ -18,20 +18,15 @@ ARG INTERNAL_TAG="master"
1818# # The separation in a builder and runtime image is particularly relevant to end up with
1919# # lightweight images for expensive build dependencies, such as for example CUDA.
2020# #
21- # # builder track: runtime track:
22- # # concretization: installation: concretization/installation:
23- # # ---------------------------------------------------------------------------------------
21+ # # builder track runtime track
22+ # # ----------------------------------------------------------------------
2423# # builder_image runtime_image
2524# # builder_concretization_default
26- # # \-> builder_installation_default
27- # # runtime_default
28- # # (copy spack.lock from builder_installation_default)
29- # # (install via buildcache)
30- # # \-> builder_concretization_custom
31- # # \-> builder_installation_custom
32- # # \-> runtime_custom
33- # # (copy spack.lock from builder_installation_custom)
34- # # (install via buildcache)
25+ # # builder_installation_default -> runtime_concretization_default (copy spack.lock)
26+ # # \-> runtime_installation_default (from buildcache)
27+ # # builder_concretization_custom
28+ # # builder_installation_custom -> runtime_concretization_custom (copy spack.lock)
29+ # # \-> runtime_installation_custom (from buildcache)
3530# #
3631
3732
@@ -108,14 +103,14 @@ EOF
108103
109104
110105# # ========================================================================================
111- # # runtime_default
112- # # - runtime base with installation of default versions (buildcache populated by builder)
106+ # # runtime_concretization_default
107+ # # - runtime base with concretization of default versions (taken from equivalent builder)
113108# # ========================================================================================
114- FROM ${DOCKER_REGISTRY}${RUNTIME_IMAGE}:${INTERNAL_TAG} AS runtime_default
109+ FROM ${DOCKER_REGISTRY}${RUNTIME_IMAGE}:${INTERNAL_TAG} AS runtime_concretization_default
115110ARG TARGETPLATFORM
116111
117112# Open Container Initiative labels
118- LABEL org.opencontainers.image.title="Electron-Ion Collider runtime image (default configuration, $TARGETPLATFORM)"
113+ LABEL org.opencontainers.image.title="Electron-Ion Collider runtime concretization image (default configuration, $TARGETPLATFORM)"
119114
120115# # Copy our default environment
121116COPY --from=spack-environment . /opt/spack-environment/
@@ -129,6 +124,17 @@ COPY --from=builder_installation_default \
129124 /opt/spack-environment/${ENV}/spack.* \
130125 /opt/spack-environment/${ENV}/
131126
127+
128+ # # ========================================================================================
129+ # # runtime_installation_default
130+ # # - runtime base with installation of default versions (buildcache populated by builder)
131+ # # ========================================================================================
132+ FROM runtime_concretization_default AS runtime_installation_default
133+ ARG TARGETPLATFORM
134+
135+ # Open Container Initiative labels
136+ LABEL org.opencontainers.image.title="Electron-Ion Collider runtime installation image (default configuration, $TARGETPLATFORM)"
137+
132138# Installation (default environment, from buildcache)
133139RUN --mount=type=cache,target=/var/cache/spack \
134140 --mount=type=secret,id=mirrors,target=/opt/spack/etc/spack/mirrors.yaml \
147153# # builder_concretization_custom
148154# # - builder base with concretization of custom versions
149155# # ========================================================================================
150- FROM builder_concretization_default AS builder_concretization_custom
156+ FROM builder_installation_default AS builder_concretization_custom
151157ARG TARGETPLATFORM
152158
153159# Open Container Initiative labels
@@ -233,14 +239,14 @@ EOF
233239
234240
235241# # ========================================================================================
236- # # runtime_custom
237- # # - runtime base with installation of custom versions (buildcache populated by builder)
242+ # # runtime_concretization_custom
243+ # # - runtime base with concretization of custom versions (taken from equivalent builder)
238244# # ========================================================================================
239- FROM runtime_default AS runtime_custom
245+ FROM runtime_installation_default AS runtime_concretization_custom
240246ARG TARGETPLATFORM
241247
242248# Open Container Initiative labels
243- LABEL org.opencontainers.image.title="Electron-Ion Collider runtime image (custom configuration, $TARGETPLATFORM)"
249+ LABEL org.opencontainers.image.title="Electron-Ion Collider runtime concretization image (custom configuration, $TARGETPLATFORM)"
244250
245251# Set spack environment directory
246252ENV SPACK_ENV=/opt/spack-environment/${ENV}/epic
@@ -255,7 +261,18 @@ COPY --from=builder_installation_custom \
255261 /opt/spack-environment/packages.yaml \
256262 /opt/spack-environment/
257263
258- # Installation (custom environment, from buildcache)
264+
265+ # # ========================================================================================
266+ # # runtime_installation_custom
267+ # # - runtime base with installation of custom versions (buildcache populated by builder)
268+ # # ========================================================================================
269+ FROM runtime_concretization_custom AS runtime_installation_custom
270+ ARG TARGETPLATFORM
271+
272+ # Open Container Initiative labels
273+ LABEL org.opencontainers.image.title="Electron-Ion Collider runtime installation image (custom configuration, $TARGETPLATFORM)"
274+
275+ # Installation (default environment, from buildcache)
259276RUN --mount=type=cache,target=/var/cache/spack \
260277 --mount=type=secret,id=mirrors,target=/opt/spack/etc/spack/mirrors.yaml \
261278 <<EOF
@@ -267,13 +284,13 @@ EOF
267284
268285
269286# # ========================================================================================
270- # # final image, based on runtime_custom
287+ # # final image, based on runtime_installation_custom
271288# # ========================================================================================
272- FROM runtime_custom AS final
289+ FROM runtime_installation_custom AS final
273290ARG TARGETPLATFORM
274291
275292# Open Container Initiative labels
276- LABEL org.opencontainers.image.title="Electron-Ion Collider runtime image (custom configuration, $TARGETPLATFORM)"
293+ LABEL org.opencontainers.image.title="Electron-Ion Collider runtime installation image (custom configuration, $TARGETPLATFORM)"
277294
278295# # Ensure views directories, not symlinks
279296RUN <<EOF
0 commit comments