-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add docker image for hermetic build scripts #2493
Conversation
This reverts commit bd81ca2.
Quality Gate passed for 'gapic-generator-java-root'Issues Measures |
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Quality Gate passed for 'gapic-generator-java-root'Issues Measures |
@suztomo do you agree with pushing the image to the cc: @mpeddada1 |
Quality Gate passed for 'java_showcase_integration_tests'Issues Measures |
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 <[email protected]>
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 <[email protected]>
Similar changes to those of #2298 by @mpeddada1
This setup uses two triggers:
library_generation
at HEAD and runslibrary_generation/integration_tests.py
with such imagemain
branch, thenlatest
, which will be constantly updated to match the latest build${COMMIT_SHA}
tasks