Skip to content

Commit 03edd41

Browse files
mayeutauvipy
authored andcommitted
manylinux2014 (#348)
1 parent 2b5f6b0 commit 03edd41

18 files changed

+186
-816
lines changed

.travis.yml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: c
2+
os: linux
3+
dist: bionic
24
sudo: required
3-
dist: trusty
45
services:
56
- docker
67

@@ -10,48 +11,27 @@ branches:
1011
except:
1112
- /^pyup-/
1213

13-
cache:
14-
directories:
15-
- $HOME/docker
16-
1714
env:
1815
global:
1916
# QUAY_USERNAME and QUAY_PASSWORD for docker image upload
2017
- secure: "lKaTzEL6UNiEfp+BWLOUILG9BMtjwEMpwt6Yag0cQGHix7qJ/ElZ0t3oFw6ZwuDmA5qceAXIdxHLUK9HGVI2MloLk8czGhjvtfJ4XhOxtEJRQ0VkDGPsKN4cfhB4ZjGo6GAPtNqStMyNiY7BZuTrZa7coDLCoUeYcOmTpi6pmd1rrkk725B9QCTuhFHbPhkuL2yu/Jk6WxkHJBKjmuZek+iQa7lRItgMrG0/319PXLvwIGGl00nLFy+Ly5Ciwzux4wuHLTySZQKu0H9FX81A7smM0FW/42kg3ckGa2qLxRw/Pi8Nm/aIk8LD0QXzI5N7HhFfidOTgDS8Mt1HgfxmTk4wUXZ/KvCCshqjimzMc/s9i9wPZX9UqqcfrpZkmwz8dzhm1bndN45ZOCy6xAYT6dzf8T4mLMDjVWSW4+DUoW4sYHRLVujjcMk7ybcwGV43VruPTJnc8XVAhT+VIMQkoPjhQmTOn8h82LRNGYtLa5RReCh9OPKVYB2Quz18FXMWgFt7A6VWudL0c7/8CusLvuo+pLcxt9pnV40rvu1YEohpEj8qR/qTSaDUBZM0J9SVf5zrZR80pZUnXkDF8nm+mcLOTley3YWipU19lCR7dzVyCAiQdVAuNPdnyem3Yk8enGkAJbfLd6eaIDs+p73D0JXh1Nx1px1movVLQH3ohIw="
2118
- secure: "w1614pomHLltkBhqWM2bOvbymFWIWKqSqqIBDvaNn9tbQScioItJoELBT7g7+cD7nyU7OvpQ1U2fk0xVkCeNvYU0xS1vP4o/VnZRpup7f7Tkiq+2rf4fjwYr3HHnJjwak1l9bsw6FkgzKaVvSdiUJHMVxiIuLd3fVozR7qjBBhTDxSlWGOpSgd+ttpgMZwU5zQjdaVQr1D7E8M0979ZnWMrNRyLiAUeHaPILS815b+ijgqR+i5nmu0/FTCGM9Ik4KIzIfWq8AdfPdbRiq8c+LrrTPfyKcIQJaHmfduYRM4LycGWwzkXFBNtLrJ7uFLG9RDVemOHuHOWIJX8qCUIV4XuESXxH3fUQr6r+yxquTJbzXxNtoaLa6tBOTQWKDrRjT4z9Mf9Im14F2V59EUDoQowHx5bjunOH5wg3ruYNKYYBFRYra5kx0CkKrqFBzyl8fTUEQLyx1HWTVUC1WTXEeD/aFKOSIxW5DxZr5W4LLlW2+Raa52ZzY28Q6AdueFQCRzoJ70/GsJRlSsBdWNOHN4gSp1cZuToLWY15y64QhAMVDpikB+V4hmkbceLiTqeWzTStNL1sa32RHr6i/9zeFZw1pMD1+eOg9x6fgODfh2sqr/zPbu2oONsHnc4D2jwsEax4o+Dv5QHLvK7jdyWUmu47a9QReoexXK60jZXs3CA="
2219

23-
# use YAML aliases and anchors to avoid duplication in stages
24-
# c.f. https://github.com/travis-ci/travis-ci/issues/8295#issuecomment-454457787
25-
manylinux-build: &manylinux-build
26-
stage: "Build manylinux images"
27-
before_install:
28-
# Load cached docker images
29-
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
30-
script:
31-
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh
32-
deploy:
33-
provider: script
34-
script: docker/deploy.sh
35-
on:
36-
branch: master
37-
repo: pypa/manylinux
38-
39-
jobs:
20+
matrix:
4021
include:
41-
- stage: "Patch glibc"
42-
env:
43-
- PLATFORM="x86_64"
44-
before_install:
45-
# Load cached docker images
46-
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
47-
script:
48-
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh glibc_only
49-
before_cache:
50-
# Save tagged docker images
51-
- mkdir -p $HOME/docker && docker images -a --filter='dangling=false' --format '{{.Repository}}:{{.Tag}} {{.ID}}' | grep 'centos-with-vsyscall:latest' | xargs -n 2 -t sh -c 'test -e $HOME/docker/$1.tar.gz || docker save $0 | gzip -2 > $HOME/docker/$1.tar.gz'
52-
- <<: *manylinux-build
53-
env:
54-
- PLATFORM="x86_64"
55-
- <<: *manylinux-build
56-
env:
57-
- PLATFORM="i686"
22+
- arch: amd64
23+
env: PLATFORM="x86_64"
24+
- arch: amd64
25+
env: PLATFORM="i686"
26+
- arch: arm64
27+
env: PLATFORM="aarch64"
28+
29+
script:
30+
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh
31+
32+
deploy:
33+
provider: script
34+
script: docker/deploy.sh
35+
on:
36+
branch: manylinux2014
37+
repo: pypa/manylinux

README.rst

Lines changed: 65 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,48 @@ The goal of the manylinux project is to provide a convenient way to
1111
distribute binary Python extensions as wheels on Linux. This effort
1212
has produced `PEP 513 <https://www.python.org/dev/peps/pep-0513/>`_ which
1313
is further enhanced by `PEP 571 <https://www.python.org/dev/peps/pep-0571/>`_
14-
defining ``manylinux2010_x86_64`` and ``manylinux2010_i686`` platform tags.
14+
and now `PEP 599 <https://www.python.org/dev/peps/pep-0599/>`_ defining
15+
``manylinux2014_*`` platform tags.
1516

1617
PEP 513 defined ``manylinux1_x86_64`` and ``manylinux1_i686`` platform tags
17-
and the wheels were built on Centos5. Centos5 reached End of Life (EOL) on
18+
and the wheels were built on Centos5. Centos5 reached End of Life (EOL) on
1819
March 31st, 2017 and thus PEP 571 was proposed.
1920

20-
Code and details regarding ``manylinux1`` can be found here:
21+
PEP 571 defined ``manylinux2010_x86_64`` and ``manylinux2010_i686`` platform
22+
tags and the wheels were built on Centos6. Centos6 will reach End of Life (EOL)
23+
on November 30th, 2020.
24+
25+
PEP 599 defines the following platform tags:
26+
27+
- ``manylinux2014_x86_64``
28+
29+
- ``manylinux2014_i686``
30+
31+
- ``manylinux2014_aarch64``
32+
33+
- ``manylinux2014_armv7l``
34+
35+
- ``manylinux2014_ppc64``
36+
37+
- ``manylinux2014_ppc64le``
38+
39+
- ``manylinux2014_s390x``
40+
41+
Wheels are built on CentOS 7 which will reach End of Life (EOL)
42+
on June 30th, 2024.
43+
44+
Code and details regarding ``manylinux1`` can be found here:
2145
`manylinux1 <https://github.com/pypa/manylinux/tree/manylinux1>`_.
2246

47+
Code and details regarding ``manylinux2010`` can be found here:
48+
`manylinux2010 <https://github.com/pypa/manylinux/tree/master>`_.
49+
2350
Wheel packages compliant with those tags can be uploaded to
2451
`PyPI <https://pypi.python.org>`_ (for instance with `twine
2552
<https://pypi.python.org/pypi/twine>`_) and can be installed with
26-
**pip 19.0 and later**.
53+
**pip 19.3 and later**.
2754

28-
The manylinux2010 tags allow projects to distribute wheels that are
55+
The manylinux2014 tags allow projects to distribute wheels that are
2956
automatically installed (and work!) on the vast majority of desktop
3057
and server Linux distributions.
3158

@@ -35,79 +62,77 @@ This repository hosts several manylinux-related things:
3562
Docker images
3663
-------------
3764

38-
.. image:: https://travis-ci.org/pypa/manylinux.svg?branch=master
65+
.. image:: https://travis-ci.org/pypa/manylinux.svg?branch=manylinux2014
3966
:target: https://travis-ci.org/pypa/manylinux
4067

4168
Building manylinux-compatible wheels is not trivial; as a general
4269
rule, binaries built on one Linux distro will only work on other Linux
4370
distros that are the same age or newer. Therefore, if we want to make
44-
binaries that run on most Linux distros, we have to use a very old
45-
distro -- CentOS 6.
71+
binaries that run on most Linux distros, we have to use an old enough
72+
distro -- CentOS 7.
4673

4774

48-
Rather than forcing you to install CentOS 6 yourself, install Python,
49-
etc., we provide a `Docker <https://docker.com/>`_ image where we've
75+
Rather than forcing you to install CentOS 7 yourself, install Python,
76+
etc., we provide `Docker <https://docker.com/>`_ images where we've
5077
done the work for you:
5178

52-
64-bit image (x86-64): ``quay.io/pypa/manylinux2010_x86_64``
79+
x86_64 image: ``quay.io/pypa/manylinux2014_x86_64``
80+
81+
.. image:: https://quay.io/repository/pypa/manylinux2014_x86_64/status
82+
:target: https://quay.io/repository/pypa/manylinux2014_x86_64
5383

54-
.. image:: https://quay.io/repository/pypa/manylinux2010_x86_64/status
55-
:target: https://quay.io/repository/pypa/manylinux2010_x86_64
84+
i686 image: ``quay.io/pypa/manylinux2014_i686``
85+
86+
.. image:: https://quay.io/repository/pypa/manylinux2014_i686/status
87+
:target: https://quay.io/repository/pypa/manylinux2014_i686
88+
89+
aarch64 image: ``quay.io/pypa/manylinux2014_aarch64``
90+
91+
.. image:: https://quay.io/repository/pypa/manylinux2014_aarch64/status
92+
:target: https://quay.io/repository/pypa/manylinux2014_aarch64
5693

5794

5895
These images are rebuilt using Travis-CI on every commit to this
5996
repository; see the
60-
`docker/ <https://github.com/pypa/manylinux/tree/master/docker>`_
97+
`docker/ <https://github.com/pypa/manylinux/tree/manylinux2014/docker>`_
6198
directory for source code.
6299

63100
The images currently contain:
64101

65-
- CPython 2.7, 3.4, 3.5, 3.6 and 3.7, installed in
102+
- CPython 3.5, 3.6, 3.7 and 3.8, installed in
66103
``/opt/python/<python tag>-<abi tag>``. The directories are named
67104
after the PEP 425 tags for each environment --
68-
e.g. ``/opt/python/cp27-cp27mu`` contains a wide-unicode CPython 2.7
69-
build, and can be used to produce wheels named like
70-
``<pkg>-<version>-cp27-cp27mu-<arch>.whl``.
105+
e.g. ``/opt/python/cp35-cp35m`` contains a CPython 3.5 build, and
106+
can be used to produce wheels named like
107+
``<pkg>-<version>-cp35-cp35m-<arch>.whl``.
71108

72-
- Devel packages for all the libraries that PEP 571 allows you to
109+
- Devel packages for all the libraries that PEP 599 allows you to
73110
assume are present on the host system
74111

75112
- The `auditwheel <https://pypi.python.org/pypi/auditwheel>`_ tool
76113

77-
Note that prior to CPython 3.3, there were two ABI-incompatible ways
78-
of building CPython: ``--enable-unicode=ucs2`` and
79-
``--enable-unicode=ucs4``. We provide both versions
80-
(e.g. ``/opt/python/cp27-cp27m`` for narrow-unicode,
81-
``/opt/python/cp27-cp27mu`` for wide-unicode). NB: essentially all
82-
Linux distributions configure CPython in ``mu``
83-
(``--enable-unicode=ucs4``) mode, but ``--enable-unicode=ucs2`` builds
84-
are also encountered in the wild. Other less common or virtually
85-
unheard of flag combinations (such as ``--with-pydebug`` (``d``) and
86-
``--without-pymalloc`` (absence of ``m``)) are not provided.
87114

88115
Building Docker images
89116
----------------------
90117

91-
To build the Docker images, you will need to fetch the tarballs to
92-
``docker/sources/`` prior to building. This can be done with the
93-
provided prefetch script, after which you can proceed with building.
94-
Please run the following command from the current (root) directory::
118+
To build the Docker images, please run the following command from the
119+
current (root) directory:
95120

96121
$ PLATFORM=$(uname -m) TRAVIS_COMMIT=latest ./build.sh
97122

98123
Example
99124
-------
100125

101-
An example project which builds 64-bit wheels for each Python interpreter
126+
An example project which builds x86_64 wheels for each Python interpreter
102127
version can be found here: https://github.com/pypa/python-manylinux-demo. The
103-
repository also contains demo to build 32-bit and 64-bit wheels with ``manylinux1``
128+
repository also contains demo to build i686 and x86_64 wheels with ``manylinux1``
104129
tags.
105130

106131
This demonstrates how to use these docker images in conjunction with auditwheel
107132
to build manylinux-compatible wheels using the free `travis ci <https://travis-ci.org/>`_
108133
continuous integration service.
109134

110-
(NB: for the 32-bit images running on a 64-bit host machine, it's necessary to run
135+
(NB: for the i686 images running on a x86_64 host machine, it's necessary to run
111136
everything under the command line program `linux32`, which changes reported architecture
112137
in new program environment. See `this example invocation
113138
<https://github.com/pypa/python-manylinux-demo/blob/master/.travis.yml#L14>`_)
@@ -124,9 +149,12 @@ where the PEP was originally written, so if for some reason you really
124149
want to see the full history of edits it went through, then this is
125150
the place to look.
126151

127-
The proposal to upgrade ``manylinux1`` to ``manylinux2010`` after Centos5
152+
The proposal to upgrade ``manylinux1`` to ``manylinux2010`` after Centos5
128153
reached EOL was discussed in `PEP 571 <https://www.python.org/dev/peps/pep-0571/>`_.
129154

155+
The proposal to upgrade ``manylinux2010`` to ``manylinux2014`` was
156+
discussed in `PEP 599 <https://www.python.org/dev/peps/pep-0599/>`_.
157+
130158
This repo also has some analysis code that was used when putting
131159
together the original proposal in the ``policy-info/`` directory.
132160

build.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,4 @@
44
set -ex
55

66

7-
if [ $PLATFORM == x86_64 ] || [ "$1" == "glibc_only" ]; then
8-
# Output something every 10 minutes or Travis kills the job
9-
while sleep 9m; do echo -n -e " \b"; done &
10-
docker build --rm -t centos-with-vsyscall:latest --cache-from centos-with-vsyscall:latest --target centos-with-vsyscall -f docker/glibc/Dockerfile docker/glibc/
11-
# Killing background sleep loop
12-
kill %1
13-
if [ "$1" == "glibc_only" ]; then
14-
exit 0
15-
fi
16-
docker build --rm -t quay.io/pypa/manylinux2010_centos-6-no-vsyscall --cache-from quay.io/pypa/manylinux2010_centos-6-no-vsyscall:latest --cache-from centos-with-vsyscall:latest -f docker/glibc/Dockerfile docker/glibc/
17-
fi
18-
19-
docker build --rm -t quay.io/pypa/manylinux2010_$PLATFORM:$TRAVIS_COMMIT -f docker/Dockerfile-$PLATFORM docker/
7+
docker build --rm -t quay.io/pypa/manylinux2014_$PLATFORM:$TRAVIS_COMMIT -f docker/Dockerfile-$PLATFORM docker/

docker/Dockerfile-aarch64

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM arm64v8/centos:7
2+
LABEL maintainer="The ManyLinux project"
3+
4+
ENV AUDITWHEEL_ARCH aarch64
5+
ENV AUDITWHEEL_PLAT manylinux2014_$AUDITWHEEL_ARCH
6+
ENV LC_ALL en_US.UTF-8
7+
ENV LANG en_US.UTF-8
8+
ENV LANGUAGE en_US.UTF-8
9+
ENV DEVTOOLSET_ROOTPATH /opt/rh/devtoolset-8/root
10+
ENV PATH $DEVTOOLSET_ROOTPATH/usr/bin:$PATH
11+
ENV LD_LIBRARY_PATH $DEVTOOLSET_ROOTPATH/usr/lib64:$DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib64/dyninst:$DEVTOOLSET_ROOTPATH/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib
12+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
13+
14+
COPY build_scripts /build_scripts
15+
RUN bash build_scripts/build.sh && rm -r build_scripts
16+
17+
ENV SSL_CERT_FILE=/opt/_internal/certs.pem
18+
19+
CMD ["/bin/bash"]

docker/Dockerfile-i686

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
FROM i386/centos:6
1+
FROM i386/centos:7
22
LABEL maintainer="The ManyLinux project"
33

44
ENV AUDITWHEEL_ARCH i686
5-
ENV AUDITWHEEL_PLAT manylinux2010_$AUDITWHEEL_ARCH
5+
ENV AUDITWHEEL_PLAT manylinux2014_$AUDITWHEEL_ARCH
66
ENV LC_ALL en_US.UTF-8
77
ENV LANG en_US.UTF-8
88
ENV LANGUAGE en_US.UTF-8
9-
ENV DEVTOOLSET_ROOTPATH /opt/rh/devtoolset-7/root
10-
ENV PATH $DEVTOOLSET_ROOTPATH/usr/bin:$PATH
11-
ENV LD_LIBRARY_PATH $DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib/dyninst:/usr/local/lib
9+
ENV LD_LIBRARY_PATH /usr/local/lib64:/usr/local/lib
1210
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
1311

1412
# Set a base architecture of yum package to i386
1513
RUN echo "i386" > /etc/yum/vars/basearch
1614

17-
# To have linux32 command
15+
# To have linux32 command
1816
RUN yum -y update && \
1917
yum install -y util-linux-ng
2018

@@ -23,5 +21,4 @@ RUN linux32 bash build_scripts/build.sh && rm -r build_scripts
2321

2422
ENV SSL_CERT_FILE=/opt/_internal/certs.pem
2523

26-
ENTRYPOINT ["linux32"]
2724
CMD ["/bin/bash"]

docker/Dockerfile-x86_64

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# See docker/glibc/
2-
FROM quay.io/pypa/manylinux2010_centos-6-no-vsyscall
1+
FROM centos:7
32
LABEL maintainer="The ManyLinux project"
43

54
ENV AUDITWHEEL_ARCH x86_64
6-
ENV AUDITWHEEL_PLAT manylinux2010_$AUDITWHEEL_ARCH
5+
ENV AUDITWHEEL_PLAT manylinux2014_$AUDITWHEEL_ARCH
76
ENV LC_ALL en_US.UTF-8
87
ENV LANG en_US.UTF-8
98
ENV LANGUAGE en_US.UTF-8

0 commit comments

Comments
 (0)