#===----------------------------------------------------------------------===## # # 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. # You can build & push both images using: # # docker compose build # docker compose push # # Or you can select a single image to build & push using: # # docker compose build buildkite-builder # docker compose push buildkite-builder # # The final images can be found at # # ghcr.io/libcxx/buildkite-builder # ghcr.io/libcxx/actions-builder # ghcr.io/libcxx/android-buildkite-builder # # Members of the github.com/libcxx/ organizations have permissions required to push new images. # # ===----------------------------------------------------------------------===## # 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. # 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 # 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_LATEST_VERSION ENV GCC_LATEST_VERSION=${GCC_LATEST_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 libcxx-builder WORKDIR /home/libcxx-builder # Reset the configuration, we pass the configuration via the environment. RUN cp /home/libcxx-builder/.buildkite-agent/buildkite-agent.dist.cfg \ /home/libcxx-builder/.buildkite-agent/buildkite-agent.cfg # Modify the Buildkite agent cmdline to do Android setup stuff first. CMD /opt/android/container-setup.sh && buildkite-agent start # ===----------------------------------------------------------------------===## # Github Actions Builder Image # ===----------------------------------------------------------------------===## # # IMAGE: ghcr.io/libcxx/actions-builder. # FROM builder-base AS actions-builder # Install 'act' for running github actions locally. This provides an alternative to the run-buildbot script # while still providing reproducability. RUN curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash WORKDIR /home/runner USER runner