From 7da1c0c795980b4045959ba28b0ee1252aeeb543 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Tue, 26 Mar 2024 15:00:41 -0400 Subject: [PATCH] Reference GCP_DOCKER_ARTIFACT_REPO as configuration variable --- .github/actions/run-faucet-tests/action.yaml | 4 ++-- .github/actions/run-local-testnet/action.yaml | 1 - .github/actions/run-ts-sdk-e2e-tests/action.yaml | 2 -- .github/workflows/cli-e2e-tests.yaml | 6 +++--- .github/workflows/copy-images-to-dockerhub.yaml | 2 +- .github/workflows/docker-build-test.yaml | 1 - .github/workflows/docker-indexer-grpc-test.yaml | 6 +++--- .github/workflows/faucet-tests-main.yaml | 2 +- .github/workflows/faucet-tests-prod.yaml | 6 +++--- .github/workflows/indexer-grpc-integration-tests.yaml | 6 +++--- .github/workflows/node-api-compatibility-tests.yaml | 4 ++-- .github/workflows/rust-client-tests.yaml | 8 ++++---- .github/workflows/ts-sdk-e2e-tests.yaml | 2 +- .github/workflows/workflow-run-docker-rust-build.yaml | 2 +- .github/workflows/workflow-run-forge.yaml | 1 - docker/release-images.mjs | 2 +- 16 files changed, 25 insertions(+), 30 deletions(-) diff --git a/.github/actions/run-faucet-tests/action.yaml b/.github/actions/run-faucet-tests/action.yaml index 01473222f88583..3bb4fc974899a2 100644 --- a/.github/actions/run-faucet-tests/action.yaml +++ b/.github/actions/run-faucet-tests/action.yaml @@ -9,7 +9,7 @@ inputs: description: "The docker image tag to use for the local testnet if NETWORK=custom." required: true GCP_DOCKER_ARTIFACT_REPO: - description: "The GCP Docker artifact repository." + description: "The GCP Docker artifact repository" required: true runs: @@ -24,7 +24,7 @@ runs: - name: Run Redis server uses: shogo82148/actions-setup-redis@v1 with: - redis-version: '6.x' + redis-version: "6.x" # Set up Rust for running the integration tests. - name: Set up Rust diff --git a/.github/actions/run-local-testnet/action.yaml b/.github/actions/run-local-testnet/action.yaml index 01ca71261f0de3..f4a3c41f89b4c0 100644 --- a/.github/actions/run-local-testnet/action.yaml +++ b/.github/actions/run-local-testnet/action.yaml @@ -37,7 +37,6 @@ runs: shell: bash - # Install node + npm. - uses: actions/setup-node@v3 with: diff --git a/.github/actions/run-ts-sdk-e2e-tests/action.yaml b/.github/actions/run-ts-sdk-e2e-tests/action.yaml index 0b6bbd01c5dc5f..7589cd945b183b 100644 --- a/.github/actions/run-ts-sdk-e2e-tests/action.yaml +++ b/.github/actions/run-ts-sdk-e2e-tests/action.yaml @@ -52,7 +52,6 @@ runs: - uses: ./.github/actions/run-local-testnet with: IMAGE_TAG: ${{ steps.get-docker-image-tag.outputs.IMAGE_TAG }} - GCP_DOCKER_ARTIFACT_REPO: ${{ inputs.GCP_DOCKER_ARTIFACT_REPO }} WITH_INDEXER_API: "true" # Run the non indexer TS SDK tests. @@ -68,7 +67,6 @@ runs: timeout_minutes: 25 command: cd ./ecosystem/typescript/sdk && pnpm run test:ci - # Run the indexer TS SDK tests. - uses: nick-fields/retry@7f8f3d9f0f62fe5925341be21c2e8314fd4f7c7c # pin@v2 name: ts-sdk-indexer-test diff --git a/.github/workflows/cli-e2e-tests.yaml b/.github/workflows/cli-e2e-tests.yaml index aaa8f215fafdfc..c068d31516f4d2 100644 --- a/.github/workflows/cli-e2e-tests.yaml +++ b/.github/workflows/cli-e2e-tests.yaml @@ -57,7 +57,7 @@ jobs: with: max_attempts: 5 timeout_minutes: 20 - command: cd ./crates/aptos/e2e && poetry run python main.py -d --base-network devnet --image-repo-with-project ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} --test-cli-tag ${{ inputs.GIT_SHA }} --working-directory ${{ runner.temp }}/aptos-e2e-tests-devnet + command: cd ./crates/aptos/e2e && poetry run python main.py -d --base-network devnet --image-repo-with-project ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} --test-cli-tag ${{ inputs.GIT_SHA }} --working-directory ${{ runner.temp }}/aptos-e2e-tests-devnet # Run CLI tests against local testnet built from testnet branch. - uses: nick-fields/retry@7f8f3d9f0f62fe5925341be21c2e8314fd4f7c7c # pin@v2 @@ -66,7 +66,7 @@ jobs: with: max_attempts: 5 timeout_minutes: 20 - command: cd ./crates/aptos/e2e && poetry run python main.py -d --base-network testnet --image-repo-with-project ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} --test-cli-tag ${{ inputs.GIT_SHA }} --working-directory ${{ runner.temp }}/aptos-e2e-tests-testnet + command: cd ./crates/aptos/e2e && poetry run python main.py -d --base-network testnet --image-repo-with-project ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} --test-cli-tag ${{ inputs.GIT_SHA }} --working-directory ${{ runner.temp }}/aptos-e2e-tests-testnet # Run CLI tests against local testnet built from mainnet branch. - uses: nick-fields/retry@7f8f3d9f0f62fe5925341be21c2e8314fd4f7c7c # pin@v2 @@ -75,7 +75,7 @@ jobs: with: max_attempts: 5 timeout_minutes: 20 - command: cd ./crates/aptos/e2e && poetry run python main.py -d --base-network mainnet --image-repo-with-project ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} --test-cli-tag ${{ inputs.GIT_SHA }} --working-directory ${{ runner.temp }}/aptos-e2e-tests-mainnet + command: cd ./crates/aptos/e2e && poetry run python main.py -d --base-network mainnet --image-repo-with-project ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} --test-cli-tag ${{ inputs.GIT_SHA }} --working-directory ${{ runner.temp }}/aptos-e2e-tests-mainnet - name: Print local testnet logs on failure if: ${{ !inputs.SKIP_JOB && failure() }} diff --git a/.github/workflows/copy-images-to-dockerhub.yaml b/.github/workflows/copy-images-to-dockerhub.yaml index 339038adbcda1d..2e81a1df824c6a 100644 --- a/.github/workflows/copy-images-to-dockerhub.yaml +++ b/.github/workflows/copy-images-to-dockerhub.yaml @@ -58,7 +58,7 @@ jobs: env: FORCE_COLOR: 3 # Force color output as per https://github.com/google/zx#using-github-actions GIT_SHA: ${{ inputs.GIT_SHA || github.sha }} # If GIT_SHA is not provided, use the sha of the triggering branch - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} AWS_ACCOUNT_ID: ${{ secrets.AWS_ECR_ACCOUNT_NUM }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} IMAGE_TAG_PREFIX: ${{ inputs.image_tag_prefix }} run: ./docker/release-images.mjs --wait-for-image-seconds=3600 diff --git a/.github/workflows/docker-build-test.yaml b/.github/workflows/docker-build-test.yaml index c793cf5bf3d84a..fdac42c759018c 100644 --- a/.github/workflows/docker-build-test.yaml +++ b/.github/workflows/docker-build-test.yaml @@ -52,7 +52,6 @@ concurrency: cancel-in-progress: true env: - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} AWS_ECR_ACCOUNT_NUM: ${{ secrets.ENV_ECR_AWS_ACCOUNT_NUM }} # In case of pull_request events by default github actions merges main into the PR branch and then runs the tests etc # on the prospective merge result instead of only on the tip of the PR. diff --git a/.github/workflows/docker-indexer-grpc-test.yaml b/.github/workflows/docker-indexer-grpc-test.yaml index 0d6d10443f2536..dc78a9dc7697e7 100644 --- a/.github/workflows/docker-indexer-grpc-test.yaml +++ b/.github/workflows/docker-indexer-grpc-test.yaml @@ -17,9 +17,9 @@ jobs: contents: read id-token: write env: - VALIDATOR_IMAGE_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/validator - FAUCET_IMAGE_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/faucet - INDEXER_GRPC_IMAGE_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/indexer-grpc + VALIDATOR_IMAGE_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}/validator + FAUCET_IMAGE_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}/faucet + INDEXER_GRPC_IMAGE_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}/indexer-grpc IMAGE_TAG: ${{ inputs.GIT_SHA || 'devnet' }} # hardcode to a known good build when not running on workflow_call steps: diff --git a/.github/workflows/faucet-tests-main.yaml b/.github/workflows/faucet-tests-main.yaml index de47bf6ffcb24c..82f35a0699ba22 100644 --- a/.github/workflows/faucet-tests-main.yaml +++ b/.github/workflows/faucet-tests-main.yaml @@ -71,4 +71,4 @@ jobs: with: NETWORK: custom IMAGE_TAG: ${{ env.IMAGE_TAG }} - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} diff --git a/.github/workflows/faucet-tests-prod.yaml b/.github/workflows/faucet-tests-prod.yaml index d56211b779d2dd..58b0a2dfee5ccb 100644 --- a/.github/workflows/faucet-tests-prod.yaml +++ b/.github/workflows/faucet-tests-prod.yaml @@ -17,7 +17,7 @@ on: permissions: contents: read - id-token: write # Required for GCP Workload Identity federation which we use to login into Google Artifact Registry + id-token: write # Required for GCP Workload Identity federation which we use to login into Google Artifact Registry jobs: # Note on the job-level `if` conditions: @@ -51,7 +51,7 @@ jobs: - uses: ./.github/actions/run-faucet-tests with: NETWORK: devnet - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} # These tests ensure that the faucet works with the nodes running on testnet. run-tests-testnet: @@ -74,4 +74,4 @@ jobs: - uses: ./.github/actions/run-faucet-tests with: NETWORK: testnet - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} diff --git a/.github/workflows/indexer-grpc-integration-tests.yaml b/.github/workflows/indexer-grpc-integration-tests.yaml index 2a1d32252b3200..5d739a532a24f2 100644 --- a/.github/workflows/indexer-grpc-integration-tests.yaml +++ b/.github/workflows/indexer-grpc-integration-tests.yaml @@ -33,9 +33,9 @@ jobs: runs-on: high-perf-docker env: # spin up the local testnet using the latest devnet image - VALIDATOR_IMAGE_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/validator - FAUCET_IMAGE_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/faucet - INDEXER_GRPC_IMAGE_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/indexer-grpc + VALIDATOR_IMAGE_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}/validator + FAUCET_IMAGE_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}/faucet + INDEXER_GRPC_IMAGE_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}/indexer-grpc IMAGE_TAG: devnet steps: diff --git a/.github/workflows/node-api-compatibility-tests.yaml b/.github/workflows/node-api-compatibility-tests.yaml index e15aec61b3c6d5..4be84bf6f02fd0 100644 --- a/.github/workflows/node-api-compatibility-tests.yaml +++ b/.github/workflows/node-api-compatibility-tests.yaml @@ -89,7 +89,7 @@ jobs: with: max_attempts: 3 timeout_minutes: 20 - command: docker run --rm --mount=type=bind,source=${{ runner.temp }}/specs,target=/specs ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/tools:${IMAGE_TAG} aptos-openapi-spec-generator -f yaml -o /specs/spec.yaml + command: docker run --rm --mount=type=bind,source=${{ runner.temp }}/specs,target=/specs ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}/tools:${IMAGE_TAG} aptos-openapi-spec-generator -f yaml -o /specs/spec.yaml - uses: nick-fields/retry@7f8f3d9f0f62fe5925341be21c2e8314fd4f7c7c # pin@v2 if: ${{ !inputs.SKIP_JOB }} @@ -97,7 +97,7 @@ jobs: with: max_attempts: 3 timeout_minutes: 20 - command: docker run --rm --mount=type=bind,source=${{ runner.temp }}/specs,target=/specs ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}/tools:${IMAGE_TAG} aptos-openapi-spec-generator -f json -o /specs/spec.json + command: docker run --rm --mount=type=bind,source=${{ runner.temp }}/specs,target=/specs ${{ vars.GCP_DOCKER_ARTIFACT_REPO }}/tools:${IMAGE_TAG} aptos-openapi-spec-generator -f json -o /specs/spec.json # Confirm that the specs we built here are the same as those checked in. - run: | diff --git a/.github/workflows/rust-client-tests.yaml b/.github/workflows/rust-client-tests.yaml index 6978366907b10e..90a3f07adff395 100644 --- a/.github/workflows/rust-client-tests.yaml +++ b/.github/workflows/rust-client-tests.yaml @@ -12,7 +12,7 @@ on: permissions: contents: read - id-token: write # Required for GCP Workload Identity federation which we use to login into Google Artifact Registry + id-token: write # Required for GCP Workload Identity federation which we use to login into Google Artifact Registry jobs: # Note on the job-level `if` conditions: @@ -45,7 +45,7 @@ jobs: - uses: ./.github/actions/run-rust-client-tests with: NETWORK: devnet - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} run-tests-testnet: if: contains(github.event.pull_request.labels.*.name, 'CICD:non-required-tests') @@ -64,7 +64,7 @@ jobs: - uses: ./.github/actions/run-rust-client-tests with: NETWORK: testnet - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} run-tests-mainnet: if: contains(github.event.pull_request.labels.*.name, 'CICD:non-required-tests') @@ -83,4 +83,4 @@ jobs: - uses: ./.github/actions/run-rust-client-tests with: NETWORK: mainnet - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} diff --git a/.github/workflows/ts-sdk-e2e-tests.yaml b/.github/workflows/ts-sdk-e2e-tests.yaml index 047534bbe02990..942d07e24f66db 100644 --- a/.github/workflows/ts-sdk-e2e-tests.yaml +++ b/.github/workflows/ts-sdk-e2e-tests.yaml @@ -72,6 +72,6 @@ jobs: if: needs.file_change_determinator.outputs.only_docs_changed != 'true' with: BRANCH: main - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} - run: echo "Skipping the tests on the main branch! Unrelated changes detected." if: needs.file_change_determinator.outputs.only_docs_changed == 'true' diff --git a/.github/workflows/workflow-run-docker-rust-build.yaml b/.github/workflows/workflow-run-docker-rust-build.yaml index f016b09621d7a8..eb39e8a60438bf 100644 --- a/.github/workflows/workflow-run-docker-rust-build.yaml +++ b/.github/workflows/workflow-run-docker-rust-build.yaml @@ -63,8 +63,8 @@ env: PROFILE: ${{ inputs.PROFILE }} FEATURES: ${{ inputs.FEATURES }} BUILD_ADDL_TESTING_IMAGES: ${{ inputs.BUILD_ADDL_TESTING_IMAGES }} - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} AWS_ECR_ACCOUNT_NUM: ${{ secrets.ENV_ECR_AWS_ACCOUNT_NUM }} + GCP_DOCKER_ARTIFACT_REPO: ${{ vars.GCP_DOCKER_ARTIFACT_REPO }} TARGET_REGISTRY: ${{ inputs.TARGET_REGISTRY }} permissions: diff --git a/.github/workflows/workflow-run-forge.yaml b/.github/workflows/workflow-run-forge.yaml index e5bbfc0e658ce7..26c1b76b2c3bf1 100644 --- a/.github/workflows/workflow-run-forge.yaml +++ b/.github/workflows/workflow-run-forge.yaml @@ -79,7 +79,6 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} GCP_SERVICE_ACCOUNT_EMAIL: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} - GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }} AWS_REGION: us-west-2 IMAGE_TAG: ${{ inputs.IMAGE_TAG }} FORGE_IMAGE_TAG: ${{ inputs.FORGE_IMAGE_TAG }} diff --git a/docker/release-images.mjs b/docker/release-images.mjs index 7ff33913fe86e5..ce8f743ceb0f49 100755 --- a/docker/release-images.mjs +++ b/docker/release-images.mjs @@ -25,7 +25,7 @@ // 5. AWS CLI credentials configured // // Once you have all prerequisites fulfilled, you can run this script via: -// GIT_SHA=${{ github.sha }} GCP_DOCKER_ARTIFACT_REPO="${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}" AWS_ACCOUNT_ID="${{ secrets.AWS_ECR_ACCOUNT_NUM }}" IMAGE_TAG_PREFIX="${{ inputs.image_tag_prefix }}" ./docker/release_images.sh --wait-for-image-seconds=1800 +// GIT_SHA=${{ github.sha }} GCP_DOCKER_ARTIFACT_REPO="${{ vars.GCP_DOCKER_ARTIFACT_REPO }}" AWS_ACCOUNT_ID="${{ secrets.AWS_ECR_ACCOUNT_NUM }}" IMAGE_TAG_PREFIX="${{ inputs.image_tag_prefix }}" ./docker/release_images.sh --wait-for-image-seconds=1800 // // // You can also run this script locally with the DRY_RUN flag to test it out: