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

Release multiarch #594

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 19 additions & 3 deletions docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ services:
context: .
dockerfile: docker/lab/Dockerfile
target: prod
image: "aliro_lab:${TAG}"
args:
- USE_WHEELS=0
x-bake:
platforms:
- linux/amd64
- linux/arm64/v8
image: "moorelab/aliro_lab:${TAG}"
tty: true
stdin_open: true
volumes:
Expand All @@ -28,7 +34,13 @@ services:
context: .
dockerfile: docker/machine/Dockerfile
target: prod
image: "aliro_machine:${TAG}"
args:
- USE_WHEELS=0
x-bake:
platforms:
- linux/amd64
- linux/arm64/v8
image: "moorelab/aliro_machine:${TAG}"
tty: true
stdin_open: true
volumes:
Expand All @@ -47,7 +59,11 @@ services:
build:
context: .
dockerfile: docker/dbmongo/Dockerfile
image: "aliro_dbmongo:${TAG}"
x-bake:
platforms:
- linux/amd64
- linux/arm64/v8
image: "moorelab/aliro_dbmongo:${TAG}"
tty: true
stdin_open: true
ports:
Expand Down
11 changes: 5 additions & 6 deletions release/deploy_production_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ fi
#########################

#### push to dockerhub
echo "Pushing to images to DockerHub"
docker push moorelab/aliro_lab:${TAG}
docker push moorelab/aliro_machine:${TAG}
docker push moorelab/aliro_dbmongo:${TAG}
echo "Images should already be pushed to DockerHub"
# echo "Pushing to images to DockerHub"
# docker push moorelab/aliro_lab:${TAG}
# docker push moorelab/aliro_machine:${TAG}
# docker push moorelab/aliro_dbmongo:${TAG}

# git tag
git tag -fa "v${TAG}" -m "v${TAG}"
Expand All @@ -69,5 +70,3 @@ git push --tags
# create github relase and attach zip
# TODO
#echo "Creating Github release and pushing production zip"


26 changes: 21 additions & 5 deletions release/generate_production_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,28 @@ cp release/docker-compose-hub-image.yml "${PROD_BUILD_DIR}/docker-compose.yml"

zip -r $PROD_ZIP_FILENAME $PROD_BUILD_DIR

# build multi-architecture images with buildx
echo "Installing multi-platform installation support"
docker run --privileged -rm tonistiigi/binfmt --install all

# create an aliro release builder with buildx
docker buildx create --name aliroreleasebuilder --driver docker-container --boostrap --use

##### NOTES #######
# Alternatively, I should be able to use the --builder flag, for example docker buildx bake --builder aliroreleasebuilder
# This may be a better option if it works, since this won't change the builder in the current shell.
# The default builder will remain selected, and the aliroreleasebuilder will be used only by this command.
# For completeness, the documentation mentions the BUILDX_BUILDER env variable also:
# https://docs.docker.com/build/builders/

# build production images
echo "Building docker production images"
#docker volume prune
docker-compose -f docker-compose-production.yml build -m 10g
# docker-compose -f docker-compose-production.yml build -m 10g
docker buildx bake -f docker-compose-production.yml --push

echo "Tagging production images"
docker tag aliro_lab:${TAG} moorelab/aliro_lab:${TAG}
docker tag aliro_machine:${TAG} moorelab/aliro_machine:${TAG}
docker tag aliro_dbmongo:${TAG} moorelab/aliro_dbmongo:${TAG}
# tagging production images is not necessary with docker buildx bake
# echo "Tagging production images"
# docker tag aliro_lab:${TAG} moorelab/aliro_lab:${TAG}
# docker tag aliro_machine:${TAG} moorelab/aliro_machine:${TAG}
# docker tag aliro_dbmongo:${TAG} moorelab/aliro_dbmongo:${TAG}
Loading