-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Google Cloud Build to upload artifacts
Add an additional pipeline running on Google Cloud Build, which builds the enclave binary and pushes it to Google Cloud Storage. The intention is for this to be used to build reference binary artifacts to be deployed on Borg in Google if necessary, once we get full reproducible builds (#241). Always use Bazel cache for builds and for tests. Example run: https://pantheon.corp.google.com/cloud-build/builds/700d7aea-6799-4822-afa1-ec3758e88faf?project=oak-ci
- Loading branch information
Showing
4 changed files
with
83 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Reference: https://cloud.google.com/cloud-build/docs/build-config | ||
|
||
steps: | ||
# Pull pre-existing latest Docker image. | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: pull_image | ||
waitFor: ['-'] | ||
timeout: 10m | ||
args: ['pull', 'gcr.io/oak-ci/oak:latest'] | ||
# Build Docker image based on current Dockerfile, if necessary. | ||
- name: 'gcr.io/cloud-builders/docker' | ||
id: build_image | ||
waitFor: ['pull_image'] | ||
timeout: 10m | ||
args: ['build', '--pull', '--cache-from=gcr.io/oak-ci/oak:latest', '--tag=gcr.io/oak-ci/oak:latest', '.'] | ||
# Run build step inside the newly created Docker image. | ||
# See: https://cloud.google.com/cloud-build/docs/create-custom-build-steps | ||
- name: 'gcr.io/oak-ci/oak:latest' | ||
id: build_code | ||
waitFor: ['build_image'] | ||
timeout: 30m | ||
entrypoint: 'bash' | ||
args: ['./scripts/build_server'] | ||
# Copy compiled enclave binary to workspace so that it can be uploaded as artifact. | ||
- name: 'gcr.io/oak-ci/oak:latest' | ||
id: copy_artifacts | ||
waitFor: ['build_code'] | ||
timeout: 5m | ||
entrypoint: 'cp' | ||
args: ['./bazel-bin/oak/server/asylo/oak_enclave_unsigned.so', './oak_enclave_unsigned.so'] | ||
|
||
# Copy compiled enclave binary to Google Cloud Storage. | ||
# See: | ||
# - https://pantheon.corp.google.com/storage/browser/artifacts.oak-ci.appspot.com/test/?project=oak-ci | ||
# - https://cloud.google.com/cloud-build/docs/configuring-builds/store-images-artifacts#storing_artifacts_in | ||
# TODO: Finalize artifact location. | ||
artifacts: | ||
objects: | ||
location: gs://artifacts.oak-ci.appspot.com/test | ||
paths: | ||
- ./oak_enclave_unsigned.so | ||
|
||
timeout: 2h | ||
|
||
options: | ||
machineType: 'N1_HIGHCPU_8' | ||
requestedVerifyOption: 'VERIFIED' | ||
sourceProvenanceHash: [ 'SHA256' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters