Update xDS client/server image per-branch tag after build#26955
Update xDS client/server image per-branch tag after build#26955lidizheng merged 5 commits intogrpc:masterfrom
Conversation
| branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/linux/grpc_xds_k8s$|\1|') | ||
| tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${branch_name}" | ||
| tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${branch_name}" |
There was a problem hiding this comment.
Since this var is only available in kokoro, I'd recommend checking if it present here, instead of adding kokoro-specific logic (INITIATOR) to generic-sounding tag_and_push_docker_image
| branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/linux/grpc_xds_k8s$|\1|') | |
| tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${branch_name}" | |
| tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${branch_name}" | |
| if [[ -n $KOKORO_JOB_NAME ]]; then | |
| tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${branch_name}" | |
| tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${branch_name}" | |
| fi |
There was a problem hiding this comment.
Added the variable check for cpp/python.
| local from_tag="$2" | ||
| local to_tag="$3" | ||
|
|
||
| if [[ ${INITIATOR} == "kokoro" ]]; then |
There was a problem hiding this comment.
I think we should avoid tight coupling with kokoro in this method. just tagging and pushing should be perfectly fine.
There was a problem hiding this comment.
Removed.
I worried about experimental runs might create unwanted Docker images. This condition is used to protect un-approved code being executed in our interop tests.
| gcloud -q auth configure-docker | ||
| docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" | ||
| docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" | ||
| branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/linux/grpc_xds_k8s$|\1|') |
There was a problem hiding this comment.
I think the regexp won't work with branches. The pattern of jobs from master and jobs from branches is different:
- master:
grpc/core/master/linux/grpc_xds_k8s - branches:
grpc/core/<branch_name>/branch/linux/grpc_xds_k8s
There was a problem hiding this comment.
Good catch! Changed to matching prefix only:
branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/|\1|')
There was a problem hiding this comment.
Thanks for the review.
Here are the new Kokoro runs:
- https://fusion2.corp.google.com/invocations/10209766-0a53-449e-9368-52efbb826d51/targets
- https://fusion2.corp.google.com/invocations/711750b8-cfed-44a6-b96a-c8ae516235e3/targets
| gcloud -q auth configure-docker | ||
| docker push "${CLIENT_IMAGE_NAME}:${GIT_COMMIT}" | ||
| docker push "${SERVER_IMAGE_NAME}:${GIT_COMMIT}" | ||
| branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/linux/grpc_xds_k8s$|\1|') |
There was a problem hiding this comment.
Good catch! Changed to matching prefix only:
branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/|\1|')
| branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/linux/grpc_xds_k8s$|\1|') | ||
| tag_and_push_docker_image "${CLIENT_IMAGE_NAME}" "${GIT_COMMIT}" "${branch_name}" | ||
| tag_and_push_docker_image "${SERVER_IMAGE_NAME}" "${GIT_COMMIT}" "${branch_name}" |
There was a problem hiding this comment.
Added the variable check for cpp/python.
| local from_tag="$2" | ||
| local to_tag="$3" | ||
|
|
||
| if [[ ${INITIATOR} == "kokoro" ]]; then |
There was a problem hiding this comment.
Removed.
I worried about experimental runs might create unwanted Docker images. This condition is used to protect un-approved code being executed in our interop tests.
Co-authored-by: Sergii Tkachenko <[email protected]>
* Update xDS client/server image per-branch tag after build * Address reviewers' comments * Replace the entire string instead of only prefix * Update regex * Update tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh Co-authored-by: Sergii Tkachenko <[email protected]> Co-authored-by: Sergii Tkachenko <[email protected]>
…26963) * Update xDS client/server image per-branch tag after build * Address reviewers' comments * Replace the entire string instead of only prefix * Update regex * Update tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh Co-authored-by: Sergii Tkachenko <[email protected]> Co-authored-by: Sergii Tkachenko <[email protected]> Co-authored-by: Sergii Tkachenko <[email protected]>
* Update xDS client/server image per-branch tag after build * Address reviewers' comments * Replace the entire string instead of only prefix * Update regex * Update tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh Co-authored-by: Sergii Tkachenko <[email protected]> Co-authored-by: Sergii Tkachenko <[email protected]>
* Update xDS client/server image per-branch tag after build * Address reviewers' comments * Replace the entire string instead of only prefix * Update regex * Update tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh Co-authored-by: Sergii Tkachenko <[email protected]> Co-authored-by: Sergii Tkachenko <[email protected]>
* Update xDS client/server image per-branch tag after build * Address reviewers' comments * Replace the entire string instead of only prefix * Update regex * Update tools/internal_ci/linux/grpc_xds_k8s_install_test_driver.sh Co-authored-by: Sergii Tkachenko <[email protected]> Co-authored-by: Sergii Tkachenko <[email protected]>
As title.
The trigger is the
INITIATOR==kokoroenv var. The source of branch name is theKOKORO_JOB_NAMEenv var.https://fusion2.corp.google.com/invocations/b1d02ed3-b963-4942-9dcc-ea3e8c3b4a96
https://fusion2.corp.google.com/invocations/57b877ca-85a9-4926-8cb4-98e5c55ba422