Skip to content

Update xDS client/server image per-branch tag after build#26955

Merged
lidizheng merged 5 commits intogrpc:masterfrom
lidizheng:xds-tag
Aug 10, 2021
Merged

Update xDS client/server image per-branch tag after build#26955
lidizheng merged 5 commits intogrpc:masterfrom
lidizheng:xds-tag

Conversation

@lidizheng
Copy link
Copy Markdown
Contributor

@lidizheng lidizheng commented Aug 10, 2021

@lidizheng lidizheng added area/test release notes: no Indicates if PR should not be in release notes labels Aug 10, 2021
@lidizheng lidizheng marked this pull request as ready for review August 10, 2021 06:26
@lidizheng lidizheng requested a review from sergiitk August 10, 2021 06:26
Comment on lines +48 to +50
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}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Suggested change
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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the variable check for cpp/python.

local from_tag="$2"
local to_tag="$3"

if [[ ${INITIATOR} == "kokoro" ]]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should avoid tight coupling with kokoro in this method. just tagging and pushing should be perfectly fine.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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|')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the regexp won't work with branches. The pattern of jobs from master and jobs from branches is different:

  1. master: grpc/core/master/linux/grpc_xds_k8s
  2. branches: grpc/core/<branch_name>/branch/linux/grpc_xds_k8s

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Changed to matching prefix only:

branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/|\1|')

Copy link
Copy Markdown
Contributor Author

@lidizheng lidizheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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|')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Changed to matching prefix only:

branch_name=$(echo "$KOKORO_JOB_NAME" | sed -E 's|^grpc/core/(.+)/|\1|')

Comment on lines +48 to +50
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}"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the variable check for cpp/python.

local from_tag="$2"
local to_tag="$3"

if [[ ${INITIATOR} == "kokoro" ]]; then
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lidizheng lidizheng enabled auto-merge (squash) August 10, 2021 20:32
@lidizheng lidizheng merged commit 42e30a2 into grpc:master Aug 10, 2021
lidizheng added a commit to lidizheng/grpc that referenced this pull request Aug 10, 2021
* 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]>
lidizheng added a commit that referenced this pull request Aug 11, 2021
…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]>
dennycd pushed a commit to dennycd/grpc that referenced this pull request Aug 11, 2021
* 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]>
Vignesh2208 pushed a commit to Vignesh2208/grpc that referenced this pull request Aug 20, 2021
* 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]>
lidizheng added a commit to lidizheng/grpc that referenced this pull request Sep 23, 2021
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/test release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants