Skip to content

Commit 601e8fd

Browse files
EricWFmordante
andauthored
Rehome libcxx-builder docker image & attempt gentler termination. (#71604)
There are three changes present in this PR. 1. Use github packages for libcxx-builder rather than dockerhub. The ldionne/libcxx-builder image will now be hosted at ghcr.io/libcxx/libcxx-builder. This has the benefit of allowing members of the github org to push new versions. In the future I hope to add github actions to rebuild the image as needed. 2. Add docker-compose file The compose file allows to to specify the package repository, so that users can simply write 'docker compose build' and 'docker compose push'. It also gives us a centralized place to manage version arguments which change frequently. 3. Use non-shell CMD form. This may help the google libcxx builders disconnect more gracefully as the shell form of CMD may eat the shutdown signal. I'm hoping this corrects inaccurate agent counts from the buildkite API, since when the VM's terminate, they do so without signaling it to buildkite, which hangs around waiting for them to reconnect. It's likely more changes will be needed though. --------- Co-authored-by: Mark de Wever <[email protected]>
1 parent c4d7321 commit 601e8fd

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

libcxx/utils/ci/Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
# If you're only looking to run the Docker image locally for debugging a
2323
# build bot, see the `run-buildbot-container` script located in this directory.
2424
#
25-
# A pre-built version of this image is maintained on DockerHub as ldionne/libcxx-builder.
26-
# To update the image, rebuild it and push it to ldionne/libcxx-builder (which
27-
# will obviously only work if you have permission to do so).
25+
# A pre-built version of this image is maintained on Github under the libc++ organization, as ghcr.io/libcxx/libcxx-builder.
26+
# To update the image, rebuild it and push it to github (all members of the libc++ organization should be able to do this).
2827
#
29-
# $ docker build -t ldionne/libcxx-builder libcxx/utils/ci
30-
# $ docker push ldionne/libcxx-builder
28+
# $ docker compose build
29+
# $ docker compose push
3130
#
3231

3332
FROM ubuntu:jammy
@@ -66,8 +65,8 @@ RUN locale-gen
6665
# LLVM 15, we still need to have Clang 12 in this Docker image because the LLVM
6766
# 14 release branch CI uses it. The tip-of-trunk CI will never use Clang 12,
6867
# though.
69-
# LLVM POST-BRANCH bump version
70-
ENV LLVM_HEAD_VERSION=18
68+
ARG LLVM_HEAD_VERSION # populated in the docker-compose file
69+
ENV LLVM_HEAD_VERSION=${LLVM_HEAD_VERSION}
7170
RUN apt-get update && apt-get install -y lsb-release wget software-properties-common
7271
RUN wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
7372
RUN bash /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 3)) # for CI transitions
@@ -97,8 +96,9 @@ RUN apt-get update && apt-get install -y llvm-$(($LLVM_HEAD_VERSION - 2))-dev ll
9796
libomp5-$LLVM_HEAD_VERSION
9897

9998
# Install the most recent GCC, like clang install the previous version as a transition.
100-
ENV GCC_LATEST_VERSION=13
10199
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
100+
ARG GCC_LATEST_VERSION # populated in the docker-compose file
101+
ENV GCC_LATEST_VERSION=${GCC_LATEST_VERSION}
102102
RUN apt-get update && apt install -y gcc-$((GCC_LATEST_VERSION - 1)) g++-$((GCC_LATEST_VERSION - 1))
103103
RUN apt-get update && apt install -y gcc-$GCC_LATEST_VERSION g++-$GCC_LATEST_VERSION
104104

@@ -136,4 +136,4 @@ ENV PATH="${PATH}:/home/libcxx-builder/.buildkite-agent/bin"
136136
RUN echo "tags=\"queue=libcxx-builders,arch=$(uname -m),os=linux\"" >> "/home/libcxx-builder/.buildkite-agent/buildkite-agent.cfg"
137137

138138
# By default, start the Buildkite agent (this requires a token).
139-
CMD buildkite-agent start
139+
CMD ["buildkite-agent", "start"]

libcxx/utils/ci/docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3.7'
2+
services:
3+
libcxx-builder:
4+
image: ghcr.io/libcxx/libcxx-builder
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
args:
9+
GCC_LATEST_VERSION: 13
10+
# LLVM POST-BRANCH bump version
11+
LLVM_HEAD_VERSION: 18

libcxx/utils/ci/run-buildbot-container

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ if [[ ! -d "${MONOREPO_ROOT}/libcxx/utils/ci" ]]; then
2626
echo "Was unable to find the root of the LLVM monorepo; are you running from within the monorepo?"
2727
exit 1
2828
fi
29-
docker pull ldionne/libcxx-builder
30-
docker run -it --volume "${MONOREPO_ROOT}:/llvm" --workdir "/llvm" --cap-add=SYS_PTRACE ldionne/libcxx-builder \
29+
docker pull ghcr.io/libcxx/libcxx-builder
30+
docker run -it --volume "${MONOREPO_ROOT}:/llvm" --workdir "/llvm" --cap-add=SYS_PTRACE ghcr.io/libcxx/libcxx-builder \
3131
bash -c 'git config --global --add safe.directory /llvm ; exec bash'

libcxx/utils/ci/vendor/android/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#===----------------------------------------------------------------------===##
88

99
#
10-
# This Dockerfile extends ldionne/libcxx-builder with Android support, including
10+
# This Dockerfile extends ghcr.io/libcxx/libcxx-builder with Android support, including
1111
# Android Clang and sysroot, Android platform-tools, and the Docker client.
1212
#
1313
# $ docker build -t libcxx-builder-android libcxx/utils/ci/vendor/android
1414
#
1515

16-
FROM ldionne/libcxx-builder
16+
FROM ghcr.io/libcxx/libcxx-builder
1717

1818
# Switch back to the root user to install things into /opt and /usr.
1919
USER root

0 commit comments

Comments
 (0)