Skip to content

Commit

Permalink
Support python 3.11 on aarch64 (grpc#32270)
Browse files Browse the repository at this point in the history
* Support python 3.11 on aarch64

Fixes grpc#30927

* Change base tag to something more specific

* Update current version

---------

Co-authored-by: Richard Belleville <rbellevi@google.com>
  • Loading branch information
2 people authored and XuanWang-Amos committed May 1, 2023
1 parent 47320b1 commit 1136b2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_aarch64:664dcb74d271052b45a3f6b0bacc8fb215f294f1@sha256:35470bd34b7ad6c05c397495c4d537400f78c82256d7c7e79b25d9f5ab651c8c
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_artifact_python_manylinux2014_aarch64:8f31a9a0d9098577fa01bacbfc2940e7894fa0bd@sha256:9ea49947ec64337cdd40086912b59ace394179f87cf42531a077c5e5b86c1fe0
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM dockcross/manylinux2014-aarch64:20210826-19322ba
FROM dockcross/manylinux2014-aarch64:20230202-a61e35f

# manylinux_2_17 is the preferred alias of manylinux2014
ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
Expand All @@ -24,13 +24,14 @@ RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython
RUN /opt/python/cp39-cp39/bin/pip install --upgrade cython
RUN /opt/python/cp310-cp310/bin/pip install --upgrade cython
RUN /opt/python/cp311-cp311/bin/pip install --upgrade cython

#=================
# Install ccache

# Install ccache from source since ccache 3.x packaged with most linux distributions
# does not support Redis backend for caching.
RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD \
RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD STRIP OBJCOPY \
&& curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
&& tar -zxf ccache.tar.gz \
&& cd ccache-4.5.1 \
Expand All @@ -40,14 +41,4 @@ RUN unset CMAKE_TOOLCHAIN_FILE && unset AS AR CC CPP CXX LD \
&& cd ../.. \
&& rm -rf ccache-4.5.1 ccache.tar.gz

# the dockcross docker image sets variables like CC, CXX etc.
# to point to the crosscompilation toolchain, but doesn't set corresponding
# variables for the "strip" and "objcopy" tools.
# see https://github.com/dockcross/dockcross/blob/4349cb4999401cbf22a90f46f5052d29be240e50/manylinux2014-aarch64/Dockerfile.in#L23
ENV STRIP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-strip \
OBJCOPY=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-objcopy

# The dockcross base of this image sets CC and CXX to absolute paths, which makes it impossible to redirect their invocations
# to ccache via a symlink. Use relative paths instead.
ENV CC ${CROSS_TRIPLE}-gcc
ENV CXX ${CROSS_TRIPLE}-g++
RUN git config --global --add safe.directory /var/local/jenkins/grpc
5 changes: 4 additions & 1 deletion tools/run_tests/artifacts/artifact_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ def build_jobspec(self, inner_jobs=None):
environ['GRPC_SKIP_PIP_CYTHON_UPGRADE'] = 'TRUE'
if self.arch == 'aarch64':
environ['GRPC_SKIP_TWINE_CHECK'] = 'TRUE'
# As we won't strip the binary with auditwheel (see below), strip
# it at link time.
environ['LDFLAGS'] = '-s'
else:
# only run auditwheel if we're not crosscompiling
environ['GRPC_RUN_AUDITWHEEL_REPAIR'] = 'TRUE'
Expand Down Expand Up @@ -366,7 +369,7 @@ def targets():
PythonArtifact('manylinux2014', 'aarch64', 'cp38-cp38', presubmit=True),
PythonArtifact('manylinux2014', 'aarch64', 'cp39-cp39'),
PythonArtifact('manylinux2014', 'aarch64', 'cp310-cp310'),
# TODO(https://github.com/grpc/grpc/issues/30927): Support aarch64 with 3.11. Blocked on dockcross support.
PythonArtifact('manylinux2014', 'aarch64', 'cp311-cp311'),
PythonArtifact('linux_extra', 'armv7', 'cp37-cp37m', presubmit=True),
PythonArtifact('linux_extra', 'armv7', 'cp38-cp38'),
PythonArtifact('linux_extra', 'armv7', 'cp39-cp39'),
Expand Down

0 comments on commit 1136b2c

Please sign in to comment.