Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
Use buildx to build images
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Sep 23, 2023
1 parent cae0c62 commit 850770e
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 50 deletions.
40 changes: 10 additions & 30 deletions .github/workflows/deploy_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,52 +50,32 @@ jobs:
- name: Build with Maven
run: mvn clean install -DskipTests

- name: Build submarine server
- name: Build and push submarine server
run: ./dev-support/docker-images/submarine/build.sh
- name: Push submarine-server docker image
run: docker push apache/submarine:server-$SUBMARINE_VERSION

- name: Build submarine agent
- name: Build and push submarine agent
run: ./dev-support/docker-images/agent/build.sh
- name: Push submarine-agent docker image
run: docker push apache/submarine:agent-$SUBMARINE_VERSION

- name: Build submarine database
- name: Build and push submarine database
run: ./dev-support/docker-images/database/build.sh
- name: Push submarine-database docker image
run: docker push apache/submarine:database-$SUBMARINE_VERSION

- name: Build submarine jupyter
- name: Build and push submarine jupyter
run: ./dev-support/docker-images/jupyter/build.sh
- name: Push submarine-jupyter docker image
run: docker push apache/submarine:jupyter-notebook-$SUBMARINE_VERSION

- name: Build submarine jupyter gpu
- name: Build and push submarine jupyter gpu
run: ./dev-support/docker-images/jupyter-gpu/build.sh
- name: Push submarine-jupyter-gpu docker image
run: docker push apache/submarine:jupyter-notebook-gpu-$SUBMARINE_VERSION

- name: Build submarine operator
- name: Build and push submarine operator
run: ./dev-support/docker-images/operator-v3/build.sh
- name: Push submarine-operator docker image
run: docker push apache/submarine:operator-$SUBMARINE_VERSION

- name: Build submarine mlflow
- name: Build and push submarine mlflow
run: ./dev-support/docker-images/mlflow/build.sh
- name: Push submarine-mlflow docker image
run: docker push apache/submarine:mlflow-$SUBMARINE_VERSION

- name: Build submarine serve
- name: Build and push submarine serve
run: ./dev-support/docker-images/serve/build.sh
- name: Push submarine-serve docker image
run: docker push apache/submarine:serve-$SUBMARINE_VERSION

- name: Build submarine quickstart
- name: Build and push submarine quickstart
run: ./dev-support/examples/quickstart/build.sh
- name: Push submarine quickstart docker image
run: docker push apache/submarine:quickstart-$SUBMARINE_VERSION

- name: Build submarine cicd
- name: Build and push submarine cicd
run: ./dev-support/cicd/build.sh
- name: Push submarine-cicd docker image
run: docker push apache/submarine:cicd-$SUBMARINE_VERSION
2 changes: 1 addition & 1 deletion dev-support/cicd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ SUBMARINE_HOME=${CURRENT_PATH}/../../..
# build image
echo "Start building the ${IMAGE} docker image ..."
cd ${CURRENT_PATH}
docker build -t ${IMAGE} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${IMAGE} .
2 changes: 1 addition & 1 deletion dev-support/docker-images/agent/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cp ${SUBMARINE_HOME}/submarine-server/server-submitter/submarine-k8s-agent/targe
cd ${CURRENT_PATH}

echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/docker-images/database/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cp -rf "${SUBMARINE_HOME}/dev-support/database" "${CURRENT_PATH}"
# build image
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
cd ${CURRENT_PATH}
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean template file
rm -rf ${CURRENT_PATH}/database
4 changes: 2 additions & 2 deletions dev-support/docker-images/experiment-prehandler/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ trap "test -f $tmpfile && rm $tmpfile" RETURN
curl -L -o $tmpfile ${HADOOP_TAR_URL}
mv $tmpfile ${CURRENT_PATH}/tmp/hadoop-3.3.3.tar.gz

curl -L -o ${CURRENT_PATH}/tmp/hadoop-aws-3.3.3.jar https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-aws/3.3.3/hadoop-aws-3.3.3.jar
curl -L -o ${CURRENT_PATH}/tmp/hadoop-aws-3.3.3.jar https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-aws/3.3.3/hadoop-aws-3.3.3.jar
curl -L -o ${CURRENT_PATH}/tmp/aws-java-sdk-bundle-1.12.267.jar https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-bundle/1.12.267/aws-java-sdk-bundle-1.12.267.jar

echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
cd ${CURRENT_PATH}
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/docker-images/jupyter-gpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ SUBMARINE_HOME=${CURRENT_PATH}/../../..
# build image
echo "Start building the ${JUPYTER_IMAGE} docker image ..."
cd ${CURRENT_PATH}
docker build -t ${JUPYTER_IMAGE} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${JUPYTER_IMAGE} .
2 changes: 1 addition & 1 deletion dev-support/docker-images/jupyter/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ SUBMARINE_HOME=${CURRENT_PATH}/../../..
# build image
echo "Start building the ${JUPYTER_IMAGE} docker image ..."
cd ${CURRENT_PATH}
docker build -t ${JUPYTER_IMAGE} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${JUPYTER_IMAGE} .
2 changes: 1 addition & 1 deletion dev-support/docker-images/mlflow/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ export SUBMARINE_HOME=${CURRENT_PATH}/../../..
# build image
echo "Start building the ${MLFLOW_IMAGE} docker image ..."
cd ${CURRENT_PATH}
docker build -t ${MLFLOW_IMAGE} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${MLFLOW_IMAGE} .
2 changes: 1 addition & 1 deletion dev-support/docker-images/operator-v3/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cp -r ${SUBMARINE_HOME}/submarine-cloud-v3/ "${CURRENT_PATH}/tmp/submarine-cloud

cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/docker-images/operator/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cp -r ${SUBMARINE_HOME}/submarine-cloud-v2/ "${CURRENT_PATH}/tmp/submarine-cloud

cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/docker-images/serve/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export SUBMARINE_HOME=${CURRENT_PATH}/../../..
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .
2 changes: 1 addition & 1 deletion dev-support/docker-images/submarine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cp ${SUBMARINE_HOME}/bin/submarine.sh "${CURRENT_PATH}/tmp/"
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."

docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/examples/mnist-pytorch/DDP/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp -r "${SUBMARINE_HOME}/submarine-sdk" "${CURRENT_PATH}/tmp"
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp -r "${SUBMARINE_HOME}/submarine-sdk" "${CURRENT_PATH}/tmp"
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp -r "${SUBMARINE_HOME}/submarine-sdk" "${CURRENT_PATH}/tmp"
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp -r "${SUBMARINE_HOME}/submarine-sdk" "${CURRENT_PATH}/tmp"
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/examples/nn-pytorch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp -r "${SUBMARINE_HOME}/submarine-sdk" "${CURRENT_PATH}/tmp"
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/examples/quickstart/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp -r "${SUBMARINE_HOME}/submarine-sdk" "${CURRENT_PATH}/tmp"
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/examples/tracking/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp -r "${SUBMARINE_HOME}/submarine-sdk" "${CURRENT_PATH}/tmp"
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

# clean temp file
rm -rf "${CURRENT_PATH}/tmp"
2 changes: 1 addition & 1 deletion dev-support/misc/flask/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ export SUBMARINE_HOME=${CURRENT_PATH}/../../..
# build image
cd ${CURRENT_PATH}
echo "Start building the ${SUBMARINE_IMAGE_NAME} docker image ..."
docker build -t ${SUBMARINE_IMAGE_NAME} .
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${SUBMARINE_IMAGE_NAME} .

0 comments on commit 850770e

Please sign in to comment.