Skip to content

Commit

Permalink
Stop pushing to the old GCP Docker repository
Browse files Browse the repository at this point in the history
Reference GCP_DOCKER_ARTIFACT_REPO as configuration variable for
better debuggability.
  • Loading branch information
sionescu committed Mar 28, 2024
1 parent 83a4430 commit 7c600ca
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/actions/run-faucet-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/actions/run-local-testnet/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ runs:
shell: bash
# Install node + npm.
- uses: actions/setup-node@v3
with:
Expand Down
1 change: 0 additions & 1 deletion .github/actions/run-ts-sdk-e2e-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cli-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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() }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/copy-images-to-dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +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 }}
GCP_DOCKER_ARTIFACT_REPO_US: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO_US }}
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
2 changes: 0 additions & 2 deletions .github/workflows/docker-build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ concurrency:
cancel-in-progress: true

env:
GCP_DOCKER_ARTIFACT_REPO: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO }}
GCP_DOCKER_ARTIFACT_REPO_US: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO_US }}
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.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker-indexer-grpc-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/faucet-tests-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
6 changes: 3 additions & 3 deletions .github/workflows/faucet-tests-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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 }}
6 changes: 3 additions & 3 deletions .github/workflows/indexer-grpc-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node-api-compatibility-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ 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 }}
name: generate-json-spec
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: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/rust-client-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/ts-sdk-e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 1 addition & 2 deletions .github/workflows/workflow-run-docker-rust-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +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 }}
GCP_DOCKER_ARTIFACT_REPO_US: ${{ secrets.GCP_DOCKER_ARTIFACT_REPO_US }}
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:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/workflow-run-forge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 0 additions & 6 deletions docker/builder/docker-bake-rust-all.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ variable "BUILT_VIA_BUILDKIT" {}

variable "GCP_DOCKER_ARTIFACT_REPO" {}

variable "GCP_DOCKER_ARTIFACT_REPO_US" {}

variable "AWS_ECR_ACCOUNT_NUM" {}

variable "TARGET_REGISTRY" {
Expand Down Expand Up @@ -231,16 +229,12 @@ function "generate_tags" {
result = TARGET_REGISTRY == "remote-all" ? [
"${GCP_DOCKER_ARTIFACT_REPO}/${target}:${IMAGE_TAG_PREFIX}${GIT_SHA}",
"${GCP_DOCKER_ARTIFACT_REPO}/${target}:${IMAGE_TAG_PREFIX}${NORMALIZED_GIT_BRANCH_OR_PR}",
"${GCP_DOCKER_ARTIFACT_REPO_US}/${target}:${IMAGE_TAG_PREFIX}${GIT_SHA}",
"${GCP_DOCKER_ARTIFACT_REPO_US}/${target}:${IMAGE_TAG_PREFIX}${NORMALIZED_GIT_BRANCH_OR_PR}",
"${ecr_base}/${target}:${IMAGE_TAG_PREFIX}${GIT_SHA}",
"${ecr_base}/${target}:${IMAGE_TAG_PREFIX}${NORMALIZED_GIT_BRANCH_OR_PR}",
] : (
TARGET_REGISTRY == "gcp" || TARGET_REGISTRY == "remote" ? [
"${GCP_DOCKER_ARTIFACT_REPO}/${target}:${IMAGE_TAG_PREFIX}${GIT_SHA}",
"${GCP_DOCKER_ARTIFACT_REPO}/${target}:${IMAGE_TAG_PREFIX}${NORMALIZED_GIT_BRANCH_OR_PR}",
"${GCP_DOCKER_ARTIFACT_REPO_US}/${target}:${IMAGE_TAG_PREFIX}${GIT_SHA}",
"${GCP_DOCKER_ARTIFACT_REPO_US}/${target}:${IMAGE_TAG_PREFIX}${NORMALIZED_GIT_BRANCH_OR_PR}",
] : [ // "local" or any other value
"aptos-core/${target}:${IMAGE_TAG_PREFIX}${GIT_SHA}-from-local",
"aptos-core/${target}:${IMAGE_TAG_PREFIX}from-local",
Expand Down
13 changes: 4 additions & 9 deletions docker/release-images.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
// 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:
// IMAGE_TAG_PREFIX=devnet AWS_ACCOUNT_ID=bla GCP_DOCKER_ARTIFACT_REPO_US=bla GCP_DOCKER_ARTIFACT_REPO=bla GIT_SHA=bla ./docker/release-images.mjs --wait-for-image-seconds=3600 --dry-run
// IMAGE_TAG_PREFIX=devnet AWS_ACCOUNT_ID=bla GCP_DOCKER_ARTIFACT_REPO=bla GIT_SHA=bla ./docker/release-images.mjs --wait-for-image-seconds=3600 --dry-run
//
// You can also run unittests by running docker/__tests__/release-images.test.js

Expand Down Expand Up @@ -179,7 +179,7 @@ function reportError(message, opts={throwOnFailure: false}) {
}

async function main() {
const REQUIRED_ARGS = ["GIT_SHA", "GCP_DOCKER_ARTIFACT_REPO", "GCP_DOCKER_ARTIFACT_REPO_US", "AWS_ACCOUNT_ID", "IMAGE_TAG_PREFIX"];
const REQUIRED_ARGS = ["GIT_SHA", "GCP_DOCKER_ARTIFACT_REPO", "AWS_ACCOUNT_ID", "IMAGE_TAG_PREFIX"];
const OPTIONAL_ARGS = ["WAIT_FOR_IMAGE_SECONDS", "DRY_RUN"];

const parsedArgs = {};
Expand All @@ -204,14 +204,9 @@ async function main() {

const AWS_ECR = `${parsedArgs.AWS_ACCOUNT_ID}.dkr.ecr.us-west-2.amazonaws.com/aptos`;
const GCP_ARTIFACT_REPO = parsedArgs.GCP_DOCKER_ARTIFACT_REPO;
const GCP_ARTIFACT_REPO_US = parsedArgs.GCP_DOCKER_ARTIFACT_REPO_US;
const DOCKERHUB = "docker.io/aptoslabs";

const INTERNAL_TARGET_REGISTRIES = [
GCP_ARTIFACT_REPO,
GCP_ARTIFACT_REPO_US,
AWS_ECR,
];
const INTERNAL_TARGET_REGISTRIES = [GCP_ARTIFACT_REPO, AWS_ECR];

const ALL_TARGET_REGISTRIES = [
...INTERNAL_TARGET_REGISTRIES,
Expand Down

0 comments on commit 7c600ca

Please sign in to comment.