Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions buildkite/scripts/release/manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ function promote_and_verify_docker() {
-v $__artifact_full_source_version \
-t $__artifact_full_target_version \
-a $__arch \
-r "$__repo" \
$__publish_arg

echo ""
Expand Down Expand Up @@ -1013,6 +1014,7 @@ function promote(){
local __debian_repo=$DEBIAN_REPO
local __debian_sign_key=""
local __arch="$DEFAULT_ARCHITECTURES"
local __profile=$DEFAULT_PROFILE


while [ ${#} -gt 0 ]; do
Expand Down Expand Up @@ -1085,6 +1087,10 @@ function promote(){
__arch=${2:?$error_message}
shift 2;
;;
--profile )
__profile=${2:?$error_message}
shift 2;
;;
* )
echo -e "${RED} !! Unknown option: $1${CLEAR}\n";
echo "";
Expand Down
8 changes: 6 additions & 2 deletions buildkite/scripts/run-test-executive-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ fi
cleanup

TEST_NAME="$1"
DOCKER_REPO="$2"
MINA_DOCKER_NAME="mina-daemon"
MINA_ARCHIVE_DOCKER_NAME="mina-archive"

MINA_IMAGE="gcr.io/o1labs-192920/mina-daemon:$MINA_DOCKER_TAG-berkeley"
ARCHIVE_IMAGE="gcr.io/o1labs-192920/mina-archive:$MINA_DOCKER_TAG-berkeley"

MINA_IMAGE="$DOCKER_REPO/$MINA_DOCKER_NAME:$MINA_DOCKER_TAG-berkeley"
Copy link
Member

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.

Copy link
Member Author

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

ARCHIVE_IMAGE="$DOCKER_REPO/$MINA_ARCHIVE_DOCKER_NAME:$MINA_DOCKER_TAG-berkeley"

if [[ "${TEST_NAME:0:15}" == "block-prod-prio" ]] && [[ "$RUN_OPT_TESTS" == "" ]]; then
echo "Skipping $TEST_NAME"
Expand Down
7 changes: 7 additions & 0 deletions buildkite/src/Command/DockerImage.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ let DockerLogin = ../Command/DockerLogin/Type.dhall

let DebianRepo = ../Constants/DebianRepo.dhall

let DockerRepo = ../Constants/DockerRepo.dhall

let DebianVersions = ../Constants/DebianVersions.dhall

let Network = ../Constants/Network.dhall
Expand Down Expand Up @@ -51,6 +53,7 @@ let ReleaseSpec =
, build_flags : BuildFlags.Type
, step_key_suffix : Text
, docker_publish : DockerPublish.Type
, docker_repo : DockerRepo.Type
, verify : Bool
, if_ : Optional B/If
}
Expand All @@ -72,6 +75,7 @@ let ReleaseSpec =
, docker_publish = DockerPublish.Type.Essential
, no_cache = False
, no_debian = False
, docker_repo = DockerRepo.Type.Internal
, step_key_suffix = "-docker-image"
, verify = False
, deb_suffix = None Text
Expand Down Expand Up @@ -166,6 +170,7 @@ let generateStep =
++ debSuffix
++ " --repo ${spec.repo}"
++ " --platform ${Arch.platform spec.arch}"
++ " --docker-registry ${DockerRepo.show spec.docker_repo}"

let releaseDockerCmd =
if DockerPublish.shouldPublish
Expand All @@ -184,6 +189,8 @@ let generateStep =
++ " --deb-build-flags ${BuildFlags.lowerName
spec.build_flags}"
++ " --platform ${Arch.platform spec.arch}"
++ " --docker-registry ${DockerRepo.show
spec.docker_repo}"

else " echo In order to ensure storage optimization, skipping publishing docker as this is not essential one or publishing is disabled . Docker publish setting is set to ${DockerPublish.show
spec.docker_publish}."
Expand Down
6 changes: 6 additions & 0 deletions buildkite/src/Command/Packages/Publish.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ let DebianVersions = ../../Constants/DebianVersions.dhall

let DebianRepo = ../../Constants/DebianRepo.dhall

let DockerRepo = ../../Constants/DockerRepo.dhall

let ContainerImages = ../../Constants/ContainerImages.dhall

let Command = ../Base.dhall
Expand Down Expand Up @@ -72,6 +74,7 @@ let Spec =
, depends_on : List Command.TaggedKey.Type
, branch : Text
, architectures : List Architecture.Type
, docker_repo : DockerRepo.Type
, if_ : Optional Text
}
, default =
Expand All @@ -89,6 +92,7 @@ let Spec =
, verify = True
, branch = ""
, architectures = [ Architecture.Type.Amd64, Architecture.Type.Arm64 ]
, docker_repo = DockerRepo.Type.Internal
, if_ = None Text
}
}
Expand Down Expand Up @@ -251,6 +255,8 @@ let publish
++ "--target-version ${r.value} "
++ "--codenames ${codenames} "
++ "--only-dockers "
++ "--docker-repo ${DockerRepo.show
spec.docker_repo} "
++ "--force-upload-debians "
)
]
Expand Down
7 changes: 6 additions & 1 deletion buildkite/src/Command/Rosetta/Connectivity.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ let Dockers = ../../Constants/DockerVersions.dhall

let Profiles = ../../Constants/Profiles.dhall

let DockerRepo = ../../Constants/DockerRepo.dhall

let B/SoftFail = B.definitions/commandStep/properties/soft_fail/Type

let B/If = B.definitions/commandStep/properties/if/Type
Expand All @@ -37,6 +39,7 @@ let Spec =
, timeout : Natural
, profile : Profiles.Type
, scope : List PipelineScope.Type
, repo : DockerRepo.Type
, if_ : B/If
}
, default =
Expand All @@ -47,6 +50,7 @@ let Spec =
, timeout = 1000
, profile = Profiles.Type.Devnet
, scope = PipelineScope.Full
, repo = DockerRepo.Type.Internal
, if_ =
"build.pull_request.base_branch != \"develop\" && build.branch != \"develop\""
}
Expand All @@ -64,7 +68,8 @@ let command
, "source ./buildkite/scripts/export-git-env-vars.sh"
, "scripts/tests/rosetta-connectivity.sh --network ${Network.lowerName
spec.network} --tag \\\${MINA_DOCKER_TAG} --timeout ${Natural/show
spec.timeout} --run-compatibility-test develop --run-load-test "
spec.timeout} --repo ${DockerRepo.show
spec.repo} --run-compatibility-test develop --run-load-test "
]
]
, label =
Expand Down
5 changes: 4 additions & 1 deletion buildkite/src/Command/TestExecutive.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ let Size = ./Size.dhall

let Cmd = ../Lib/Cmds.dhall

let DockerRepo = ../Constants/DockerRepo.dhall

let SelectFiles = ../Lib/SelectFiles.dhall

in { executeLocal =
Expand All @@ -13,7 +15,8 @@ in { executeLocal =
Command.Config::{
, commands =
[ Cmd.run
"MINA_DEB_CODENAME=bullseye ; source ./buildkite/scripts/export-git-env-vars.sh && ./buildkite/scripts/run-test-executive-local.sh ${testName}"
"MINA_DEB_CODENAME=bullseye ; source ./buildkite/scripts/export-git-env-vars.sh && ./buildkite/scripts/run-test-executive-local.sh ${testName} ${DockerRepo.show
DockerRepo.Type.Internal}"
]
, artifact_paths =
[ SelectFiles.exactly "." "${testName}.local.test.log" ]
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile-mina-daemon-hardfork
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG deb_version=latest
ARG deb_codename=bullseye
ARG network=mainnet
ARG docker_repo="gcr.io/o1labs-192920"
ARG docker_repo
ARG deb_release=unstable
ARG deb_legacy_version
ARG deb_repo="http://packages.o1test.net"
Expand Down
1 change: 1 addition & 0 deletions scripts/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ while [[ "$#" -gt 0 ]]; do case $1 in
-c|--cache-from) INPUT_CACHE="$2"; shift;;
-r|--repo) MINA_REPO="$2"; shift;;
-p|--platform) INPUT_PLATFORM="$2"; shift;;
--docker-registry) export DOCKER_REGISTRY="$2"; shift;;
--no-cache) NO_CACHE="--no-cache"; ;;
--deb-codename) INPUT_CODENAME="$2"; shift;;
--deb-release) INPUT_RELEASE="$2"; shift;;
Expand Down
11 changes: 9 additions & 2 deletions scripts/docker/helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,18 @@ function get_platform_suffix() {
esac
}

function check_docker_registry() {
if [[ -z "${DOCKER_REGISTRY:-}" ]]; then
echo "ERROR: DOCKER_REGISTRY environment variable is not set" >&2
exit 1
fi
}

function export_docker_tag() {
export_suffixes

export DOCKER_REGISTRY="gcr.io/o1labs-192920"

check_docker_registry
export DOCKER_REGISTRY="${DOCKER_REGISTRY}"

PLATFORM_SUFFIX="$(get_platform_suffix)"
export TAG="${DOCKER_REGISTRY}/${SERVICE}:${VERSION}${BUILD_FLAG_SUFFIX}${PLATFORM_SUFFIX}"
Expand Down
18 changes: 9 additions & 9 deletions scripts/docker/promote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;;
-p|--publish_registry) TARGET_REPO="$2"; shift;;
-q|--quiet) QUIET="-q"; ;;
-a|--arch) ARCH="$2"; shift;;
*) echo "Unknown parameter passed: $1"; exit 1;;
Expand All @@ -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
Expand All @@ -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')
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what use case, would TARGET_REPO & REGISTRY be different, may I ask?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

righty, my mistake when splitting PR, good catch

fi

TARGET_TAG="${TARGET_REPO}/${NAME}:${TAG}${DOCKER_ARCH_SUFFIX}"
Expand Down
1 change: 1 addition & 0 deletions scripts/docker/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ while [[ "$#" -gt 0 ]]; do case $1 in
--deb-profile) export DEB_PROFILE="$2"; shift;;
--deb-build-flags) export DEB_BUILD_FLAGS="$2"; shift;;
--platform) export INPUT_PLATFORM="$2"; shift;;
--docker-registry) export DOCKER_REGISTRY="$2"; shift;;
--help) usage "$@"; exit 0;;
*) echo "Unknown parameter passed: $1"; usage "$@"; exit 1;;
esac; shift; done
Expand Down
17 changes: 16 additions & 1 deletion scripts/docker/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -eo pipefail

REPO=gcr.io/o1labs-192920
REPO=""
VERSION=3.0.0-f872d85
ARCH=amd64

Expand All @@ -21,6 +21,21 @@ while [[ "$#" -gt 0 ]]; do case $1 in
*) echo "Unknown parameter passed: $1"; exit 1;;
esac; shift; done

if [[ -z "$PACKAGE" ]]; then
echo "❌ Package is not set! Use -p or --package to set it."
exit 1
fi

if [[ -z "$CODENAME" ]]; then
echo "❌ Codename is not set! Use -c or --codename to set it."
exit 1
fi

if [[ -z "$REPO" ]]; then
echo "❌ Repo is not set! Use -r or --repo to set it."
exit 1
fi

COMMANDS=(--version --help)

case $PACKAGE in
Expand Down
9 changes: 8 additions & 1 deletion scripts/tests/rosetta-connectivity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ while [[ "$#" -gt 0 ]]; do case $1 in
--run-load-test) RUN_LOAD_TEST=true ;;
--run-compatibility-test) COMPATIBILITY_BRANCH="$2"; shift;;
-t|--tag) TAG="$2"; shift;;
-r|--repo) REPO="$2"; shift;;
--timeout) TIMEOUT="$2"; shift;;
--upgrade-scripts-workdir) UPGRADE_SCRIPTS_WORKDIR="$2"; shift;;
-h|--help) usage; exit 0;;
Expand All @@ -94,11 +95,17 @@ if [[ "$NETWORK" != "devnet" && "$NETWORK" != "mainnet" && "$NETWORK" != "berkel
usage; exit 1;
fi

if [[ -z "$REPO" ]]; then
echo "❌ Docker repo is not set! Use -r or --repo to set it."
echo ""
usage; exit 1;
fi

if [[ -z "$TAG" ]]; then usage "Docker tag is not set!"; usage; exit 1; fi;

set -x

container_id=$(docker run -v .:/workdir -p 3087:3087 -d --env MINA_NETWORK=$NETWORK gcr.io/o1labs-192920/mina-rosetta:$TAG-$NETWORK )
container_id=$(docker run -v .:/workdir -p 3087:3087 -d --env MINA_NETWORK=$NETWORK $REPO/mina-rosetta:$TAG-$NETWORK )

stop_docker() {
{ docker stop "$container_id" ; docker rm "$container_id" ; } || true
Expand Down