• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 The gRPC Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# Docker file for building gRPC manylinux Python artifacts.
16
17# AUTO-GENERATED FROM `$REPO_ROOT/templates/tools/dockerfile/grpc_artifact_python_manylinux2014_x86/Dockerfile.template`!!!
18
19FROM quay.io/pypa/manylinux2014_i686:2024-09-09-f386546
20
21# manylinux_2_17 is the preferred alias of manylinux2014
22ENV AUDITWHEEL_PLAT manylinux_2_17_$AUDITWHEEL_ARCH
23
24# TODO(jtattermusch): revisit which of the deps are really required
25RUN yum update -y && yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
26
27#===================================
28# Install Python build requirements
29RUN /opt/python/cp38-cp38/bin/pip install --upgrade 'cython<4.0.0rc1'
30RUN /opt/python/cp39-cp39/bin/pip install --upgrade 'cython<4.0.0rc1'
31RUN /opt/python/cp310-cp310/bin/pip install --upgrade 'cython<4.0.0rc1'
32RUN /opt/python/cp311-cp311/bin/pip install --upgrade 'cython<4.0.0rc1'
33RUN /opt/python/cp312-cp312/bin/pip install --upgrade 'cython<4.0.0rc1'
34RUN /opt/python/cp313-cp313/bin/pip install --upgrade 'cython<4.0.0rc1'
35
36#=================
37# Install ccache
38
39# Install ccache from source since ccache 3.x packaged with most linux distributions
40# does not support Redis backend for caching.
41RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.7.5/ccache-4.7.5.tar.gz \
42    && tar -zxf ccache.tar.gz \
43    && cd ccache-4.7.5 \
44    && mkdir build && cd build \
45    && cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
46    && make -j4 && make install \
47    && cd ../.. \
48    && rm -rf ccache-4.7.5 ccache.tar.gz
49
50
51
52# TODO: simplify the list of third_party modules list
53# NOTE: git>=2.46 allows leading paths like third_party/* to include all subdirectories
54# current docker base images use git versions lower than 2.46 and hence require separate configs for each submodule
55RUN git config --global --add safe.directory /var/local/jenkins/grpc
56RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git
57RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/bloaty
58RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/xds
59RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/googleapis
60RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/googletest
61RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opentelemetry
62RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opencensus-proto
63RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/boringssl-with-bazel
64RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/envoy-api
65RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/protobuf
66RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/zlib
67RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/benchmark
68RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/re2
69RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/abseil-cpp
70RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/opentelemetry-cpp
71RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/protoc-gen-validate
72RUN git config --global --add safe.directory /var/local/jenkins/grpc/.git/modules/third_party/cares/cares
73RUN git config --global protocol.file.allow always