Skip to content

Commit

Permalink
Build push (#56)
Browse files Browse the repository at this point in the history
* Add cloud-build config

* Fix images list

* Fix cloudbuild yaml build step args

* Collapse image tags

* Fix waitFor

* Hard code tag for testing purposes

* Remove hardcoded tags, and skiptests flag
  • Loading branch information
zhilingc authored and feast-ci-bot committed Jan 13, 2019
1 parent 7b9dfa0 commit 6dc20dc
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docker/core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM openjdk:8-slim
ARG RELEASE

RUN mkdir -p /usr/share/feast/ingestion

ADD core/target/feast-core-0.3.0.jar /usr/share/feast/feast-core.jar
ADD ingestion/target/feast-ingestion-0.3.0.jar /usr/share/feast/ingestion/feast-ingestion.jar
ADD core/target/feast-core-$RELEASE.jar /usr/share/feast/feast-core.jar
ADD ingestion/target/feast-ingestion-$RELEASE.jar /usr/share/feast/ingestion/feast-ingestion.jar
ADD ingestion/dependency-reduced-pom.xml /usr/share/feast/ingestion/pom.xml

ENV JOB_EXECUTABLE=/usr/share/feast/ingestion/feast-ingestion.jar
Expand Down
3 changes: 2 additions & 1 deletion docker/serving/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM openjdk:8-slim
ARG RELEASE

ADD serving/target/feast-serving-0.3.0.jar /usr/share/feast/feast-serving.jar
ADD serving/target/feast-serving-$RELEASE.jar /usr/share/feast/feast-serving.jar

ENTRYPOINT ["/usr/bin/java", \
"-XX:+UseG1GC", \
Expand Down
10 changes: 10 additions & 0 deletions testing/tf/cloud-build/cloud-build.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "google_cloudbuild_trigger" "build_trigger" {
project = "${var.gcp_project}"
trigger_template {
branch_name = "master"
tag_name = "^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
project = "${var.gcp_project}"
repo_name = "http://github.com/gojek/feast"
}
filename = "testing/tf/cloud-build/cloudbuild.yaml"
}
20 changes: 20 additions & 0 deletions testing/tf/cloud-build/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
steps:
- name: maven:3.6.0-jdk-8-slim
args: ['mvn', 'clean', 'install', '-Drevision=$TAG_NAME']
id: build-jars

- name: "gcr.io/cloud-builders/docker"
args: ['build', '-t', 'gcr.io/$PROJECT_ID/feast-core:$TAG_NAME', '-t', 'gcr.io/$PROJECT_ID/feast-core:latest', '--build-arg', 'RELEASE=$TAG_NAME', '-f', './docker/core/Dockerfile', '.']
id: docker-core
waitFor:
- build-jars

- name: "gcr.io/cloud-builders/docker"
args: ['build', '-t', 'gcr.io/$PROJECT_ID/feast-serving:$TAG_NAME', '-t', 'gcr.io/$PROJECT_ID/feast-serving:latest', '--build-arg', 'RELEASE=$TAG_NAME', '-f', './docker/serving/Dockerfile', '.']
id: docker-serving
waitFor:

- build-jars

timeout: 1200s
images: ['gcr.io/$PROJECT_ID/feast-core:latest', 'gcr.io/$PROJECT_ID/feast-core:$TAG_NAME', 'gcr.io/$PROJECT_ID/feast-serving:latest', 'gcr.io/$PROJECT_ID/feast-serving:$TAG_NAME']
3 changes: 3 additions & 0 deletions testing/tf/cloud-build/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
variable "gcp_project" {
description = "GCP Project name"
}

0 comments on commit 6dc20dc

Please sign in to comment.