Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
32 lines (27 sloc)
949 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A simple script to build the Docker images. | |
# Adapted to generate Dockerfile for Seldon | |
# https://github.com/SeldonIO/seldon-core/blob/master/docs/wrappers/python-docker.md | |
# | |
# This is intended to be invoked as a step in Argo to build the docker image. | |
# build_image.sh ${DOCKERFILE} ${IMAGE} ${TAG} | |
set -ex | |
DOCKERFILE=$1 | |
IMAGE=$2 | |
TAG=$3 | |
CONTEXT_DIR=$(dirname "$DOCKERFILE") | |
PROJECT="${GCP_PROJECT}" | |
# Wait for the Docker daemon to be available. | |
until docker ps | |
do sleep 3 | |
done | |
gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS} | |
cd $CONTEXT_DIR | |
echo "Generate Seldon Dockerfile and artifacts" | |
docker run -v ${CONTEXT_DIR}:/my_model seldonio/core-python-wrapper:0.7 /my_model mnistddpserving ${TAG} ${IMAGE} --grpc --force | |
echo "GCP Project: "$PROJECT | |
cd build | |
echo "Building image using gcloud build" | |
gcloud builds submit --tag=${IMAGE}:${TAG} --project=${PROJECT} . | |
echo "Finished building image" |