Skip to content

Commit

Permalink
TF2OpenAPI Dockerfile + CloudBuild trigger (kubeflow#262)
Browse files Browse the repository at this point in the history
* Add Dockerfile and GCB for pushing to GCR

* Fix typo in cloudbuild command
  • Loading branch information
jc2729 authored and k8s-ci-robot committed Jul 20, 2019
1 parent c9de6ef commit 47c5816
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hack/generate-cloudbuild-triggers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ CONFIGS=$(find $DIR/../release | grep yaml)

# Not currently idempotent! Use with care. Will be resolve in July 2019
for CONFIG in $CONFIGS; do
gcloud alpha builds triggers create github --project kfserving --trigger_config $CONFIG
gcloud alpha builds triggers create github --project kfserving --trigger-config $CONFIG
done

31 changes: 31 additions & 0 deletions release/triggers/tf2openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
### Specify as necessary ###
description: TF2OpenAPI Autobuilder
substitutions:
_COMPONENT: "tf2openapi"
_DOCKERFILE: "./tools/tf2openapi/Dockerfile"
_CONTEXT: "."
###########################
github:
owner: kubeflow
name: kfserving
push:
tag: v0.*.*
### Specify as necessary ###
includedFiles:
- tools/tf2openapi/**
- vendor/**
- pkg/**
###########################
build:
steps:
- name: docker
args:
- "build"
- "-t"
- "gcr.io/$REPO_NAME/${_COMPONENT}:$TAG_NAME"
- "-f"
- "${_DOCKERFILE}"
- "${_CONTEXT}"
images:
- gcr.io/$REPO_NAME/${_COMPONENT}:$TAG_NAME
17 changes: 17 additions & 0 deletions tools/tf2openapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Build the manager binary
FROM golang:1.10.3 as builder

# Copy in the go src
WORKDIR /go/src/github.com/kubeflow/kfserving
COPY vendor/ vendor/
COPY tools/ tools/
COPY pkg/ pkg/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o tf2openapi ./tools/tf2openapi/cmd

# Copy tf2openapi into a thin image
FROM ubuntu:latest
WORKDIR /
COPY --from=builder /go/src/github.com/kubeflow/kfserving/tf2openapi .
ENTRYPOINT ["/tf2openapi"]

0 comments on commit 47c5816

Please sign in to comment.