From b57750077c1ec1e855fe1ce503013a4a9b889984 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Sun, 20 Sep 2026 12:17:54 +0100 Subject: [PATCH] ci: select runners by preset instead of a machine spec Each label names the shape it needs and the shape is defined once, in .github/gcrunner.yml. No preset names an image, so the default resolves the image family rather than a build name that the image workflow can prune. Depends on the presets being on main first: the orchestrator reads that file from the default branch on a public repository, so these labels resolve only after #13778 lands. --- .github/workflows/ci.yml | 120 +++++++++++++++--------------- .github/workflows/sdk-preview.yml | 2 +- .github/workflows/specs.yml | 2 +- 3 files changed, 63 insertions(+), 61 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24d81c4070..9c49bc0d23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: runs-on: >- ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - && format('gcrunner={0}-security-{1}/family=n2d/cpu=4+8/ram=16+32/disk=80gb/image=ubuntu24-full-x64', github.run_id, strategy.job-index) + && format('gcrunner={0}-security-{1}/runner=standard', github.run_id, strategy.job-index) || 'ubuntu-latest' }} permissions: contents: read @@ -104,7 +104,7 @@ jobs: runs-on: >- ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - && format('gcrunner={0}-checks-{1}/family=n2d/cpu=4/ram=16/disk=80gb/image=ubuntu24-full-x64', github.run_id, strategy.job-index) + && format('gcrunner={0}-checks-{1}/runner=standard', github.run_id, strategy.job-index) || 'ubuntu-latest' }} steps: - name: Checkout repository @@ -179,7 +179,7 @@ jobs: runs-on: >- ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - && format('gcrunner={0}-locale-{1}/family=n2d/cpu=2/ram=8/disk=80gb/image=ubuntu24-full-x64', github.run_id, strategy.job-index) + && format('gcrunner={0}-locale-{1}/runner=small', github.run_id, strategy.job-index) || 'ubuntu-latest' }} steps: - name: Check out the repo @@ -206,41 +206,38 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | - const runner4 = `runs-on=${context.runId}/runner=4cpu-linux-x64/volume=60g/spot=price-capacity-optimized/retry=when-interrupted/extras=otel+ecr-cache`; - const runner8 = `runs-on=${context.runId}/runner=8cpu-linux-x64/volume=60g/spot=price-capacity-optimized/retry=when-interrupted/extras=otel+ecr-cache`; - const services = [ - { name: 'Account', runner: runner4, functional: true, processes: null }, - { name: 'Avatars', runner: runner4, functional: true, processes: null }, - { name: 'Console', runner: runner4, functional: true, processes: null }, - { name: 'Databases', runner: runner8, functional: false, processes: 3, documentsdb: true, embedding: true }, - { name: 'TablesDB', runner: runner8, functional: false, processes: 3 }, - { name: 'Functions', runner: runner4, functional: false, processes: null }, - { name: 'FunctionsSchedule', runner: runner4, functional: true, processes: null }, - { name: 'GraphQL', runner: runner4, functional: false, processes: null }, - { name: 'Health', runner: runner4, functional: true, processes: null }, - { name: 'Advisor', runner: runner4, functional: true, processes: null }, - { name: 'Locale', runner: runner4, functional: true, processes: null }, - { name: 'Projects', runner: runner4, functional: true, processes: null, documentsdb: true }, - { name: 'Realtime', runner: runner4, functional: false, processes: null, documentsdb: true }, - { name: 'Sites', runner: runner4, functional: true, processes: null }, - { name: 'Proxy', runner: runner4, functional: true, processes: null }, - { name: 'Storage', runner: runner4, functional: true, processes: null }, - { name: 'Tokens', runner: runner4, functional: true, processes: null }, - { name: 'Teams', runner: runner4, functional: true, processes: null }, - { name: 'Usage', runner: runner4, functional: true, processes: null }, - { name: 'Users', runner: runner4, functional: true, processes: null }, - { name: 'ProjectWebhooks', runner: runner4, functional: false, processes: null }, - { name: 'Webhooks', runner: runner4, functional: true, processes: null }, - { name: 'VCSGitHub', runner: runner4, functional: true, processes: null }, - { name: 'VCSGitea', runner: runner4, functional: false, processes: null }, - { name: 'Messaging', runner: runner4, functional: true, processes: null }, - { name: 'Notifications', runner: runner4, functional: true, processes: null }, - { name: 'Migrations', runner: runner4, functional: true, processes: 1, documentsdb: true }, - { name: 'Project', runner: runner4, functional: true, processes: null }, - { name: 'Organization', runner: runner4, functional: true, processes: null }, - { name: 'Presences', runner: runner4, functional: true, processes: null }, - { name: 'Mqtt', runner: runner4, functional: false, processes: 1 }, + { name: 'Account', runner: 'e2e', functional: true, processes: null }, + { name: 'Avatars', runner: 'e2e', functional: true, processes: null }, + { name: 'Console', runner: 'e2e', functional: true, processes: null }, + { name: 'Databases', runner: 'e2e-large', functional: false, processes: 3, documentsdb: true, embedding: true }, + { name: 'TablesDB', runner: 'e2e-large', functional: false, processes: 3 }, + { name: 'Functions', runner: 'e2e', functional: false, processes: null }, + { name: 'FunctionsSchedule', runner: 'e2e', functional: true, processes: null }, + { name: 'GraphQL', runner: 'e2e', functional: false, processes: null }, + { name: 'Health', runner: 'e2e', functional: true, processes: null }, + { name: 'Advisor', runner: 'e2e', functional: true, processes: null }, + { name: 'Locale', runner: 'e2e', functional: true, processes: null }, + { name: 'Projects', runner: 'e2e', functional: true, processes: null, documentsdb: true }, + { name: 'Realtime', runner: 'e2e', functional: false, processes: null, documentsdb: true }, + { name: 'Sites', runner: 'e2e', functional: true, processes: null }, + { name: 'Proxy', runner: 'e2e', functional: true, processes: null }, + { name: 'Storage', runner: 'e2e', functional: true, processes: null }, + { name: 'Tokens', runner: 'e2e', functional: true, processes: null }, + { name: 'Teams', runner: 'e2e', functional: true, processes: null }, + { name: 'Usage', runner: 'e2e', functional: true, processes: null }, + { name: 'Users', runner: 'e2e', functional: true, processes: null }, + { name: 'ProjectWebhooks', runner: 'e2e', functional: false, processes: null }, + { name: 'Webhooks', runner: 'e2e', functional: true, processes: null }, + { name: 'VCSGitHub', runner: 'e2e', functional: true, processes: null }, + { name: 'VCSGitea', runner: 'e2e', functional: false, processes: null }, + { name: 'Messaging', runner: 'e2e', functional: true, processes: null }, + { name: 'Notifications', runner: 'e2e', functional: true, processes: null }, + { name: 'Migrations', runner: 'e2e', functional: true, processes: 1, documentsdb: true }, + { name: 'Project', runner: 'e2e', functional: true, processes: null }, + { name: 'Organization', runner: 'e2e', functional: true, processes: null }, + { name: 'Presences', runner: 'e2e', functional: true, processes: null }, + { name: 'Mqtt', runner: 'e2e', functional: false, processes: 1 }, ]; core.setOutput('services', JSON.stringify(services)); @@ -281,7 +278,7 @@ jobs: runs-on: >- ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - && format('gcrunner={0}-packages-{1}/family=n2d/cpu=2/ram=8/disk=80gb/image=ubuntu24-full-x64', github.run_id, strategy.job-index) + && format('gcrunner={0}-packages-{1}/runner=small', github.run_id, strategy.job-index) || 'ubuntu-latest' }} outputs: matrix: ${{ steps.changed.outputs.matrix }} @@ -353,7 +350,7 @@ jobs: runs-on: >- ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - && format('gcrunner={0}-package-{1}/family=n2d/cpu=2+4/ram=8+16/disk=80gb/image=ubuntu24-full-x64', github.run_id, strategy.job-index) + && format('gcrunner={0}-package-{1}/runner=small', github.run_id, strategy.job-index) || 'ubuntu-latest' }} strategy: fail-fast: false @@ -388,7 +385,7 @@ jobs: build: name: Build - runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/volume=60g/spot=price-capacity-optimized/retry=when-interrupted/extras=otel+s3-cache+ecr-cache + runs-on: gcrunner=${{ github.run_id }}/runner=build timeout-minutes: 30 steps: - name: Checkout repository @@ -403,6 +400,11 @@ jobs: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + # The runner injects GCRUNNER_REGISTRY into the shell only; action inputs + # read ${{ env.* }}, which needs it promoted to GITHUB_ENV first. + - name: Expose the runner registry to workflow expressions + run: echo "GCRUNNER_REGISTRY=${GCRUNNER_REGISTRY}" >> "${GITHUB_ENV}" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 @@ -411,9 +413,9 @@ jobs: with: context: . push: true - tags: ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} - cache-from: type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }} - cache-to: type=s3,blobs_prefix=cache/${{ github.repository }}/,manifests_prefix=cache/${{ github.repository }}/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max + tags: ${{ env.GCRUNNER_REGISTRY }}/appwrite:${{ env.IMAGE }}-${{ github.sha }} + cache-from: type=registry,ref=${{ env.GCRUNNER_REGISTRY }}/appwrite:buildcache + cache-to: type=registry,ref=${{ env.GCRUNNER_REGISTRY }}/appwrite:buildcache,mode=max target: development build-args: | DEBUG=false @@ -422,7 +424,7 @@ jobs: unit: name: Tests / Unit - runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/volume=60g/spot=price-capacity-optimized/retry=when-interrupted/extras=otel+ecr-cache + runs-on: gcrunner=${{ github.run_id }}/runner=e2e timeout-minutes: 15 needs: build permissions: @@ -444,8 +446,8 @@ jobs: - parallel: - name: Pull Docker Image run: | - docker pull ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} - docker tag ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} ${{ env.IMAGE }} + docker pull "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" + docker tag "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" "${IMAGE}" - name: Pull Docker Compose images timeout-minutes: 5 @@ -484,7 +486,7 @@ jobs: e2e_general: name: Tests / E2E / General - runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/volume=60g/spot=price-capacity-optimized/retry=when-interrupted/extras=otel+ecr-cache + runs-on: gcrunner=${{ github.run_id }}/runner=e2e timeout-minutes: 15 needs: build permissions: @@ -506,8 +508,8 @@ jobs: - parallel: - name: Pull Docker Image run: | - docker pull ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} - docker tag ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} ${{ env.IMAGE }} + docker pull "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" + docker tag "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" "${IMAGE}" - name: Pull Docker Compose images timeout-minutes: 5 @@ -553,7 +555,7 @@ jobs: e2e_service: name: Tests / E2E / ${{ matrix.database }} (${{ matrix.mode }}) / ${{ matrix.service.name }} - runs-on: ${{ matrix.service.runner }} + runs-on: gcrunner=${{ github.run_id }}/runner=${{ matrix.service.runner }} timeout-minutes: 20 needs: [build, matrix] permissions: @@ -626,8 +628,8 @@ jobs: - parallel: - name: Pull Docker Image run: | - docker pull ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} - docker tag ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} ${{ env.IMAGE }} + docker pull "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" + docker tag "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" "${IMAGE}" - name: Pull Docker Compose images timeout-minutes: 5 @@ -718,7 +720,7 @@ jobs: e2e_grouped: name: Tests / E2E / ${{ matrix.config.label }} (${{ matrix.mode }}) - runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/volume=60g/spot=price-capacity-optimized/retry=when-interrupted/extras=otel+ecr-cache + runs-on: gcrunner=${{ github.run_id }}/runner=e2e timeout-minutes: 35 needs: [build, matrix] permissions: @@ -777,8 +779,8 @@ jobs: - parallel: - name: Pull Docker Image run: | - docker pull ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} - docker tag ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} ${{ env.IMAGE }} + docker pull "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" + docker tag "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" "${IMAGE}" - name: Pull Docker Compose images timeout-minutes: 5 @@ -877,7 +879,7 @@ jobs: benchmark: name: Benchmark if: github.event_name == 'pull_request' || github.event_name == 'push' - runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/volume=60g/spot=price-capacity-optimized/retry=when-interrupted/extras=otel+ecr-cache + runs-on: gcrunner=${{ github.run_id }}/runner=e2e timeout-minutes: 20 needs: build permissions: @@ -907,9 +909,9 @@ jobs: - parallel: - name: Pull Appwrite image run: | - docker pull ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} - docker tag ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} ${{ env.IMAGE }} - docker tag ${{ env.RUNS_ON_ECR_CACHE }}:${{ env.IMAGE }}-${{ github.sha }} ${{ env.IMAGE }}:after + docker pull "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" + docker tag "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" "${IMAGE}" + docker tag "${GCRUNNER_REGISTRY_PULL}/appwrite:${IMAGE}-${GITHUB_SHA}" "${IMAGE}:after" - name: Setup k6 uses: grafana/setup-k6-action@db07bd9765aac508ef18982e52ab937fe633a065 # v1.2.1 diff --git a/.github/workflows/sdk-preview.yml b/.github/workflows/sdk-preview.yml index 6e02b4c099..2f61b69016 100644 --- a/.github/workflows/sdk-preview.yml +++ b/.github/workflows/sdk-preview.yml @@ -16,7 +16,7 @@ on: jobs: setup: name: Setup & Build SDK - runs-on: gcrunner=${{ github.run_id }}-setup-${{ strategy.job-index }}/family=n2d/cpu=4/ram=16/disk=80gb/image=ubuntu24-full-x64 + runs-on: gcrunner=${{ github.run_id }}-setup-${{ strategy.job-index }}/runner=publish steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.github/workflows/specs.yml b/.github/workflows/specs.yml index 3170a8b09d..5b3ced0dff 100644 --- a/.github/workflows/specs.yml +++ b/.github/workflows/specs.yml @@ -30,7 +30,7 @@ on: jobs: generate: name: Generate Specs - runs-on: gcrunner=${{ github.run_id }}-generate-${{ strategy.job-index }}/family=n2d/cpu=4/ram=16/disk=80gb/image=ubuntu24-full-x64 + runs-on: gcrunner=${{ github.run_id }}-generate-${{ strategy.job-index }}/runner=publish steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2