Skip to content

Commit

Permalink
add container builds to ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonny Browning committed Jul 27, 2023
1 parent e0939cf commit 168ce48
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
25 changes: 24 additions & 1 deletion cloudbuild/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,28 @@
---
steps:

- id: build-training-image
name: gcr.io/kaniko-project/executor:latest
dir: /workspace/model
args:
- --destination=${_TEST_VERTEX_LOCATION}-docker.pkg.dev/${_TEST_VERTEX_PROJECT_ID}/vertex-images/training:${COMMIT_SHA}
- --target=training
- --cache=true
waitFor: ['-']

- id: build-serving-image
name: gcr.io/kaniko-project/executor:latest
dir: /workspace/model
args:
- --destination=${_TEST_VERTEX_LOCATION}-docker.pkg.dev/${_TEST_VERTEX_PROJECT_ID}/vertex-images/serving:${COMMIT_SHA}
- --target=serving
- --cache=true
waitFor: ['-']

# Install Python deps
# Run end-to-end (E2E) pipeline tests on both pipelines
- name: python:3.9
- id: e2e-tests
name: python:3.9
entrypoint: /bin/sh
args:
- -c
Expand All @@ -32,6 +51,10 @@ steps:
- VERTEX_NETWORK=${_TEST_VERTEX_NETWORK}
- VERTEX_PIPELINE_ROOT=${_TEST_VERTEX_PIPELINE_ROOT}
- RESOURCE_SUFFIX=${COMMIT_SHA}
- CONTAINER_IMAGE_REGISTRY=${_TEST_VERTEX_LOCATION}-docker.pkg.dev/${_TEST_VERTEX_PROJECT_ID}/vertex-images
waitFor:
- build-training-image
- build-serving-image

options:
logging: CLOUD_LOGGING_ONLY
Expand Down
28 changes: 28 additions & 0 deletions cloudbuild/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@
---
steps:

- id: build-training-image
name: gcr.io/kaniko-project/executor:latest
dir: /workspace/model
args:
- --destination=${_DEV_VERTEX_LOCATION}-docker.pkg.dev/${_DEV_VERTEX_PROJECT_ID}/vertex-images/training:${TAG_NAME}
- --destination=${_TEST_VERTEX_LOCATION}-docker.pkg.dev/${_TEST_VERTEX_PROJECT_ID}/vertex-images/training:${TAG_NAME}
- --destination=${_PROD_VERTEX_LOCATION}-docker.pkg.dev/${_PROD_VERTEX_PROJECT_ID}/vertex-images/training:${TAG_NAME}
- --target=training
- --cache=true
waitFor: ['-']

- id: build-serving-image
name: gcr.io/kaniko-project/executor:latest
dir: /workspace/model
args:
- --destination=${_DEV_VERTEX_LOCATION}-docker.pkg.dev/${_DEV_VERTEX_PROJECT_ID}/vertex-images/serving:${TAG_NAME}
- --destination=${_TEST_VERTEX_LOCATION}-docker.pkg.dev/${_TEST_VERTEX_PROJECT_ID}/vertex-images/serving:${TAG_NAME}
- --destination=${_PROD_VERTEX_LOCATION}-docker.pkg.dev/${_PROD_VERTEX_PROJECT_ID}/vertex-images/serving:${TAG_NAME}
- --target=serving
- --cache=true
waitFor: ['-']

# Install poetry, install deps, compile pipelines
- name: python:3.9
entrypoint: /bin/sh
Expand All @@ -36,6 +58,12 @@ steps:
--tag=latest \
--tag=${TAG_NAME}; \
done
env:
- RESOURCE_SUFFIX=default
- CONTAINER_IMAGE_REGISTRY=${_TEST_VERTEX_LOCATION}-docker.pkg.dev/${_TEST_VERTEX_PROJECT_ID}/vertex-images
waitFor:
- build-training-image
- build-serving-image

options:
logging: CLOUD_LOGGING_ONLY
Expand Down

0 comments on commit 168ce48

Please sign in to comment.