Skip to content

Commit 7a74815

Browse files
committed
Revert "feat: move from two-track to three-track container build (#115)"
This reverts commit 4e49b9c.
1 parent 638a9aa commit 7a74815

3 files changed

Lines changed: 59 additions & 43 deletions

File tree

.github/workflows/build-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ jobs:
406406
arch: amd64
407407
runner: ubuntu-latest
408408
PLATFORM: linux/amd64
409-
target: builder_concretization_custom
409+
target: builder_concretization_default
410410
fail-fast: false
411411
steps:
412412
- name: Free Disk Space (Ubuntu)

containers/eic/Dockerfile

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ ARG RUNTIME_IMAGE="debian_stable_base"
66
ARG 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
115110
ARG 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
121116
COPY --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)
133139
RUN --mount=type=cache,target=/var/cache/spack \
134140
--mount=type=secret,id=mirrors,target=/opt/spack/etc/spack/mirrors.yaml \
@@ -147,7 +153,7 @@ EOF
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
151157
ARG 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
240246
ARG 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
246252
ENV 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)
259276
RUN --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
273290
ARG 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
279296
RUN <<EOF

docs/architecture.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,29 @@ The EIC container infrastructure uses a multi-stage build approach with separate
44

55
## Build Strategy
66

7-
The container build follows a three-track approach:
7+
The container build follows a two-track approach:
88

99
```mermaid
1010
flowchart TB
11-
subgraph "Builder Concretization Track"
11+
subgraph "Builder Track"
1212
A[builder_image<br/>debian_stable_base] --> B[builder_concretization_default<br/>Concretize spack environment]
13-
B --> C[builder_concretization_custom<br/>Concretize custom versions]
14-
end
15-
16-
subgraph "Builder Installation Track"
17-
B --> D[builder_installation_default<br/>Build packages]
18-
C --> E[builder_installation_custom<br/>Build custom packages]
13+
B --> C[builder_installation_default<br/>Build packages]
14+
C --> D[builder_concretization_custom<br/>Concretize custom versions]
15+
D --> E[builder_installation_custom<br/>Build custom packages]
1916
end
2017
2118
subgraph "Runtime Track"
22-
F[runtime_image<br/>debian_stable_base] --> G[runtime_default<br/>Copy spack.lock, install from buildcache]
23-
G --> H[runtime_custom<br/>Copy custom spack.lock, install from buildcache]
24-
H --> K[Final Image<br/>eic_ci / eic_xl]
19+
F[runtime_image<br/>debian_stable_base] --> G[runtime_concretization_default<br/>Copy spack.lock from builder]
20+
G --> H[runtime_installation_default<br/>Install from buildcache]
21+
H --> I[runtime_concretization_custom<br/>Copy custom spack.lock]
22+
I --> J[runtime_installation_custom<br/>Install custom from buildcache]
23+
J --> K[Final Image<br/>eic_ci / eic_xl]
2524
end
2625
27-
D -.->|spack.lock| G
28-
D -.->|buildcache| G
29-
E -.->|spack.lock| H
30-
E -.->|buildcache| H
26+
C -.->|spack.lock| G
27+
C -.->|buildcache| H
28+
E -.->|spack.lock| I
29+
E -.->|buildcache| J
3130
```
3231

3332
## Multi-Architecture Support

0 commit comments

Comments
 (0)