Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (39 sloc) 1.39 KB
# The name of the service
name ?= example-prediction-service
# The version of the service
version ?= 2019-07-01
# The name of the project on Google Cloud Platform
project ?= example-cloud-project
# The zone for operations in Compute Engine
zone ?= europe-west1-b
# The address of Container Registry
registry ?=
# The name of the Docker image
image := ${name}
# The name of the instance excluding the action
instance := ${name}-${version}
all: log
docker rmi ${image} 2> /dev/null || true
docker build --file container/Dockerfile --tag ${image} .
docker tag ${image} ${registry}/${project}/${image}:${version}
docker push ${registry}/${project}/${image}:${version}
open '${project}&advancedFilter=logName:%22${name}${name}%22'
gcloud compute instances create-with-container ${instance}-$* \
--container-image ${registry}/${project}/${image}:${version} \
--container-env NAME=${name} \
--container-env VERSION=${version} \
--container-env ACTION=$* \
--container-env ZONE=${zone} \
--container-restart-policy never \
--no-restart-on-failure \
--machine-type n1-standard-1 \
--scopes default,bigquery,compute-rw,storage-rw \
--zone ${zone}
container/ instance ${instance}-$* ${zone}
container/ success ${instance}-$*
.PHONY: all build log
You can’t perform that action at this time.