-
Notifications
You must be signed in to change notification settings - Fork 584
[Europe GCR 1/3] un-hardcode gcr.io repo from various scripts #18125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,15 +4,15 @@ set -eo pipefail | |
|
|
||
| CLEAR='\033[0m' | ||
| RED='\033[0;31m' | ||
| PUBLISH=0 | ||
| GCR_REPO=gcr.io/o1labs-192920 | ||
| REGISTRY="" | ||
| QUIET="" | ||
| ARCH=amd64 | ||
| while [[ "$#" -gt 0 ]]; do case $1 in | ||
| -n|--name) NAME="$2"; shift;; | ||
| -v|--version) VERSION="$2"; shift;; | ||
| -t|--tag) TAG="$2"; shift;; | ||
| -p|--publish) PUBLISH=1; ;; | ||
| -r|--registry) REGISTRY="$2"; shift;; | ||
glyh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| -p|--publish_registry) TARGET_REPO="$2"; shift;; | ||
| -q|--quiet) QUIET="-q"; ;; | ||
| -a|--arch) ARCH="$2"; shift;; | ||
| *) echo "Unknown parameter passed: $1"; exit 1;; | ||
|
|
@@ -26,9 +26,10 @@ function usage() { | |
| echo " -n, --name The Docker name (mina-devnet, mina-archive etc.)" | ||
| echo " -v, --version The Docker version" | ||
| echo " -t, --tag The Additional tag" | ||
| echo " -p, --publish The Publish to docker.io flag. If defined script will publish docker do docker.io. Otherwise it will still resides in gcr.io" | ||
| echo " -p, --publish The Publish to docker.io flag. If defined script will publish docker do docker.io. Otherwise it will still resides in source registry" | ||
| echo " -q, --quiet The Quiet mode. If defined script will output limited logs" | ||
| echo " -a, --arch The Architecture of docker (amd64, arm64)" | ||
| echo " -r, --registry The Docker registry (e.g. gcr.io/o1labs-192920)" | ||
| echo "" | ||
| echo "Example: $0 --name mina-archive --version 2.0.0-rc1-48efea4 --tag devnet-latest-nightly-bullseye " | ||
| exit 1 | ||
|
|
@@ -37,6 +38,7 @@ function usage() { | |
| if [[ -z "$NAME" ]]; then usage "Name is not set!"; fi; | ||
| if [[ -z "$VERSION" ]]; then usage "Version is not set!"; fi; | ||
| if [[ -z "$TAG" ]]; then usage "Tag is not set!"; fi; | ||
| if [[ -z "$REGISTRY" ]]; then usage "Registry is not set!"; fi; | ||
|
|
||
| # Sanitize the tag to ensure it is compliant with Docker tag format | ||
| TAG=$(echo "$TAG" | sed 's/[^a-zA-Z0-9_.-]/-/g') | ||
|
|
@@ -47,16 +49,14 @@ case $ARCH in | |
| *) echo "❌ Unknown architecture passed: $ARCH"; exit 1 ;; | ||
| esac | ||
|
|
||
| SOURCE_TAG="${GCR_REPO}/${NAME}:${VERSION}${DOCKER_ARCH_SUFFIX}" | ||
| SOURCE_TAG="${REGISTRY}/${NAME}:${VERSION}${DOCKER_ARCH_SUFFIX}" | ||
|
|
||
| echo "📎 Adding new tag ($TAG) for docker ${SOURCE_TAG}" | ||
| echo " 📥 pulling ${SOURCE_TAG}" | ||
| docker pull $QUIET ${SOURCE_TAG} | ||
|
|
||
| if [[ $PUBLISH == 1 ]]; then | ||
| TARGET_REPO=docker.io/minaprotocol | ||
| else | ||
| TARGET_REPO=$GCR_REPO | ||
| if [[ -z "$TARGET_REPO" ]]; then | ||
| TARGET_REPO=$REGISTRY | ||
|
||
| fi | ||
|
|
||
| TARGET_TAG="${TARGET_REPO}/${NAME}:${TAG}${DOCKER_ARCH_SUFFIX}" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for future: I remember berkeley is just devnet with a different genesis? We should probably consider removing berkeley testnet after the HF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fixing it here: #18112