From 1881315391bbb8d54c8b9ace6883a2882d6b3861 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 4 Jun 2024 18:20:08 +0300 Subject: [PATCH 1/9] ci: migrate to depot runners --- .github/workflows/ci.yaml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e092cef28ab02..e56709df92d2a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -120,7 +120,7 @@ jobs: update-flake: needs: changes if: needs.changes.outputs.gomod == 'true' - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -139,7 +139,7 @@ jobs: lint: needs: changes if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -160,7 +160,7 @@ jobs: echo "LINT_CACHE_DIR=$dir" >> $GITHUB_ENV - name: golangci-lint cache - uses: buildjet/cache@v4 + uses: actions/cache@v4 with: path: | ${{ env.LINT_CACHE_DIR }} @@ -193,7 +193,7 @@ jobs: gen: timeout-minutes: 8 - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.docs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' steps: @@ -243,7 +243,7 @@ jobs: fmt: needs: changes if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} timeout-minutes: 7 steps: - name: Checkout @@ -255,7 +255,7 @@ jobs: uses: ./.github/actions/setup-node - name: Setup Go - uses: buildjet/setup-go@v5 + uses: actions/setup-go@v5 with: # This doesn't need caching. It's super fast anyways! cache: false @@ -273,7 +273,7 @@ jobs: run: ./scripts/check_unstaged.sh test-go: - runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'buildjet-4vcpu-ubuntu-2204' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'macos-latest-xlarge' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-16-cores' || matrix.os }} + runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'macos-latest-xlarge' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'windows-latest-16-cores' || matrix.os }} needs: changes if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' timeout-minutes: 20 @@ -329,7 +329,7 @@ jobs: api-key: ${{ secrets.DATADOG_API_KEY }} test-go-pg: - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} needs: - changes if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' @@ -364,7 +364,7 @@ jobs: api-key: ${{ secrets.DATADOG_API_KEY }} test-go-race: - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' timeout-minutes: 25 @@ -399,7 +399,7 @@ jobs: # These tests are skipped in the main go test jobs because they require root # and mess with networking. test-go-tailnet-integration: - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} needs: changes # Unnecessary to run on main for now if: needs.changes.outputs.tailnet-integration == 'true' || needs.changes.outputs.ci == 'true' @@ -421,7 +421,7 @@ jobs: run: make test-tailnet-integration test-js: - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' timeout-minutes: 20 @@ -438,7 +438,7 @@ jobs: working-directory: site test-e2e: - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-16vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' timeout-minutes: 20 @@ -582,7 +582,7 @@ jobs: offlinedocs: name: offlinedocs needs: changes - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} if: needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.docs == 'true' steps: @@ -684,7 +684,7 @@ jobs: # are for amd64) needs: changes if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} env: DOCKER_CLI_EXPERIMENTAL: "enabled" outputs: @@ -890,7 +890,7 @@ jobs: # runs sqlc-vet to ensure all queries are valid. This catches any mistakes # in migrations or sqlc queries that makes a query unable to be prepared. sqlc-vet: - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' steps: From 453a4fc205397aa73515d7e7ad2d408066517575 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 4 Jun 2024 18:22:05 +0300 Subject: [PATCH 2/9] fixup! --- .github/workflows/ci.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e56709df92d2a..966840cd36d49 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -120,7 +120,7 @@ jobs: update-flake: needs: changes if: needs.changes.outputs.gomod == 'true' - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -139,7 +139,7 @@ jobs: lint: needs: changes if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -193,7 +193,7 @@ jobs: gen: timeout-minutes: 8 - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.docs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' steps: @@ -243,7 +243,7 @@ jobs: fmt: needs: changes if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} timeout-minutes: 7 steps: - name: Checkout @@ -329,7 +329,7 @@ jobs: api-key: ${{ secrets.DATADOG_API_KEY }} test-go-pg: - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} needs: - changes if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' @@ -364,7 +364,7 @@ jobs: api-key: ${{ secrets.DATADOG_API_KEY }} test-go-race: - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' timeout-minutes: 25 @@ -399,7 +399,7 @@ jobs: # These tests are skipped in the main go test jobs because they require root # and mess with networking. test-go-tailnet-integration: - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} needs: changes # Unnecessary to run on main for now if: needs.changes.outputs.tailnet-integration == 'true' || needs.changes.outputs.ci == 'true' @@ -421,7 +421,7 @@ jobs: run: make test-tailnet-integration test-js: - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' timeout-minutes: 20 @@ -582,7 +582,7 @@ jobs: offlinedocs: name: offlinedocs needs: changes - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} if: needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.docs == 'true' steps: @@ -684,7 +684,7 @@ jobs: # are for amd64) needs: changes if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} env: DOCKER_CLI_EXPERIMENTAL: "enabled" outputs: @@ -890,7 +890,7 @@ jobs: # runs sqlc-vet to ensure all queries are valid. This catches any mistakes # in migrations or sqlc queries that makes a query unable to be prepared. sqlc-vet: - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8 ' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' steps: From 88ecf6582bf940cfee3ef01c40e300103acfb72a Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 4 Jun 2024 19:12:52 +0300 Subject: [PATCH 3/9] setup-go --- .github/actions/setup-go/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-go/action.yaml b/.github/actions/setup-go/action.yaml index c53ce28c3c591..142796e1f9a1c 100644 --- a/.github/actions/setup-go/action.yaml +++ b/.github/actions/setup-go/action.yaml @@ -9,7 +9,7 @@ runs: using: "composite" steps: - name: Setup Go - uses: buildjet/setup-go@v5 + uses: actions/setup-go@v5 with: go-version: ${{ inputs.version }} From 2f1093eea33db71a752103f0ae4f4a0d75721e72 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 4 Jun 2024 19:13:23 +0300 Subject: [PATCH 4/9] setup-node --- .github/actions/setup-node/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-node/action.yaml b/.github/actions/setup-node/action.yaml index c0a5477ec143b..9d439a67bb499 100644 --- a/.github/actions/setup-node/action.yaml +++ b/.github/actions/setup-node/action.yaml @@ -15,7 +15,7 @@ runs: with: version: 8 - name: Setup Node - uses: buildjet/setup-node@v4.0.1 + uses: actions/setup-node@v4.0.1 with: node-version: 18.19.0 # See https://github.com/actions/setup-node#caching-global-packages-data From bfa484a50dcb908efc2186890faeb52b64cffdd1 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sat, 22 Jun 2024 16:54:31 +0300 Subject: [PATCH 5/9] Update nightly-gauntlet.yaml --- .github/workflows/nightly-gauntlet.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly-gauntlet.yaml b/.github/workflows/nightly-gauntlet.yaml index 592abe921c013..fc0ed2b58f3c5 100644 --- a/.github/workflows/nightly-gauntlet.yaml +++ b/.github/workflows/nightly-gauntlet.yaml @@ -11,7 +11,7 @@ jobs: # While GitHub's toaster runners are likelier to flake, we want consistency # between this environment and the regular test environment for DataDog # statistics and to only show real workflow threats. - runs-on: "buildjet-8vcpu-ubuntu-2204" + runs-on: "depot-ubuntu-22.04-8" # This runner costs 0.016 USD per minute, # so 0.016 * 240 = 3.84 USD per run. timeout-minutes: 240 @@ -40,7 +40,7 @@ jobs: go-timing: # We run these tests with p=1 so we don't need a lot of compute. - runs-on: "buildjet-2vcpu-ubuntu-2204" + runs-on: "depot-ubuntu-22.04" timeout-minutes: 10 steps: - name: Checkout From e81ce2fc4ec3e9084930563c5373ee6255f26ef1 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sat, 22 Jun 2024 16:56:37 +0300 Subject: [PATCH 6/9] Update pr-deploy.yaml --- .github/workflows/pr-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index 68693fe29ce04..5fff7cafe0d25 100644 --- a/.github/workflows/pr-deploy.yaml +++ b/.github/workflows/pr-deploy.yaml @@ -189,7 +189,7 @@ jobs: needs: get_info # Run build job only if there are changes in the files that we care about or if the workflow is manually triggered with --build flag if: needs.get_info.outputs.BUILD == 'true' - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} # This concurrency only cancels build jobs if a new build is triggred. It will avoid cancelling the current deployemtn in case of docs chnages. concurrency: group: build-${{ github.workflow }}-${{ github.ref }}-${{ needs.get_info.outputs.BUILD }} From e44a0d7edff8cd3293d155ed5d53fa0a54281e40 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sat, 22 Jun 2024 16:57:56 +0300 Subject: [PATCH 7/9] Update release.yaml --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index faa6593452e25..9ab5745b96938 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,7 +39,7 @@ env: jobs: release: name: Build and publish - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} env: # Necessary for Docker manifest DOCKER_CLI_EXPERIMENTAL: "enabled" From f58bb063bd7924b3bdcc609120606f284c215e0f Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Sat, 22 Jun 2024 16:58:52 +0300 Subject: [PATCH 8/9] Update security.yaml --- .github/workflows/security.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 07581dfef4fca..eb00fb50622fc 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -23,7 +23,7 @@ concurrency: jobs: codeql: - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} steps: - name: Checkout uses: actions/checkout@v4 @@ -56,7 +56,7 @@ jobs: "${{ secrets.SLACK_SECURITY_FAILURE_WEBHOOK_URL }}" trivy: - runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} steps: - name: Checkout uses: actions/checkout@v4 From 09b7b901cdbeaebf54991cd5b52fb3915990a4e8 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 25 Jun 2024 08:52:47 +0300 Subject: [PATCH 9/9] remove outdated comment --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b0ba952b106f0..29db244311ea8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -677,8 +677,7 @@ jobs: build: # This builds and publishes ghcr.io/coder/coder-preview:main for each commit - # to main branch. We are only building this for amd64 platform. (>95% pulls - # are for amd64) + # to main branch. needs: changes if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}