fix: adds config file and shell script to run storage cloudbuild tests#14022
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new CI/CD pipeline for zonal system tests, including a Cloud Build configuration and a helper shell script to run tests on a GCE VM. Feedback focuses on correcting the repository URL and directory paths to align with the current monorepo structure, as well as addressing potential issues with aggressive SSH key cleanup that could interfere with concurrent builds. Other recommendations include adding missing substitutions for better documentation, using a stable Debian image, simplifying service account scopes, and adding a shebang to the shell script.
| cd python-docs-samples | ||
| git sparse-checkout set main/storage | ||
| git fetch origin "refs/pull/${_PR_NUMBER}/head" | ||
| git checkout ${COMMIT_SHA} | ||
| cd main/storage |
There was a problem hiding this comment.
The directory paths include a main/ prefix (e.g., git sparse-checkout set main/storage, cd main/storage) which does not match the standard repository structure. In the monorepo, the storage component is located at the root level storage/.
| cd python-docs-samples | |
| git sparse-checkout set main/storage | |
| git fetch origin "refs/pull/${_PR_NUMBER}/head" | |
| git checkout ${COMMIT_SHA} | |
| cd main/storage | |
| cd google-cloud-python | |
| git sparse-checkout set storage | |
| git fetch origin "refs/pull/${_PR_NUMBER}/head" | |
| git checkout ${COMMIT_SHA} | |
| cd storage |
| sleep 15 | ||
| done | ||
| # copy the script to the VM | ||
| gcloud compute scp main/storage/cloudbuild/run_zonal_tests.sh ${_VM_NAME}:~ --zone=${_ZONE} --internal-ip --ssh-key-file=/workspace/.ssh/google_compute_engine |
There was a problem hiding this comment.
The scp path includes a main/ prefix which likely does not exist in the Cloud Build workspace. The path should be relative to the repository root.
gcloud compute scp storage/cloudbuild/run_zonal_tests.sh ${_VM_NAME}:~ --zone=${_ZONE} --internal-ip --ssh-key-file=/workspace/.ssh/google_compute_engine| - "--project=${PROJECT_ID}" | ||
| - "--zone=${_ZONE}" | ||
| - "--machine-type=e2-medium" | ||
| - "--image-family=debian-13" |
There was a problem hiding this comment.
This is not accurate. The current stable release for Debian is Trixie which is Debian 13.
There was a problem hiding this comment.
I apologize for the confusion. To clarify, Debian 12 (Bookworm) is the current stable release. Debian 13 (Trixie) is currently in the testing phase and is slated to become the next stable release. For CI/CD environments, it is standard practice to use the current stable version to ensure maximum stability and package availability.
|
Can you folks work some of your magic to help get this PR across the line. |
|
/gcbrun(4c6acdc) |
1 similar comment
|
/gcbrun(4c6acdc) |
Replace local package installation with google-cloud-storage installation.
chalmerlowe
left a comment
There was a problem hiding this comment.
Left some comments.
Addressed all of them. @chalmerlowe |
Add copyright notice and licensing information to the script.
Add license information and copyright notice to the cloudbuild.yaml file.
Description
Partially Fixes #googleapis/google-cloud-python#16487
This PR is offered as starting point to enable cloudbuild tests for the Storage Team.
This mirrors a config and script that was in use in the split repo prior to migrating
python-storageinto thegoogle-cloud-pythonmonorepo.I am not versed in all the nuances of how this needs to be configured. @chandra-siri and @chingor13 were instrumental in getting similar tests running in
google-cloud-python.I think these task apply, but as I said: not the expert.