Lines Matching +full:python3 +full:- +full:github
1 # ===----------------------------------------------------------------------===##
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 # ===----------------------------------------------------------------------===##
9 # This file defines the buildkite and github actions builder images.
16 # docker compose build buildkite-builder
20 # ghcr.io/libcxx/buildkite-builder
21 # ghcr.io/libcxx/actions-builder
22 # ghcr.io/libcxx/android-buildkite-builder
24 # Members of the github.com/libcxx/ organizations can push new images to the CI.
25 # This is done by GitHub actions in the https://github.com/libcxx/builders repo.
27 # ===----------------------------------------------------------------------===##
29 # ===----------------------------------------------------------------------===##
32 # $ docker run --env-file <secrets> -it $(docker build -q libcxx/utils/ci)
40 # build bot, see the `run-buildbot-container` script located in this directory.
43 # HACK: We set the base image in the docker-compose file depending on the final target (buildkite vs github actions).
46 FROM $BASE_IMAGE AS builder-base
48 # Make sure apt-get doesn't try to prompt for stuff like our time zone, etc.
51 # populated in the docker-compose file
55 # populated in the docker-compose file
59 # HACK: The github actions runner image already has sudo and requires its use. The buildkite base image does not.
62 apt-get update || true
63 apt-get install -y sudo || true
69 RUN sudo apt-get update \
70 && sudo apt-get install -y \
73 RUN sudo apt-get update \
74 && sudo apt-get install -y \
81 language-pack-en \
82 language-pack-fr \
83 language-pack-ja \
84 language-pack-ru \
85 language-pack-zh-hans \
86 libedit-dev \
87 libncurses5-dev \
88 libpython3-dev \
89 libxml2-dev \
90 lsb-release \
92 python3 \
93 python3-dev \
94 python3-packaging \
95 python3-setuptools \
96 python3-psutil \
97 software-properties-common \
100 uuid-dev \
102 xz-utils \
103 && sudo rm -rf /var/lib/apt/lists/*
106 #RUN apt-get update && apt-get install -y ninja-build python3 python3-distutils python3-psutil git gdb ccache
107 # TODO add ninja-build once 1.11 is available in Ubuntu, also remove the manual installation.
109 set -e
110 wget -qO /tmp/ninja.gz https://github.com/ninja-build/ninja/releases/latest/download/ninja-linux.zip
119 set -e
120 printf "fr_CA ISO-8859-1\ncs_CZ ISO-8859-2" | sudo tee -a /etc/locale.gen
122 printf "fr_CA ISO-8859-1\ncs_CZ ISO-8859-2" | sudo tee -a /usr/local/share/i1en/SUPPORTED
123 sudo locale-gen
126 # Install Clang <latest>, <latest-1> and ToT, which are the ones we support.
127 # We also install <latest-2> because we need to support the "latest-1" of the
128 # current LLVM release branch, which is effectively the <latest-2> of the
129 # tip-of-trunk LLVM. For example, after branching LLVM 14 but before branching
131 # 14 release branch CI uses it. The tip-of-trunk CI will never use Clang 12,
134 set -e
135 sudo apt-get update
136 wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
138 sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 3)) all # for CI transitions
139 sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 2)) all # previous release
140 sudo /tmp/llvm.sh $(($LLVM_HEAD_VERSION - 1)) all # latest release
142 sudo apt-get install -y libomp5-$LLVM_HEAD_VERSION
143 sudo rm -rf /var/lib/apt/lists/*
148 set -e
149 sudo git clone https://github.com/compiler-explorer/infra.git /tmp/ce-infra
150 (cd /tmp/ce-infra && sudo make ce)
151 sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $GCC_LATEST_VERSION.1.0
152 sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $((GCC_LATEST_VERSION - 1)).1.0
153 sudo ln -s /opt/compiler-explorer/gcc-$GCC_LATEST_VERSION.1.0/bin/gcc /usr/bin/gcc-$GCC_LATEST_VERSION
154 sudo ln -s /opt/compiler-explorer/gcc-$GCC_LATEST_VERSION.1.0/bin/g++ /usr/bin/g++-$GCC_LATEST_VERSION
155 sudo ln -s /opt/compiler-explorer/gcc-$((GCC_LATEST_VERSION - 1)).1.0/bin/gcc /usr/bin/gcc-$((GCC_LATEST_VERSION - 1))
156 sudo ln -s /opt/compiler-explorer/gcc-$((GCC_LATEST_VERSION - 1)).1.0/bin/g++ /usr/bin/g++-$((GCC_LATEST_VERSION - 1))
157 sudo rm -rf /tmp/ce-infra
162 set -e
163 wget https://github.com/Kitware/CMake/releases/download/v3.24.4/cmake-3.24.4-linux-x86_64.sh -O /tmp/install-cmake.sh
164 sudo bash /tmp/install-cmake.sh --prefix=/usr --exclude-subdir --skip-license
165 rm /tmp/install-cmake.sh
168 # ===----------------------------------------------------------------------===##
170 # ===----------------------------------------------------------------------===##
172 FROM ubuntu:jammy AS android-builder-base
178 RUN apt-get update && apt-get install -y curl bzip2 git unzip
182 set -e
183 mkdir -p /opt/android/sdk
185 curl -LO https://dl.google.com/android/repository/platform-tools-latest-linux.zip
186 unzip platform-tools-latest-linux.zip
187 rm platform-tools-latest-linux.zip
196 set -e
197 git clone --filter=blob:none --sparse \
198 https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 \
200 git -C /opt/android/clang checkout ${ANDROID_CLANG_PREBUILTS_COMMIT}
201 git -C /opt/android/clang sparse-checkout add clang-${ANDROID_CLANG_VERSION}
202 rm -fr /opt/android/clang/.git
203 ln -sf /opt/android/clang/clang-${ANDROID_CLANG_VERSION} /opt/android/clang/clang-current
204 # The "git sparse-checkout" and "ln" commands succeed even if nothing was
206 ls /opt/android/clang/clang-current/bin/clang
210 # https://ci.android.com/builds/branches/aosp-main/grid, the "ndk" target. The
216 set -e
218 curl -L -o ndk_platform.tar.bz2 \
224 # ===----------------------------------------------------------------------===##
226 # ===----------------------------------------------------------------------===##
228 # IMAGE: ghcr.io/libcxx/buildkite-builder.
230 FROM builder-base AS buildkite-builder
232 # Create the libcxx-builder user, regardless of if we use it or not
233 RUN sudo useradd --create-home libcxx-builder
235 USER libcxx-builder
236 WORKDIR /home/libcxx-builder
238 # Install the Buildkite agent and dependencies. This must be done as non-root
241 set -e
242 cd /home/libcxx-builder
243 curl -sL https://raw.githubusercontent.com/buildkite/agent/main/install.sh -o /tmp/install-agent.sh
244 bash /tmp/install-agent.sh
245 rm /tmp/install-agent.sh
246 echo "tags=\"queue=libcxx-builders,arch=$(uname -m),os=linux\"" \
247 >> /home/libcxx-builder/.buildkite-agent/buildkite-agent.cfg
250 USER libcxx-builder
251 WORKDIR /home/libcxx-builder
253 ENV PATH="${PATH}:/home/libcxx-builder/.buildkite-agent/bin"
255 CMD ["buildkite-agent", "start"]
257 # ===----------------------------------------------------------------------===##
259 # ===----------------------------------------------------------------------===##
261 # IMAGE: ghcr.io/libcxx/android-buildkite-builder.
263 FROM buildkite-builder AS android-buildkite-builder
265 COPY --from=android-builder-base /opt/android /opt/android
266 COPY ./vendor/android/container-setup.sh /opt/android/container-setup.sh
268 ENV PATH="/opt/android/sdk/platform-tools:${PATH}"
274 set -e
275 curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
276 sh /tmp/get-docker.sh
277 rm /tmp/get-docker.sh
286 USER libcxx-builder
287 WORKDIR /home/libcxx-builder
290 RUN cp /home/libcxx-builder/.buildkite-agent/buildkite-agent.dist.cfg \
291 /home/libcxx-builder/.buildkite-agent/buildkite-agent.cfg
294 CMD /opt/android/container-setup.sh && buildkite-agent start
296 # ===----------------------------------------------------------------------===##
297 # Github Actions Builder Image
298 # ===----------------------------------------------------------------------===##
300 # IMAGE: ghcr.io/libcxx/actions-builder.
302 FROM builder-base AS actions-builder