Skip to content
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

Make the image pushing script safer #146

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

CoreyEWood
Copy link
Contributor

@CoreyEWood CoreyEWood commented Nov 25, 2024

Previously, running the build-push-edge-endpoint-image.sh script without any arguments would automatically push it to ECR with the latest tag, which is too easy to accidentally do. With these changes, you must put either dev or push-latest as the argument to make sure you're purposeful with what you're doing.

I also updated the workflow to use this arg as well, so pushing a new latest image on merge should continue to work. Let me know if that part doesn't look right though.

@CoreyEWood CoreyEWood requested review from tomfaulhaber and roxanne-o and removed request for roxanne-o November 25, 2024 21:27
Copy link
Member

@honeytung honeytung left a comment

Choose a reason for hiding this comment

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

This looks good, although I think we should change this script or the inference image build script so that their commands are similar just to be consistent but that is not necessarily for now. Left a comment about support both ARM and x86 images for testing. 🙂

if [ "$1" == "dev" ]; then
echo "Received argument 'dev'. Building for current platform only. Latest tag will not be pushed."
docker build --tag ${EDGE_ENDPOINT_IMAGE} ../..
docker tag ${EDGE_ENDPOINT_IMAGE}:latest ${ECR_URL}/${EDGE_ENDPOINT_IMAGE}:${TAG}
docker push ${ECR_URL}/${EDGE_ENDPOINT_IMAGE}:${TAG}
Copy link
Member

@honeytung honeytung Nov 26, 2024

Choose a reason for hiding this comment

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

Since we are proposing using dev tag for safer testing, I think we should also make sure that we can build the image for both ARM and x86 so that people testing it out with ARM devices can also run the dev images.

We could just move this portion after the buildx command has initialized the QEMU emulator:

# Build image for amd64 and arm64
docker buildx build \
  --platform linux/arm64,linux/amd64 \
  --tag ${ECR_URL}/${EDGE_ENDPOINT_IMAGE}:${TAG} \
  ../.. --push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants