Skip to content

Commit

Permalink
[docker] release validator-testing image internally with new tag (apt…
Browse files Browse the repository at this point in the history
  • Loading branch information
rustielin authored Jan 10, 2023
1 parent 3ed9130 commit 34b7803
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions docker/release-images.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Features = {
Default: "default",
Indexer: "indexer",
};

const TESTING_IMAGES = ["validator-testing"];
const IMAGES_TO_RELEASE = {
validator: {
performance: [
Expand All @@ -42,6 +42,15 @@ const IMAGES_TO_RELEASE = {
Features.Indexer,
],
},
"validator-testing": {
performance: [
Features.Default,
],
release: [
Features.Default,
Features.Indexer,
],
},
forge: {
release: [
Features.Default,
Expand Down Expand Up @@ -113,12 +122,22 @@ if (process.env.CI === "true") {
crane = "crane";
}

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 DOCKERHUB = "docker.io/aptoslabs";

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

const INTERNAL_TARGET_REGISTRIES = [
GCP_ARTIFACT_REPO,
AWS_ECR,
];


// default 10 seconds
parsedArgs.WAIT_FOR_IMAGE_SECONDS = parseInt(parsedArgs.WAIT_FOR_IMAGE_SECONDS ?? 10, 10);

Expand All @@ -128,8 +147,9 @@ for (const [image, imageConfig] of Object.entries(IMAGES_TO_RELEASE)) {
const profilePrefix = profile === "release" ? "" : profile;
for (const feature of features) {
const featureSuffix = feature === Features.Default ? "" : feature;
const targetRegistries = TESTING_IMAGES.includes(image) ? INTERNAL_TARGET_REGISTRIES : TARGET_REGISTRIES;

for (const targetRegistry of TARGET_REGISTRIES) {
for (const targetRegistry of targetRegistries) {
const imageSource = `${parsedArgs.GCP_DOCKER_ARTIFACT_REPO}/${image}:${joinTagSegments(
profilePrefix,
featureSuffix,
Expand Down

0 comments on commit 34b7803

Please sign in to comment.