Upgrade ruby rake-compiler-dock images (#29304)

* Upgrade rake-compiler-dock images
pull/29658/head
apolcyn 3 years ago committed by GitHub
parent 7798e3b741
commit 409db4dd0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      third_party/rake-compiler-dock/rake_arm64-darwin/Dockerfile
  2. 2
      third_party/rake-compiler-dock/rake_x64-mingw32/Dockerfile
  3. 2
      third_party/rake-compiler-dock/rake_x86-linux/Dockerfile
  4. 2
      third_party/rake-compiler-dock/rake_x86-mingw32/Dockerfile
  5. 2
      third_party/rake-compiler-dock/rake_x86_64-darwin/Dockerfile
  6. 2
      third_party/rake-compiler-dock/rake_x86_64-linux/Dockerfile
  7. 111
      tools/distrib/build_ruby_environment_macos.sh
  8. 3
      tools/internal_ci/macos/grpc_build_artifacts.sh
  9. 40
      tools/internal_ci/macos/grpc_distribtests_ruby.sh
  10. 1
      tools/run_tests/artifacts/artifact_targets.py

@ -1 +1 @@
FROM larskanis/rake-compiler-dock-mri-arm64-darwin:1.1.0
FROM larskanis/rake-compiler-dock-mri-arm64-darwin:1.2.1

@ -1,4 +1,4 @@
FROM larskanis/rake-compiler-dock-mri-x64-mingw32:1.1.0
FROM larskanis/rake-compiler-dock-mri-x64-mingw32:1.2.1
RUN find / -name win32.h | while read f ; do sed -i 's/gettimeofday/rb_gettimeofday/' $f ; done

@ -1,4 +1,4 @@
FROM larskanis/rake-compiler-dock-mri-x86-linux:1.1.0
FROM larskanis/rake-compiler-dock-mri-x86-linux:1.2.1
#=================
# Install ccache

@ -1,4 +1,4 @@
FROM larskanis/rake-compiler-dock-mri-x86-mingw32:1.1.0
FROM larskanis/rake-compiler-dock-mri-x86-mingw32:1.2.1
RUN find / -name win32.h | while read f ; do sed -i 's/gettimeofday/rb_gettimeofday/' $f ; done

@ -1 +1 @@
FROM larskanis/rake-compiler-dock-mri-x86_64-darwin:1.1.0
FROM larskanis/rake-compiler-dock-mri-x86_64-darwin:1.2.1

@ -1,4 +1,4 @@
FROM larskanis/rake-compiler-dock-mri-x86_64-linux:1.1.0
FROM larskanis/rake-compiler-dock-mri-x86_64-linux:1.2.1
#=================
# Install ccache

@ -1,111 +0,0 @@
#!/bin/bash
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -ex
rm -rf ~/.rake-compiler
CROSS_RUBY="$(pwd)/$(mktemp tmpfile.XXXXXXXX)"
curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v1.1.1/tasks/bin/cross-ruby.rake > "$CROSS_RUBY"
# See https://github.com/grpc/grpc/issues/12161 for verconf.h patch details
patch "$CROSS_RUBY" << EOF
--- cross-ruby.rake 2021-03-05 12:04:09.898286632 -0800
+++ patched 2021-03-05 12:05:35.594318962 -0800
@@ -111,10 +111,11 @@
"--host=#{MINGW_HOST}",
"--target=#{MINGW_TARGET}",
"--build=#{RUBY_BUILD}",
- '--enable-shared',
+ '--enable-static',
+ '--disable-shared',
'--disable-install-doc',
+ '--without-gmp',
'--with-ext=',
- 'LDFLAGS=-pipe -s',
]
# Force Winsock2 for Ruby 1.8, 1.9 defaults to it
@@ -130,6 +131,7 @@
# make
file "#{build_dir}/ruby.exe" => ["#{build_dir}/Makefile"] do |t|
chdir File.dirname(t.prerequisites.first) do
+ sh "test -s verconf.h || rm -f verconf.h" # if verconf.h has size 0, make sure it gets re-built by make
sh MAKE
end
end
EOF
MAKE="make -j8"
# Download ruby 3.0.0 and 3.1.0 sources outside of the cross-ruby.rake file, since the
# latest rake-compiler/v1.1.1 cross-ruby.rake file requires tar.bz2 source
# files.
# TODO(apolcyn): remove this hack when tar.bz2 sources are available for ruby
# 3.0.0 in https://ftp.ruby-lang.org/pub/ruby/3.0/. Also see
# https://stackoverflow.com/questions/65477613/rvm-where-is-ruby-3-0-0.
set +x # rvm commands are very verbose
source ~/.rvm/scripts/rvm
# Install ruby 3.1.0 for rake-compiler
echo "rvm use 3.1.0"
rvm use 3.1.0
set -x
RUBY_3_1_0_TAR="${HOME}/.rake-compiler/sources/ruby-3.1.0.tar.gz"
mkdir -p "$(dirname $RUBY_3_1_0_TAR)"
curl -L "https://ftp.ruby-lang.org/pub/ruby/3.1/$(basename $RUBY_3_1_0_TAR)" -o "$RUBY_3_1_0_TAR"
ccache -c
ruby --version | grep 'ruby 3.1.0'
tools/run_tests/helper_scripts/bundle_install_wrapper.sh
bundle exec rake -f "$CROSS_RUBY" cross-ruby VERSION=3.1.0 HOST=x86_64-darwin11 MAKE="$MAKE" SOURCE="$RUBY_3_1_0_TAR"
echo "installed ruby 3.1.0 build targets"
# Install ruby 3.0.0 for rake-compiler
echo "rvm use 3.0.0"
rvm use 3.0.0
set -x
RUBY_3_0_0_TAR="${HOME}/.rake-compiler/sources/ruby-3.0.0.tar.gz"
mkdir -p "$(dirname $RUBY_3_0_0_TAR)"
curl -L "https://ftp.ruby-lang.org/pub/ruby/3.0/$(basename $RUBY_3_0_0_TAR)" -o "$RUBY_3_0_0_TAR"
ccache -c
ruby --version | grep 'ruby 3.0.0'
tools/run_tests/helper_scripts/bundle_install_wrapper.sh
bundle exec rake -f "$CROSS_RUBY" cross-ruby VERSION=3.0.0 HOST=x86_64-darwin11 MAKE="$MAKE" SOURCE="$RUBY_3_0_0_TAR"
echo "installed ruby 3.0.0 build targets"
# Install ruby 2.7.0 for rake-compiler
set +x
echo "rvm use 2.7.0"
rvm use 2.7.0
set -x
ruby --version | grep 'ruby 2.7.0'
ccache -c
tools/run_tests/helper_scripts/bundle_install_wrapper.sh
bundle exec rake -f "$CROSS_RUBY" cross-ruby VERSION=2.7.0 HOST=x86_64-darwin11 MAKE="$MAKE"
echo "installed ruby 2.7.0 build targets"
# Install ruby 2.4-2.6 for rake-compiler
set +x
echo "rvm use 2.5.0"
rvm use 2.5.0
set -x
ruby --version | grep 'ruby 2.5.0'
for v in 2.6.0 2.5.0 2.4.0 ; do
ccache -c
tools/run_tests/helper_scripts/bundle_install_wrapper.sh
bundle exec rake -f "$CROSS_RUBY" cross-ruby VERSION="$v" HOST=x86_64-darwin11 MAKE="$MAKE"
echo "installed ruby $v build targets"
done
sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > "$CROSS_RUBY"
mv "$CROSS_RUBY" ~/.rake-compiler/config.yml

@ -39,9 +39,6 @@ python3.9 -m pip install -U cython setuptools==44.1.1 wheel --user
gem install rubygems-update
update_rubygems
# needed to build ruby artifacts
time bash tools/distrib/build_ruby_environment_macos.sh
tools/run_tests/task_runner.py -f artifact macos ${TASK_RUNNER_EXTRA_FILTERS} || FAILED="true"
tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh

@ -15,42 +15,4 @@
set -ex
# avoid slow finalization after the script has exited.
source $(dirname $0)/../../../tools/internal_ci/helper_scripts/move_src_tree_and_respawn_itself_rc
# change to grpc repo root
cd $(dirname $0)/../../..
export PREPARE_BUILD_INSTALL_DEPS_RUBY=true
source tools/internal_ci/helper_scripts/prepare_build_macos_rc
# TODO(jtattermusch): can some of these steps be removed?
# needed to build ruby artifacts
gem install rubygems-update
update_rubygems
time bash tools/distrib/build_ruby_environment_macos.sh
# Build all ruby macos artifacts (this step actually builds all the native and source gems)
tools/run_tests/task_runner.py -f artifact macos ruby ${TASK_RUNNER_EXTRA_FILTERS} -j 4 -x build_artifacts/sponge_log.xml || FAILED="true"
# Ruby "build_package" step is basically just a passthough for the "grpc" gems, so it's enough to just
# copy the native gems directly to the "distribtests" step and skip the "build_package" phase entirely.
# Note that by skipping the "build_package" step, we are also skipping the build of "grpc-tools" gem
# but that's fine since the distribtests only test the "grpc" native gems.
# The next step expects to find the artifacts from the previous step in the "input_artifacts" folder.
# in addition to that, preserve the contents of "artifacts" directory since we want kokoro
# to upload its contents as job output artifacts.
rm -rf input_artifacts
mkdir -p input_artifacts
cp -r artifacts/ruby_native_gem_*/* input_artifacts/ || true
# TODO(jtattermusch): Here we would normally run ruby macos distribtests, but currently no such tests are defined
# in distribtest_targets.py
tools/internal_ci/helper_scripts/store_artifacts_from_moved_src_tree.sh
if [ "$FAILED" != "" ]
then
exit 1
fi
echo "TODO(apolcyn): remove ruby macos distrib jobs, they don't test anything"

@ -492,7 +492,6 @@ def targets():
RubyArtifact('linux', 'x86-linux', presubmit=True),
RubyArtifact('linux', 'x86_64-darwin', presubmit=True),
RubyArtifact('linux', 'arm64-darwin', presubmit=True),
RubyArtifact('macos', 'darwin', presubmit=True),
PHPArtifact('linux', 'x64', presubmit=True),
PHPArtifact('macos', 'x64', presubmit=True),
])

Loading…
Cancel
Save