Skip to content

Commit

Permalink
Build http proxy image in release workflow (#386)
Browse files Browse the repository at this point in the history
* make release workflow also build http proxy for tf serving

* cp build image script to http proxy
  • Loading branch information
lluunn authored and k8s-ci-robot committed Mar 8, 2018
1 parent fbc05b4 commit 33299ff
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
22 changes: 22 additions & 0 deletions components/k8s-model-server/http-proxy/build_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
#
# A simple script to build the Docker images.
# This is intended to be invoked as a step in Argo to build the docker image.
#
# build_image.sh ${DOCKERFILE} ${IMAGE}
set -ex

DOCKERFILE=$1
CONTEXT_DIR=$(dirname "$DOCKERFILE")
IMAGE=$2

# Wait for the Docker daemon to be available.
until docker ps
do sleep 3
done

docker build --pull -t ${IMAGE} \
-f ${DOCKERFILE} ${CONTEXT_DIR}

gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}
gcloud docker -- push ${IMAGE}
15 changes: 12 additions & 3 deletions releasing/releaser/components/workflows.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
local cpuImage = params.registry + "/tf-model-server-cpu" + ":" + params.versionTag;
local gpuImage = params.registry + "/tf-model-server-gpu" + ":" + params.versionTag;

local httpImageDir = srcRootDir + "/kubeflow/kubeflow/components/k8s-model-server/http-proxy";
local httpProxyImage = params.registry + "/tf-model-server-http-proxy:" + params.versionTag;

// Build an Argo template to execute a particular command.
// step_name: Name for the template
// command: List to pass as the container command.
Expand Down Expand Up @@ -131,7 +134,7 @@
}; // buildTemplate


local buildImageTemplate(step_name, dockerfile, image) =
local buildImageTemplate(step_name, imageDir, dockerfile, image) =
buildTemplate(
step_name,
[
Expand Down Expand Up @@ -211,6 +214,11 @@
template: "build-tf-serving-gpu",
dependencies: ["checkout"],
},
{
name: "build-tf-serving-http",
template: "build-tf-serving-http",
dependencies: ["checkout"],
},
{
name: "create-pr-symlink",
template: "create-pr-symlink",
Expand Down Expand Up @@ -257,8 +265,9 @@
},
}, // checkout

buildImageTemplate("build-tf-serving-cpu", "Dockerfile.cpu", cpuImage),
buildImageTemplate("build-tf-serving-gpu", "Dockerfile.gpu", gpuImage),
buildImageTemplate("build-tf-serving-cpu", imageDir, "Dockerfile.cpu", cpuImage),
buildImageTemplate("build-tf-serving-gpu", imageDir, "Dockerfile.gpu", gpuImage),
buildImageTemplate("build-tf-serving-http", httpImageDir, "Dockerfile", httpProxyImage),

buildTemplate(
"deploy-tf-serving",
Expand Down

0 comments on commit 33299ff

Please sign in to comment.