Skip to content

Commit

Permalink
feat: Login to ecr explicitly, faster bootstrap as we only do once. (#…
Browse files Browse the repository at this point in the history
…4900)

We logged into ecr before every image extraction. This actually added
quite a few seconds.
Login to ecr explicitly (for bootstrap this is now just once at
startup).

A "noop" fast bootstrap now as little as 17s.
  • Loading branch information
charlielye committed Mar 4, 2024
1 parent edfba29 commit 86d6749
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion barretenberg/cpp/scripts/ci/upload_benchmarks_to_s3.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Uploads to S3 a recent barretenberg benchmark run.
# Uploads to S3 a recent barretenberg benchmark run.
#!/usr/bin/env bash
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace
set -eu

retry ecr_login
extract_repo barretenberg-bench /usr/src extracted-repo

BUCKET_NAME="aztec-ci-artifacts"
Expand Down
1 change: 1 addition & 0 deletions barretenberg/cpp/scripts/ci/upload_doxygen_to_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace
set -eu

retry ecr_login
extract_repo barretenberg-docs /usr/src extracted-repo

BUCKET_NAME="aztec-ci-artifacts"
Expand Down
1 change: 1 addition & 0 deletions build-system/scripts/deploy_npm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ readonly STANDALONE=${3:-}
# Only publish tagged commits to npm.
[ -n "${COMMIT_TAG:-}" ] || { echo "Will only publish tagged commits to npm. Skipping." && exit 0; }

retry ecr_login
extract_repo $REPOSITORY /usr/src project

cd project/src/$(query_manifest relativeProjectDir $REPOSITORY)
Expand Down
1 change: 1 addition & 0 deletions build-system/scripts/deploy_s3
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ echo "deploy_s3: Project Dir: $PROJECT_DIR"
echo "deploy_s3: Working directory: $PWD"
echo "deploy_s3: Extract dir: $EXTRACT_DIR"

retry ecr_login
extract_repo $REPOSITORY /usr/src/$(query_manifest relativeProjectDir $REPOSITORY)/dest $EXTRACT_DIR

# So a front-end app can discover it's deploy tag at runtime, we include a file called DEPLOY_TAG in the root.
Expand Down
1 change: 0 additions & 1 deletion build-system/scripts/extract_repo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if docker image ls --format "{{.Repository}}:{{.Tag}}" | grep -q -w "$IMAGE_COMM
echo -e "Image exists locally. No need to pull."
else
echo "Pulling $IMAGE_COMMIT_URI..."
retry ecr_login
retry docker pull $IMAGE_COMMIT_URI
fi
TEMP_CONTAINER=$(docker create $IMAGE_COMMIT_URI dummy_cmd)
Expand Down
3 changes: 2 additions & 1 deletion docs/deploy_netlify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace
set -eu

retry ecr_login
extract_repo docs /usr/src extracted-repo
cd extracted-repo/src/docs
npm install netlify-cli -g
Expand All @@ -12,7 +13,7 @@ DEPLOY_OUTPUT=""
if [ "$1" = "master" ]; then
# Deploy to production if the argument is "master"
DEPLOY_OUTPUT=$(netlify deploy --site aztec-docs-dev --prod)
else
else
# TODO we should prob see if check_rebuild can be used for this
PR_URL="$2"
API_URL="${PR_URL/github.com/api.github.com/repos}"
Expand Down
1 change: 1 addition & 0 deletions yarn-project/deploy_npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if [ -z "$COMMIT_TAG" ]; then
exit 0
fi

retry ecr_login
extract_repo yarn-project-prod /usr/src project
cd project/src/yarn-project

Expand Down

0 comments on commit 86d6749

Please sign in to comment.