Skip to content

Commit c93083a

Browse files
boomanaiden154TIFitis
authored andcommitted
[libcxx] Enable installing new runner binary on existing container
This patch does some refactoring to enable installing a new GHA runner binary into an existing libcxx image. We achieve this by pushing the base image to the registry and enabling control over the base image used for building the actions image. This will always build and push both images even if an existing image is being used for the actions image, but this should not impact anything as the SHAs are pinned everywhere and space/build time is not a large concern. Reviewers: ldionne, EricWF, #reviewers-libcxx Reviewed By: ldionne Pull Request: #148073
1 parent 02bd064 commit c93083a

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.github/workflows/libcxx-build-containers.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434

3535
- name: Build the Linux builder image
3636
working-directory: libcxx/utils/ci
37-
run: docker compose build actions-builder
37+
run: |
38+
docker compose build builder-base
39+
docker compose build actions-builder
3840
env:
3941
TAG: ${{ github.sha }}
4042

@@ -55,6 +57,7 @@ jobs:
5557
if: github.event_name == 'push'
5658
working-directory: libcxx/utils/ci
5759
run: |
60+
docker compose push builder-base
5861
docker compose push actions-builder
5962
env:
6063
TAG: ${{ github.sha }}

libcxx/utils/ci/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# If you're only looking to run the Docker image locally for debugging a
3939
# build bot, see the `run-buildbot-container` script located in this directory.
4040

41+
ARG ACTIONS_BASE_IMAGE
4142

4243
# HACK: We set the base image in the docker-compose file depending on the final target (buildkite vs github actions).
4344
# This means we have a much slower container build, but we can use the same Dockerfile for both targets.
@@ -309,7 +310,7 @@ CMD /opt/android/container-setup.sh && buildkite-agent start
309310
#
310311
# IMAGE: ghcr.io/libcxx/actions-builder.
311312
#
312-
FROM builder-base AS actions-builder
313+
FROM $ACTIONS_BASE_IMAGE AS actions-builder
313314

314315
ARG GITHUB_RUNNER_VERSION
315316

libcxx/utils/ci/docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ x-versions: &compiler_versions
33
LLVM_HEAD_VERSION: 21
44

55
services:
6+
builder-base:
7+
image: ghcr.io/llvm/libcxx-linux-builder-base:${TAG}
8+
build:
9+
context: .
10+
dockerfile: Dockerfile
11+
target: builder-base
12+
args:
13+
BASE_IMAGE: ubuntu:jammy
14+
<<: *compiler_versions
15+
616
actions-builder:
717
image: ghcr.io/llvm/libcxx-linux-builder:${TAG}
818
build:
@@ -11,6 +21,7 @@ services:
1121
target: actions-builder
1222
args:
1323
BASE_IMAGE: ubuntu:jammy
24+
ACTIONS_BASE_IMAGE: builder-base
1425
GITHUB_RUNNER_VERSION: "2.326.0"
1526
<<: *compiler_versions
1627

0 commit comments

Comments
 (0)