Add python3.8 aarch64 wheel distribtest (#26136)

* add python3.8 aarch64 distribtest

* register qemu emulator for linux distribtests
reviewable/pr26152/r1
Jan Tattermusch 4 years ago committed by GitHub
parent 6769ce39f4
commit d61db49b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      test/distrib/python/distribtest.py
  2. 18
      tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile
  3. 37
      tools/internal_ci/helper_scripts/prepare_qemu_rc
  4. 5
      tools/internal_ci/linux/grpc_distribtests.sh
  5. 1
      tools/run_tests/artifacts/distribtest_targets.py

@ -18,4 +18,4 @@ import grpc
# which is what we are testing here.
channel = grpc.insecure_channel('localhost:1000')
del channel
print 'Success!'
print('Success!')

@ -0,0 +1,18 @@
# Copyright 2021 The 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.
# this an aarch64 image, qemu emulator will be used to run the tests
FROM arm64v8/python:3.8-buster
RUN pip install virtualenv

@ -0,0 +1,37 @@
#!/bin/bash
# Copyright 2021 The 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.
# Source this rc script to setup and configure qemu userspace emulator on kokoro worker so that we can seamlessly emulate processes running
# inside docker containers.
# show pre-existing qemu registration
cat /proc/sys/fs/binfmt_misc/qemu-aarch64
# Kokoro ubuntu1604 workers have already qemu-user and qemu-user-static packages installed, but it's and old version that:
# * prints warning about some syscalls (e.g "qemu: Unsupported syscall: 278")
# * doesn't register with binfmt_misc with the persistent ("F") flag we need (see below)
#
# To overcome the above limitations, we use the https://github.com/multiarch/qemu-user-static
# docker image to provide a new enough version of qemu-user-static and register it with
# the desired binfmt_misc flags. The most important flag we need is "F" (set by "--persistent yes"),
# which allows the qemu-aarch64-static binary to be loaded eagerly at the time of registration with binfmt_misc.
# That way, we can emulate aarch64 binaries running inside docker containers transparently, without needing the emulator
# binary to be accessible from the docker image we're emulating.
# Note that on newer distributions (such as glinux), simply "apt install qemu-user-static" is sufficient
# to install qemu-user-static with the right flags.
docker run --rm --privileged multiarch/qemu-user-static:5.2.0-2 --reset --credential yes --persistent yes
# Print current qemu reqistration to make sure everything is setup correctly.
cat /proc/sys/fs/binfmt_misc/qemu-aarch64

@ -20,6 +20,11 @@ cd $(dirname $0)/../../..
source tools/internal_ci/helper_scripts/prepare_build_linux_rc
# some distribtests use a pre-registered binfmt_misc hook
# to automatically execute foreign binaries (such as aarch64)
# under qemu emulator.
source tools/internal_ci/helper_scripts/prepare_qemu_rc
set +ex
[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
set -e # rvm commands are very verbose

@ -353,6 +353,7 @@ def targets():
PythonDistribTest('linux', 'x64', 'arch'),
PythonDistribTest('linux', 'x64', 'ubuntu1604'),
PythonDistribTest('linux', 'x64', 'ubuntu1804'),
PythonDistribTest('linux', 'aarch64', 'python38_buster'),
PythonDistribTest('linux', 'x64', 'alpine3.7', source=True),
PythonDistribTest('linux', 'x64', 'jessie', source=True),
PythonDistribTest('linux', 'x86', 'jessie', source=True),

Loading…
Cancel
Save