From 8b95970e18a0523a4fb684c6b45a69b051cb31e2 Mon Sep 17 00:00:00 2001 From: Brian Clark Date: Thu, 11 Jul 2024 10:23:47 -0700 Subject: [PATCH] Support remote build execution on main and read-only remote cache on PRs --- .container | 1 + .github/workflows/main.yml | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 .container diff --git a/.container b/.container new file mode 100644 index 0000000000..6c5dba6f71 --- /dev/null +++ b/.container @@ -0,0 +1 @@ +299166832260.dkr.ecr.us-east-2.amazonaws.com/nativelink-rbe:v0.3 HASH diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 770af682e0..64d4cb5bfa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,7 @@ name: CI # Controls when the workflow will run. on: + workflow_dispatch: push: branches: [ main ] pull_request: @@ -19,8 +20,10 @@ jobs: nativelink-dot-com-build-on-main-test: runs-on: ubuntu-22.04 environment: production - # Only run on main branch. - if: github.ref == 'refs/heads/main' + env: + NL_COM_API_KEY: ${{ secrets.NATIVELINK_COM_API_HEADER || '065f02f53f26a12331d5cfd00a778fb243bfb4e857b8fcd4c99273edfb15deae' }} + NL_COM_RO_FLAGS: ${{ github.ref == 'refs/heads/main' && ' ' || '--nogenerate_json_trace_profile --remote_upload_local_results=false' }} + NL_COM_RE_FLAGS: ${{ github.ref == 'refs/heads/main' && '--remote_executor=grpcs://scheduler-tracemachina-shared.build-faster.nativelink.net:443 --remote_default_exec_properties=container-image=docker://default' || ' ' }} steps: - name: Checkout uses: >- # v4.1.1 @@ -34,12 +37,15 @@ jobs: shell: bash run: | bazel test \ - --remote_cache=${{ vars.NATIVELINK_COM_REMOTE_CACHE_URL }} \ - --remote_header=${{ secrets.NATIVELINK_COM_API_HEADER }} \ - --bes_backend=${{ vars.NATIVELINK_COM_BES_URL }} \ - --bes_header=${{ secrets.NATIVELINK_COM_API_HEADER }} \ - --bes_results_url=${{ vars.NATIVELINK_COM_BES_RESULTS_URL }} \ + --remote_cache=grpcs://cas-tracemachina-shared.build-faster.nativelink.net \ + --remote_header=x-nativelink-api-key=${NL_COM_API_KEY} \ + --remote_instance_name=main \ + --bes_backend=grpcs://bes-tracemachina-shared.build-faster.nativelink.net \ + --bes_header=x-nativelink-api-key=${NL_COM_API_KEY} \ + --bes_results_url=https://app.nativelink.com/a/e3b1e0e0-4b73-45d6-85bc-5cb7b02edea5/build \ --remote_header=x-nativelink-project=nativelink-ci \ + ${NL_COM_RE_FLAGS} \ + ${NL_COM_RO_FLAGS} \ //... docker-compose-compiles-nativelink: