Bläddra i källkod

Merge pull request #21924 from gnossen/readd_manylinux1

Temporarily Readd Manylinux1 Support
Richard Belleville 5 år sedan
förälder
incheckning
37202c6b3c

+ 31 - 0
tools/dockerfile/grpc_artifact_python_manylinux1_x64/Dockerfile

@@ -0,0 +1,31 @@
+# Copyright 2016 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.
+
+# Docker file for building gRPC manylinux Python artifacts.
+
+FROM quay.io/pypa/manylinux1_x86_64
+
+# Update the package manager
+RUN yum update -y
+RUN yum install -y curl-devel expat-devel gettext-devel linux-headers openssl-devel zlib-devel gcc
+
+###################################
+# Install Python build requirements
+RUN /opt/python/cp27-cp27m/bin/pip install --upgrade cython
+RUN /opt/python/cp27-cp27mu/bin/pip install --upgrade cython
+RUN /opt/python/cp34-cp34m/bin/pip install --upgrade cython
+RUN /opt/python/cp35-cp35m/bin/pip install --upgrade cython
+RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
+RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
+RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython

+ 32 - 0
tools/dockerfile/grpc_artifact_python_manylinux1_x86/Dockerfile

@@ -0,0 +1,32 @@
+# Copyright 2016 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.
+
+# Docker file for building gRPC manylinux Python artifacts.
+
+FROM quay.io/pypa/manylinux1_i686
+
+# Update the package manager
+RUN yum update -y
+RUN yum install -y curl-devel expat-devel gettext-devel linux-headers openssl-devel zlib-devel gcc
+
+###################################
+# Install Python build requirements
+RUN /opt/python/cp27-cp27m/bin/pip install --upgrade cython
+RUN /opt/python/cp27-cp27mu/bin/pip install --upgrade cython
+RUN /opt/python/cp34-cp34m/bin/pip install --upgrade cython
+RUN /opt/python/cp35-cp35m/bin/pip install --upgrade cython
+RUN /opt/python/cp36-cp36m/bin/pip install --upgrade cython
+RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
+RUN /opt/python/cp37-cp37m/bin/pip install --upgrade cython
+RUN /opt/python/cp38-cp38/bin/pip install --upgrade cython

+ 19 - 2
tools/run_tests/artifacts/artifact_targets.py

@@ -152,10 +152,15 @@ class PythonArtifact:
             environ['GRPC_BUILD_GRPCIO_TOOLS_DEPENDENTS'] = 'TRUE'
             environ['GRPC_BUILD_MANYLINUX_WHEEL'] = 'TRUE'
 
+            if self.platform == 'manylinux1':
+                # manylinux1 currently has too old version of gcc
+                # so we need to use this workaround to avoid
+                # the "SSE2 instruction set not enabled" boringssl build error
+                # https://gcc.gnu.org/ml/gcc-patches/2013-04/msg00740.html
+                environ['CFLAGS'] += ' -msse2'
+
             return create_docker_jobspec(
                 self.name,
-                # NOTE(rbellevi): Do *not* update this without also ensuring the
-                # base_docker_image attribute is accurate.
                 'tools/dockerfile/grpc_artifact_python_%s_%s' %
                 (self.platform, self.arch),
                 'tools/run_tests/artifacts/build_artifact_python.sh',
@@ -360,6 +365,12 @@ def targets():
         CSharpExtArtifact('macos', 'ios'),
         # TODO(https://github.com/grpc/grpc/issues/20283)
         # Add manylinux2010_x86 targets once this issue is resolved.
+        PythonArtifact('manylinux1', 'x86', 'cp27-cp27m'),
+        PythonArtifact('manylinux1', 'x86', 'cp27-cp27mu'),
+        PythonArtifact('manylinux1', 'x86', 'cp35-cp35m'),
+        PythonArtifact('manylinux1', 'x86', 'cp36-cp36m'),
+        PythonArtifact('manylinux1', 'x86', 'cp37-cp37m'),
+        PythonArtifact('manylinux1', 'x86', 'cp38-cp38'),
         PythonArtifact('manylinux2010', 'x86', 'cp27-cp27m'),
         PythonArtifact('manylinux2010', 'x86', 'cp27-cp27mu'),
         PythonArtifact('manylinux2010', 'x86', 'cp35-cp35m'),
@@ -372,6 +383,12 @@ def targets():
         PythonArtifact('linux_extra', 'armv6', '2.7'),
         PythonArtifact('linux_extra', 'armv6', '3.5'),
         PythonArtifact('linux_extra', 'armv6', '3.6'),
+        PythonArtifact('manylinux1', 'x64', 'cp27-cp27m'),
+        PythonArtifact('manylinux1', 'x64', 'cp27-cp27mu'),
+        PythonArtifact('manylinux1', 'x64', 'cp35-cp35m'),
+        PythonArtifact('manylinux1', 'x64', 'cp36-cp36m'),
+        PythonArtifact('manylinux1', 'x64', 'cp37-cp37m'),
+        PythonArtifact('manylinux1', 'x64', 'cp38-cp38'),
         PythonArtifact('manylinux2010', 'x64', 'cp27-cp27m'),
         PythonArtifact('manylinux2010', 'x64', 'cp27-cp27mu'),
         PythonArtifact('manylinux2010', 'x64', 'cp35-cp35m'),