From 7ab2a959793304f9b039878303b023ce9e9f0079 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 24 Nov 2022 14:09:16 +0100 Subject: [PATCH] More cleanup after moving testing docker images to artifact registry. (#31689) * remove DOCKERHUB_ORGANIZATION from prepare_build_interop_rc * switch rubys rake-compiler-dock to .current_version files * remove DOCKERHUB_ORGANIZATION from prepare_build_linux_rc * fix .current_version files for third_party/rake-compiler-dock * fix: avoid .current_version files named */.current_version * fix: avoid pushing in local only mode --- ...current_version => rake_arm64-darwin.current_version} | 0 ...rrent_version => rake_x64-mingw-ucrt.current_version} | 0 ....current_version => rake_x64-mingw32.current_version} | 0 .../.current_version => rake_x86-linux.current_version} | 0 ....current_version => rake_x86-mingw32.current_version} | 0 ...urrent_version => rake_x86_64-darwin.current_version} | 0 ...current_version => rake_x86_64-linux.current_version} | 0 tools/distrib/rake_compiler_docker_image.rb | 9 ++++----- tools/dockerfile/push_testing_images.sh | 4 ++-- .../internal_ci/helper_scripts/prepare_build_interop_rc | 3 --- tools/internal_ci/helper_scripts/prepare_build_linux_rc | 3 --- tools/run_tests/artifacts/build_artifact_ruby.sh | 3 --- 12 files changed, 6 insertions(+), 16 deletions(-) rename third_party/rake-compiler-dock/{rake_arm64-darwin/.current_version => rake_arm64-darwin.current_version} (100%) rename third_party/rake-compiler-dock/{rake_x64-mingw-ucrt/.current_version => rake_x64-mingw-ucrt.current_version} (100%) rename third_party/rake-compiler-dock/{rake_x64-mingw32/.current_version => rake_x64-mingw32.current_version} (100%) rename third_party/rake-compiler-dock/{rake_x86-linux/.current_version => rake_x86-linux.current_version} (100%) rename third_party/rake-compiler-dock/{rake_x86-mingw32/.current_version => rake_x86-mingw32.current_version} (100%) rename third_party/rake-compiler-dock/{rake_x86_64-darwin/.current_version => rake_x86_64-darwin.current_version} (100%) rename third_party/rake-compiler-dock/{rake_x86_64-linux/.current_version => rake_x86_64-linux.current_version} (100%) diff --git a/third_party/rake-compiler-dock/rake_arm64-darwin/.current_version b/third_party/rake-compiler-dock/rake_arm64-darwin.current_version similarity index 100% rename from third_party/rake-compiler-dock/rake_arm64-darwin/.current_version rename to third_party/rake-compiler-dock/rake_arm64-darwin.current_version diff --git a/third_party/rake-compiler-dock/rake_x64-mingw-ucrt/.current_version b/third_party/rake-compiler-dock/rake_x64-mingw-ucrt.current_version similarity index 100% rename from third_party/rake-compiler-dock/rake_x64-mingw-ucrt/.current_version rename to third_party/rake-compiler-dock/rake_x64-mingw-ucrt.current_version diff --git a/third_party/rake-compiler-dock/rake_x64-mingw32/.current_version b/third_party/rake-compiler-dock/rake_x64-mingw32.current_version similarity index 100% rename from third_party/rake-compiler-dock/rake_x64-mingw32/.current_version rename to third_party/rake-compiler-dock/rake_x64-mingw32.current_version diff --git a/third_party/rake-compiler-dock/rake_x86-linux/.current_version b/third_party/rake-compiler-dock/rake_x86-linux.current_version similarity index 100% rename from third_party/rake-compiler-dock/rake_x86-linux/.current_version rename to third_party/rake-compiler-dock/rake_x86-linux.current_version diff --git a/third_party/rake-compiler-dock/rake_x86-mingw32/.current_version b/third_party/rake-compiler-dock/rake_x86-mingw32.current_version similarity index 100% rename from third_party/rake-compiler-dock/rake_x86-mingw32/.current_version rename to third_party/rake-compiler-dock/rake_x86-mingw32.current_version diff --git a/third_party/rake-compiler-dock/rake_x86_64-darwin/.current_version b/third_party/rake-compiler-dock/rake_x86_64-darwin.current_version similarity index 100% rename from third_party/rake-compiler-dock/rake_x86_64-darwin/.current_version rename to third_party/rake-compiler-dock/rake_x86_64-darwin.current_version diff --git a/third_party/rake-compiler-dock/rake_x86_64-linux/.current_version b/third_party/rake-compiler-dock/rake_x86_64-linux.current_version similarity index 100% rename from third_party/rake-compiler-dock/rake_x86_64-linux/.current_version rename to third_party/rake-compiler-dock/rake_x86_64-linux.current_version diff --git a/tools/distrib/rake_compiler_docker_image.rb b/tools/distrib/rake_compiler_docker_image.rb index b35fc17cb7f..b50e045add0 100755 --- a/tools/distrib/rake_compiler_docker_image.rb +++ b/tools/distrib/rake_compiler_docker_image.rb @@ -20,11 +20,10 @@ end def docker_image_for_rake_compiler(platform) require 'digest' - dockerfile = File.join(grpc_root, 'third_party', 'rake-compiler-dock', 'rake_' + platform, 'Dockerfile') - dockerpath = File.dirname(dockerfile) - version = Digest::SHA1.file(dockerfile).hexdigest - image_name = 'rake_' + platform + ':' + version - ENV.fetch('DOCKERHUB_ORGANIZATION', 'grpctesting') + '/' + image_name + dockerfile_dir = File.join(grpc_root, 'third_party', 'rake-compiler-dock', 'rake_' + platform) + # the ".current_version" file contains image name, tag and sha256 digest + current_version_file = dockerfile_dir + '.current_version' + image_name = File.read(current_version_file) end def run_rake_compiler(platform, args) diff --git a/tools/dockerfile/push_testing_images.sh b/tools/dockerfile/push_testing_images.sh index 2a2bbeaeb59..2bb774bd3bf 100755 --- a/tools/dockerfile/push_testing_images.sh +++ b/tools/dockerfile/push_testing_images.sh @@ -62,7 +62,7 @@ ALL_DOCKERFILE_DIRS=( tools/dockerfile/grpc_artifact_* tools/dockerfile/interoptest/* tools/dockerfile/distribtest/* - third_party/rake-compiler-dock/*/ + third_party/rake-compiler-dock/* ) CHECK_FAILED="" @@ -167,7 +167,7 @@ do # update info on what we consider to be the current version of the docker image (which will be used to run tests) echo -n "${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}@${DOCKER_IMAGE_DIGEST_LOCAL}" >${DOCKERFILE_DIR}.current_version - if [ "${SKIP_UPLOAD}" == "" ] && [ "${LOCAL_ONLY_MODE}" != "" ] + if [ "${SKIP_UPLOAD}" == "" ] && [ "${LOCAL_ONLY_MODE}" == "" ] then docker push ${ARTIFACT_REGISTRY_PREFIX}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} fi diff --git a/tools/internal_ci/helper_scripts/prepare_build_interop_rc b/tools/internal_ci/helper_scripts/prepare_build_interop_rc index 75a95406aa0..aaba7e2da41 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_interop_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_interop_rc @@ -18,9 +18,6 @@ export LANG=en_US.UTF-8 -# Download Docker images from DockerHub -export DOCKERHUB_ORGANIZATION=grpctesting - git submodule update --init # Clone repositories for languages tested by the interop test suite diff --git a/tools/internal_ci/helper_scripts/prepare_build_linux_rc b/tools/internal_ci/helper_scripts/prepare_build_linux_rc index d544f17cb74..1825bc67312 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_linux_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_linux_rc @@ -36,9 +36,6 @@ else sudo service docker restart fi -# Download Docker images from DockerHub -export DOCKERHUB_ORGANIZATION=grpctesting - git submodule update --init python3 -m pip install six diff --git a/tools/run_tests/artifacts/build_artifact_ruby.sh b/tools/run_tests/artifacts/build_artifact_ruby.sh index 396173751c3..d98ac93255a 100755 --- a/tools/run_tests/artifacts/build_artifact_ruby.sh +++ b/tools/run_tests/artifacts/build_artifact_ruby.sh @@ -47,9 +47,6 @@ gem list || true export BUNDLE_PATH=bundle_local_gems tools/run_tests/helper_scripts/bundle_install_wrapper.sh -# set the dockerhub org under which all the gRPC's ruby-compiler-dock docker images -# are available. -export DOCKERHUB_ORGANIZATION=grpctesting bundle exec rake "gem:native[${GEM_PLATFORM}]" if [ "$SYSTEM" == "Darwin" ] ; then