chore: add docker image for hermetic build scripts#2493
Conversation
This reverts commit bd81ca2.
|
@JoeWang1127 We will have to wait for it to be published when the next release PR is merged, if that's ok. Otherwise I can modify the cloud build workflow to manually create one. WDYT? |
Can we trigger a cloud build whenever there's a new commit to Also, could you tag the image with |
| if [[ $(docker volume inspect repo) != '[]' ]]; then | ||
| docker volume rm repo | ||
| fi | ||
| docker volume create --name "repo" --opt "type=none" --opt "device=$(pwd)/google-cloud-java" --opt "o=bind" |
There was a problem hiding this comment.
nit: Since this requires a bit of docker-specific knowledge, perhaps we can add a quick comment explaining what we're trying to do here?
There was a problem hiding this comment.
Added a comment explaining why we create this volume
| fi | ||
| docker volume create --name "repo" --opt "type=none" --opt "device=$(pwd)/google-cloud-java" --opt "o=bind" | ||
|
|
||
| image_id="gcr.io/cloud-devrel-public-resources/java-library-generation:${SHARED_DEPENDENCIES_VERSION}" |
There was a problem hiding this comment.
How about we pass this in as an argument to the script? In case the image id changes in the future (or if we pick a different project), it can all be changes in a single location in the cloudbuild yaml file.
There was a problem hiding this comment.
Sounds good. I added IMAGE_ID as a passed env var
@JoeWang1127 I added a special trigger to build and publish a docker image based on pushes to the Both the NOTE: I manually set the trigger to this PR branch instead of |
|
|
@suztomo do you agree with pushing the image to the cc: @mpeddada1 |
|
I switched to use the docker image in googleapis/google-cloud-java#10435 |
|
Yes, cloud-devrel-public-resources is simpler. No authentication when using it. |
Similar changes to those of #2298 by @mpeddada1 This setup uses two triggers: - The first one is [library-generation-presubmit-sdk-platform-java](https://pantheon.corp.google.com/cloud-build/triggers;region=global/edit/5783744f-0820-419f-bc5e-abbbece4be0b?e=13803378&mods=monitoring_api_prod&project=cloud-devrel-kokoro-resources), which runs on each pull request. It builds a docker image with the contents of `library_generation` at HEAD and runs `library_generation/integration_tests.py` with such image - The second one is [library-generation-sdk-platform-java](https://pantheon.corp.google.com/cloud-build/triggers;region=global/edit/e3373892-82a2-4eac-a1f2-95523966df70?e=13803378&mods=monitoring_api_prod&project=cloud-devrel-kokoro-resources), which: - is triggered upon a commit pushed to the `main` branch, then - builds a docker image with two tags - `latest`, which will be constantly updated to match the latest build - a tag based on the branch `${COMMIT_SHA}` - then the image is pushed with both tags ### tasks - [x] create dockerfile - [x] create cloudbuild.yaml for testing - [x] create cloudbuild test infra - [x] create cloudbuild.yaml for releasing the image - [x] create cloudbuild release infra --------- Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com>
Similar changes to those of #2298 by @mpeddada1 This setup uses two triggers: - The first one is [library-generation-presubmit-sdk-platform-java](https://pantheon.corp.google.com/cloud-build/triggers;region=global/edit/5783744f-0820-419f-bc5e-abbbece4be0b?e=13803378&mods=monitoring_api_prod&project=cloud-devrel-kokoro-resources), which runs on each pull request. It builds a docker image with the contents of `library_generation` at HEAD and runs `library_generation/integration_tests.py` with such image - The second one is [library-generation-sdk-platform-java](https://pantheon.corp.google.com/cloud-build/triggers;region=global/edit/e3373892-82a2-4eac-a1f2-95523966df70?e=13803378&mods=monitoring_api_prod&project=cloud-devrel-kokoro-resources), which: - is triggered upon a commit pushed to the `main` branch, then - builds a docker image with two tags - `latest`, which will be constantly updated to match the latest build - a tag based on the branch `${COMMIT_SHA}` - then the image is pushed with both tags ### tasks - [x] create dockerfile - [x] create cloudbuild.yaml for testing - [x] create cloudbuild test infra - [x] create cloudbuild.yaml for releasing the image - [x] create cloudbuild release infra --------- Co-authored-by: Joe Wang <106995533+JoeWang1127@users.noreply.github.com>




Similar changes to those of #2298 by @mpeddada1
This setup uses two triggers:
library_generationat HEAD and runslibrary_generation/integration_tests.pywith such imagemainbranch, thenlatest, which will be constantly updated to match the latest build${COMMIT_SHA}tasks