From 1179f605f778aaa87b02adcea31377937b05dc6d Mon Sep 17 00:00:00 2001 From: Hugo Mano Date: Tue, 20 Oct 2026 09:31:03 +0200 Subject: [PATCH] ci: remote build (#924) Local runner growing disk usage will be handled in another PR. --- .bazelrc | 2 ++ .github/workflows/ci.yaml | 35 ++++++++++++++--------------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.bazelrc b/.bazelrc index 1b47d230..09c50737 100644 --- a/.bazelrc +++ b/.bazelrc @@ -120,8 +120,10 @@ common:remote --remote_cache=grpcs://remote.buildbuddy.io common:remote --experimental_remote_downloader=grpcs://remote.buildbuddy.io common:remote --remote_executor=grpcs://remote.buildbuddy.io common:remote --remote_download_toplevel +common:remote --remote_download_outputs=minimal common:remote --nobuild_runfile_links common:remote --remote_timeout=3600 +common:remote --experimental_remote_cache_chunking common:remote --noexperimental_throttle_remote_action_building common:remote --remote_cache_compression # Re-runs actions instead of failing on transient lost remote/disk cache inputs. diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 13d153b3..bace1a65 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,6 @@ jobs: include: - target: cpu bazel_opts: "" - self_hosted: false run_tests: true runner_labels: - runs-on=${{ github.run_id }}-${{ github.run_attempt }}-ci-cpu @@ -29,9 +28,9 @@ jobs: - image=ubuntu24-amd64 - volume=80gb - extras=s3-cache + - target: neuron bazel_opts: "--@zml//platforms:neuron=true --@zml//platforms:cpu=false" - self_hosted: false run_tests: false runner_labels: - runs-on=${{ github.run_id }}-${{ github.run_attempt }}-ci-neuron @@ -40,9 +39,9 @@ jobs: - image=ubuntu24-amd64 - volume=80gb - extras=s3-cache + - target: tpu bazel_opts: "--@zml//platforms:tpu=true --@zml//platforms:cpu=false" - self_hosted: false run_tests: false runner_labels: - runs-on=${{ github.run_id }}-${{ github.run_attempt }}-ci-tpu @@ -51,16 +50,19 @@ jobs: - image=ubuntu24-amd64 - volume=80gb - extras=s3-cache + - target: cuda bazel_opts: "--@zml//platforms:cuda=true --@zml//platforms:cpu=false" - self_hosted: true run_tests: true runner_labels: ["self-hosted", "platform=cuda"] + - target: rocm bazel_opts: "--@zml//platforms:rocm=true --@zml//platforms:cpu=false" - self_hosted: true run_tests: true runner_labels: ["self-hosted", "platform=rocm"] + + # Todo : add missing platforms like Metal / oneAPI / Furiosa ... + runs-on: ${{ matrix.runner_labels }} steps: - uses: runs-on/action@v2.1.0 @@ -68,33 +70,24 @@ jobs: uses: actions/checkout@v6 - name: Ensure self hosted cache permissions - if: ${{ matrix.self_hosted }} run: mkdir -p /tmp/zig-cache && mkdir -p /tmp/zml && sudo chmod -R 777 /tmp/zig-cache && sudo chmod -R 777 /tmp/zml - name: Setup Bazel uses: bazel-contrib/setup-bazel@0.19.0 with: - bazelisk-version: 1.28.1 - bazelisk-cache: ${{ !matrix.self_hosted }} - repository-cache: ${{ !matrix.self_hosted }} - external-cache: ${{ !matrix.self_hosted }} + bazelisk-version: 1.29.0 + bazelisk-cache: true + cache-save: false bazelrc: | + startup --experimental_remote_repo_contents_cache common --verbose_failures common --keep_going common --test_output=streamed common --color=yes common --show_timestamps - build --experimental_disk_cache_gc_max_size=100G - build --experimental_disk_cache_gc_max_age=14d - build --experimental_disk_cache_gc_idle_delay=1m - common --experimental_action_cache_gc_max_age=14d - common --experimental_action_cache_gc_idle_delay=1m - common --repo_contents_cache_gc_max_age=14d - common --repo_contents_cache_gc_idle_delay=1m - ${{ !matrix.self_hosted && secrets.BUILDBUDDY_CI_API_KEY != '' && 'common --config=remote' || '' }} - ${{ !matrix.self_hosted && secrets.BUILDBUDDY_CI_API_KEY != '' && format('common:remote --remote_header=x-buildbuddy-api-key={0}', secrets.BUILDBUDDY_CI_API_KEY) || '' }} - ${{ !matrix.self_hosted && secrets.BUILDBUDDY_CI_API_KEY != '' && 'common:remote --remote_download_outputs=minimal' || '' }} - ${{ matrix.self_hosted && 'common --disk_cache=/home/actions/.cache/bazel-disk' || '' }} + common --config=remote + common --strategy=TestRunner=local + ${{ format('common:remote --remote_header=x-buildbuddy-api-key={0}', secrets.BUILDBUDDY_CI_API_KEY) || '' }} - run: bazel mod graph - run: bazel query --output=graph ${{ matrix.bazel_opts }} //...