Skip to content

build-eic: support comma-separated --build-type (default,nightly)#252

Merged
wdconinc merged 2 commits intocopilot/extract-build-scriptsfrom
copilot/build-eic-multi-type
Apr 23, 2026
Merged

build-eic: support comma-separated --build-type (default,nightly)#252
wdconinc merged 2 commits intocopilot/extract-build-scriptsfrom
copilot/build-eic-multi-type

Conversation

@wdconinc
Copy link
Copy Markdown
Contributor

Summary

Extend build-eic.sh to accept a comma-separated --build-type argument (default: "default,nightly") so both image variants can be built in a single invocation.

Motivation

When default and nightly builds run sequentially on the same runner, BuildKit's layer cache already contains the four shared stages after the default build:

  • builder_concretization_default
  • builder_installation_default (most expensive: full Spack compile)
  • runtime_concretization_default
  • runtime_installation_default

The nightly build reuses these without re-executing Spack compilation or pulling large layers from the registry.

Additional savings: 7 benchmark/campaign SHA resolutions and mirrors.yaml generation happen once instead of twice.

Changes

build-eic.sh

  • Default for BUILD_TYPE changed from "default" to "default,nightly"
  • Validates and splits the comma-separated list; rejects unknown types
  • Shared setup (benchmark SHAs, mirrors.yaml, SPACK_DUPLICATE_ALLOWLIST, ARCH) runs once before the loop
  • Per-type loop resolves EIC package SHAs and builds the docker buildx command; writes build-${build_type}.log and ${METADATA_FILE%.json}-${build_type}.json

.gitlab-ci.yml

  • Restructures the eic parallel matrix from 16 → 10 jobs by using BUILD_TYPE: "default,nightly" as a plain string (not a list dimension)
  • Drops ${BUILD_TYPE} from METADATA_FILE template (script appends it)
  • Updates .build artifacts glob to build-*.log
  • Fixes .nightly rules: combined jobs override BUILD_TYPE to "default" on stable branches; nightly-only jobs (ci_without_acts) keep when: never

.github/workflows/build-push.yml

  • Sets BUILD_TYPE: "default,nightly" for ci and xl matrix entries (GitHub Actions now also builds nightly)
  • Exports one digest file per build type; uploads as separate named artifacts
  • Adds BUILD_TYPE: [default, nightly] dimension to eic-manifest matrix; updates artifact download pattern and tags

Build both default and nightly images in a single sequential invocation
so that the four shared Docker stages (builder/runtime concretization and
installation of the default spack environment) are reused from BuildKit's
layer cache.  Cuts redundant Spack compilation for nightly builds that
follow a default build on the same runner.

Key changes:
- build-eic.sh: change BUILD_TYPE default to "default,nightly"; split on
  comma; validate each token; loop over types – resolving EIC package SHAs
  and constructing the docker-buildx command per iteration.  Shared setup
  (benchmark SHAs, mirrors.yaml, SPACK_DUPLICATE_ALLOWLIST, ARCH) runs once
  before the loop.  Metadata files are written as
  ${METADATA_FILE%.json}-<build_type>.json; logs as build-<build_type>.log.
- .gitlab-ci.yml: restructure eic parallel matrix from 16 to 10 jobs by
  using BUILD_TYPE="default,nightly" as a plain string (not a list dimension)
  for environments that previously had separate default and nightly rows.
  Drop ${BUILD_TYPE} from METADATA_FILE (script now appends it).  Update
  .build artifacts glob to build-*.log.  Fix .nightly rules so that combined
  jobs override BUILD_TYPE to "default" on stable branches (instead of
  matching only the now-absent BUILD_TYPE=="nightly" string), while
  nightly-only jobs (ci_without_acts) retain when:never semantics.
- .github/workflows/build-push.yml: set BUILD_TYPE="default,nightly" for
  ci and xl matrix entries.  Export one digest file per build type and
  upload as separate artifacts.  Add BUILD_TYPE dimension to eic-manifest
  matrix; update artifact download pattern; add build-type-aware tags.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 23, 2026 18:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the container build tooling to support building multiple EIC image variants (default + nightly) in a single build-eic.sh invocation, enabling better BuildKit cache reuse and reducing CI job fan-out across GitLab CI and GitHub Actions.

Changes:

  • Extend build-eic.sh to accept a comma-separated --build-type list and build each type sequentially with per-type logs and metadata files.
  • Restructure .gitlab-ci.yml EIC build matrix to use combined BUILD_TYPE: "default,nightly" where appropriate, reducing parallel jobs and updating artifact collection.
  • Update .github/workflows/build-push.yml to build combined types, export/upload per-type digest artifacts, and push per-type manifests/tags.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
build-eic.sh Adds comma-separated build-type parsing and loops builds per type, generating per-type logs/metadata.
.gitlab-ci.yml Reduces matrix size via combined build types, adjusts nightly rules, and changes artifacts globbing.
.github/workflows/build-push.yml Exports/upload per-type digest artifacts and pushes manifests per build type.

Comment thread .gitlab-ci.yml
Comment thread .gitlab-ci.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@wdconinc wdconinc merged commit 545b988 into copilot/extract-build-scripts Apr 23, 2026
1 of 2 checks passed
@wdconinc wdconinc deleted the copilot/build-eic-multi-type branch April 23, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants