-
Notifications
You must be signed in to change notification settings - Fork 124
CUMULUS-4883: Add script to build Iceberg API docker image and push it to ECR as part of the build process. #4464
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
Changes from all commits
07ede44
1ee900c
ebd728a
cd565c2
974a9fe
c1bbfdf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where is this called?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Bamboo. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/bin/bash | ||
| set -ex | ||
|
|
||
| . ./bamboo/use-working-directory.sh | ||
| . ./bamboo/set-bamboo-env-variables.sh | ||
|
|
||
| if [[ "$DEPLOY_ICEBERG_API" != "true" ]]; then | ||
| echo "Skipping deploy Iceberg API Image step (DEPLOY_ICEBERG_API=$DEPLOY_ICEBERG_API)" >&2 | ||
| exit 0 | ||
| fi | ||
| echo "***Deploying Iceberg API image" | ||
|
|
||
| if ! command -v docker >/dev/null 2>&1; then | ||
| apt-get update && apt-get install -y docker.io | ||
| fi | ||
|
|
||
| set_iceberg_image_version | ||
|
|
||
| image="cumulus-iceberg-api" | ||
| registry_host="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com" | ||
| aws ecr get-login-password --region "${AWS_REGION}" | docker login --username AWS --password-stdin "${registry_host}" | ||
| # Create ECR repo if it doesn't exist | ||
| if ! aws ecr describe-repositories --repository-names "${image}" >/dev/null 2>&1; then | ||
| if aws ecr describe-repositories --repository-names "${image}" 2>&1 | grep -q RepositoryNotFoundException; then | ||
| aws ecr create-repository --repository-name "${image}" >/dev/null | ||
| else | ||
| echo "Error: unable to verify ECR repository ${image}." >&2 | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| IMAGE_NAME="${registry_host}/${image}:${ICEBERG_IMAGE_VERSION}" | ||
|
|
||
| echo "Building Iceberg API image with name=${IMAGE_NAME}" | ||
| docker build --platform linux/arm64 -f packages/api/app/Dockerfile -t "$IMAGE_NAME" . | ||
|
|
||
| echo "Publishing Docker image to ECR with name=${IMAGE_NAME}" | ||
| docker push "$IMAGE_NAME" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,3 @@ | ||
| prefix = "yliu10-ci-tf" | ||
|
|
||
| deploy_iceberg_api = true | ||
| iceberg_s3_bucket = "yliu-sandbox-test-iceberg" | ||
| iceberg_namespace = "yliu_test" |
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.
You mentioned there's another variable -
RUN_ICEBERG_INT_TEST- shouldn't we just have a single variable that if it's set will deploy the iceberg API and run the integration tests? Otherwise won't the default ofRUN_ICEBERG_INT_TEST=trueandDEPLOY_ICEBERG_API=falsecause the build to fail because the API won't be running?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.
The integration test does not depend on the integration stack (I know it sounds bad) due to access issues from build agent to Sandbox environment. The integration test is run on a locally running server on the build agent so there is no connection between the two, thus two configurations.
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.
"due to access issues from build agent to Sandbox environment." - would love to talk through why that is.