# ===----------------------------------------------------------------------===## # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ===----------------------------------------------------------------------===## # # This file defines the buildkite and github actions builder images. # This images are tagged with . You can build both images using: # # TAG= docker compose build # # Or you can select a single image to build # # TAG=test docker compose build actions-builder # # The final images can be found at # # ghcr.io/libcxx/libcxx-linux-builder # ghcr.io/libcxx/android-buildkite-builder # # Members of the github.com/libcxx/ organizations can push new images to the CI. # This is done by GitHub actions in the https://github.com/libcxx/builders repo. # # ===----------------------------------------------------------------------===## # Running the buildkite image # ===----------------------------------------------------------------------===## # # To start a Buildkite Agent, run it as: # $ docker run --env-file -it $(docker build -q libcxx/utils/ci) # # The environment variables in `` should be the ones necessary # to run a BuildKite agent: # # BUILDKITE_AGENT_TOKEN= # # If you're only looking to run the Docker image locally for debugging a # build bot, see the `run-buildbot-container` script located in this directory. ARG ACTIONS_BASE_IMAGE # HACK: We set the base image in the docker-compose file depending on the final target (buildkite vs github actions). # This means we have a much slower container build, but we can use the same Dockerfile for both targets. ARG BASE_IMAGE FROM $BASE_IMAGE AS builder-base # Changing this file causes a rebuild of the image in a GitHub action. # However, it does not cause the CI runners to switch to that image # automatically, that must be done by updating the SHA in the Github workflow # file. The date uses the ISO format YYYY-MM-DD. RUN echo "Last forced update executed on 2025-04-28." # Make sure apt-get doesn't try to prompt for stuff like our time zone, etc. ENV DEBIAN_FRONTEND=noninteractive # populated in the docker-compose file ARG GCC_HEAD_VERSION ENV GCC_HEAD_VERSION=${GCC_HEAD_VERSION} # populated in the docker-compose file ARG LLVM_HEAD_VERSION ENV LLVM_HEAD_VERSION=${LLVM_HEAD_VERSION} # HACK: The github actions runner image already has sudo and requires its use. The buildkite base image does not. # Reconcile this. RUN <, and ToT, which are the ones we support. # We also install because we need to support the "latest-1" of the # current LLVM release branch, which is effectively the of the # tip-of-trunk LLVM. For example, after branching LLVM 14 but before branching # LLVM 15, we still need to have Clang 12 in this Docker image because the LLVM # 14 release branch CI uses it. The tip-of-trunk CI will never use Clang 12, # though. RUN <> /home/libcxx-builder/.buildkite-agent/buildkite-agent.cfg EOF USER libcxx-builder WORKDIR /home/libcxx-builder ENV PATH="${PATH}:/home/libcxx-builder/.buildkite-agent/bin" CMD ["buildkite-agent", "start"] # ===----------------------------------------------------------------------===## # Android Buildkite Builder Image # ===----------------------------------------------------------------------===## # # IMAGE: ghcr.io/libcxx/android-buildkite-builder. # FROM buildkite-builder AS android-buildkite-builder COPY --from=android-builder-base /opt/android /opt/android COPY ./vendor/android/container-setup.sh /opt/android/container-setup.sh ENV PATH="/opt/android/sdk/platform-tools:${PATH}" USER root # Install Docker RUN <> /etc/sudoers WORKDIR /home/gha USER gha ENV RUNNER_MANUALLY_TRAP_SIG=1 ENV ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1 RUN mkdir actions-runner && \ cd actions-runner && \ curl -O -L https://github.com/actions/runner/releases/download/v$GITHUB_RUNNER_VERSION/actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \ tar xzf ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz && \ rm ./actions-runner-linux-x64-$GITHUB_RUNNER_VERSION.tar.gz