Skip to content

Commit

Permalink
Revert "remove usage of us-west1-registry from aptos-core (#9509)"
Browse files Browse the repository at this point in the history
This reverts commit fd22b8a.
  • Loading branch information
ibalajiarun authored and sionescu committed Aug 9, 2023
1 parent fd22b8a commit 2b1427c
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/actions/docker-setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ runs:
service_account: ${{ inputs.GCP_SERVICE_ACCOUNT_EMAIL }}
export_environment_variables: ${{ inputs.EXPORT_GCP_PROJECT_VARIABLES }}

- name: Login to us-west1 Google Artifact Registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # pin@v2
with:
registry: us-west1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}

- name: Login to US multi-region Google Artifact Registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # pin@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/copy-images-to-dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
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 }}
IMAGE_TAG_PREFIX: ${{ inputs.image_tag_prefix }}
run: ./docker/release-images.mjs --wait-for-image-seconds=3600
1 change: 1 addition & 0 deletions .github/workflows/docker-build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ concurrency:

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
1 change: 1 addition & 0 deletions .github/workflows/workflow-run-docker-rust-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ env:
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 }}
TARGET_REGISTRY: ${{ inputs.TARGET_REGISTRY }}

Expand Down
6 changes: 6 additions & 0 deletions docker/builder/docker-bake-rust-all.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ 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 @@ -233,12 +235,16 @@ 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
5 changes: 3 additions & 2 deletions docker/release-images.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// - crane - https://github.com/google/go-containerregistry/tree/main/cmd/crane#installation
// - pnpm - https://pnpm.io/installation
// 2. docker login - with authorization to push to the `aptoslabs` org
// 3. gcloud auth configure-docker us-docker.pkg.dev
// 3. gcloud auth configure-docker us-west1-docker.pkg.dev
// 4. gcloud auth login --update-adc
// 5. AWS CLI credentials configured
//
Expand Down Expand Up @@ -90,7 +90,7 @@ chdir(dirname(process.argv[1]) + "/.."); // change workdir to the root of the re
execSync("pnpm install --frozen-lockfile", { stdio: "inherit" });
await import("zx/globals");

const REQUIRED_ARGS = ["GIT_SHA", "GCP_DOCKER_ARTIFACT_REPO", "AWS_ACCOUNT_ID", "IMAGE_TAG_PREFIX"];
const REQUIRED_ARGS = ["GIT_SHA", "GCP_DOCKER_ARTIFACT_REPO", "GCP_DOCKER_ARTIFACT_REPO_US", "AWS_ACCOUNT_ID", "IMAGE_TAG_PREFIX"];
const OPTIONAL_ARGS = ["WAIT_FOR_IMAGE_SECONDS"];

const parsedArgs = {};
Expand Down Expand Up @@ -135,6 +135,7 @@ if (process.env.CI === "true") {

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 = [
Expand Down
2 changes: 1 addition & 1 deletion testsuite/forge.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

MULTIREGION_KUBECONFIG_DIR = "/etc/multiregion-kubeconfig"
MULTIREGION_KUBECONFIG_PATH = f"{MULTIREGION_KUBECONFIG_DIR}/kubeconfig"
GAR_REPO_NAME = "us-docker.pkg.dev/aptos-registry/docker"
GAR_REPO_NAME = "us-west1-docker.pkg.dev/aptos-global/aptos-internal"


@dataclass
Expand Down

0 comments on commit 2b1427c

Please sign in to comment.