Skip to content

Commit

Permalink
Add manylinux2010_i686 docker image (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
veblush authored and mayeut committed Oct 8, 2019
1 parent 52c7b5d commit 99c1938
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 27 deletions.
32 changes: 20 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ env:
- secure: "lKaTzEL6UNiEfp+BWLOUILG9BMtjwEMpwt6Yag0cQGHix7qJ/ElZ0t3oFw6ZwuDmA5qceAXIdxHLUK9HGVI2MloLk8czGhjvtfJ4XhOxtEJRQ0VkDGPsKN4cfhB4ZjGo6GAPtNqStMyNiY7BZuTrZa7coDLCoUeYcOmTpi6pmd1rrkk725B9QCTuhFHbPhkuL2yu/Jk6WxkHJBKjmuZek+iQa7lRItgMrG0/319PXLvwIGGl00nLFy+Ly5Ciwzux4wuHLTySZQKu0H9FX81A7smM0FW/42kg3ckGa2qLxRw/Pi8Nm/aIk8LD0QXzI5N7HhFfidOTgDS8Mt1HgfxmTk4wUXZ/KvCCshqjimzMc/s9i9wPZX9UqqcfrpZkmwz8dzhm1bndN45ZOCy6xAYT6dzf8T4mLMDjVWSW4+DUoW4sYHRLVujjcMk7ybcwGV43VruPTJnc8XVAhT+VIMQkoPjhQmTOn8h82LRNGYtLa5RReCh9OPKVYB2Quz18FXMWgFt7A6VWudL0c7/8CusLvuo+pLcxt9pnV40rvu1YEohpEj8qR/qTSaDUBZM0J9SVf5zrZR80pZUnXkDF8nm+mcLOTley3YWipU19lCR7dzVyCAiQdVAuNPdnyem3Yk8enGkAJbfLd6eaIDs+p73D0JXh1Nx1px1movVLQH3ohIw="
- secure: "w1614pomHLltkBhqWM2bOvbymFWIWKqSqqIBDvaNn9tbQScioItJoELBT7g7+cD7nyU7OvpQ1U2fk0xVkCeNvYU0xS1vP4o/VnZRpup7f7Tkiq+2rf4fjwYr3HHnJjwak1l9bsw6FkgzKaVvSdiUJHMVxiIuLd3fVozR7qjBBhTDxSlWGOpSgd+ttpgMZwU5zQjdaVQr1D7E8M0979ZnWMrNRyLiAUeHaPILS815b+ijgqR+i5nmu0/FTCGM9Ik4KIzIfWq8AdfPdbRiq8c+LrrTPfyKcIQJaHmfduYRM4LycGWwzkXFBNtLrJ7uFLG9RDVemOHuHOWIJX8qCUIV4XuESXxH3fUQr6r+yxquTJbzXxNtoaLa6tBOTQWKDrRjT4z9Mf9Im14F2V59EUDoQowHx5bjunOH5wg3ruYNKYYBFRYra5kx0CkKrqFBzyl8fTUEQLyx1HWTVUC1WTXEeD/aFKOSIxW5DxZr5W4LLlW2+Raa52ZzY28Q6AdueFQCRzoJ70/GsJRlSsBdWNOHN4gSp1cZuToLWY15y64QhAMVDpikB+V4hmkbceLiTqeWzTStNL1sa32RHr6i/9zeFZw1pMD1+eOg9x6fgODfh2sqr/zPbu2oONsHnc4D2jwsEax4o+Dv5QHLvK7jdyWUmu47a9QReoexXK60jZXs3CA="

# use YAML aliases and anchors to avoid duplication in stages
# c.f. https:/travis-ci/travis-ci/issues/8295#issuecomment-454457787
manylinux-build: &manylinux-build
stage: "Build manylinux images"
before_install:
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
script:
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh
deploy:
provider: script
script: docker/deploy.sh
on:
branch: master
repo: pypa/manylinux

jobs:
include:
- stage: "Patch glibc"
Expand All @@ -33,17 +49,9 @@ jobs:
before_cache:
# Save tagged docker images
- 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'
- stage: "Build manylinux images"
- <<: *manylinux-build
env:
- PLATFORM="x86_64"
before_install:
# Load cached docker images
- if [[ -d $HOME/docker ]]; then ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; fi
script:
- PLATFORM=$PLATFORM TRAVIS_COMMIT=$TRAVIS_COMMIT ./build.sh
deploy:
provider: script
script: docker/deploy.sh
on:
branch: master
repo: pypa/manylinux
- <<: *manylinux-build
env:
- PLATFORM="i686"
27 changes: 27 additions & 0 deletions docker/Dockerfile-i686
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM i386/centos:6
LABEL maintainer="The ManyLinux project"

ENV AUDITWHEEL_ARCH i686
ENV AUDITWHEEL_PLAT manylinux2010_$AUDITWHEEL_ARCH
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV DEVTOOLSET_ROOTPATH /opt/rh/devtoolset-7/root
ENV PATH $DEVTOOLSET_ROOTPATH/usr/bin:$PATH
ENV LD_LIBRARY_PATH $DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib:$DEVTOOLSET_ROOTPATH/usr/lib/dyninst:/usr/local/lib
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig

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

# To have linux32 command
RUN yum -y update && \
yum install -y util-linux-ng

COPY build_scripts /build_scripts
RUN linux32 bash build_scripts/build.sh && rm -r build_scripts

ENV SSL_CERT_FILE=/opt/_internal/certs.pem

ENTRYPOINT ["linux32"]
CMD ["/bin/bash"]
8 changes: 5 additions & 3 deletions docker/Dockerfile-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
FROM quay.io/pypa/manylinux2010_centos-6-no-vsyscall
LABEL maintainer="The ManyLinux project"

ENV AUDITWHEEL_PLAT manylinux2010_x86_64
ENV AUDITWHEEL_ARCH x86_64
ENV AUDITWHEEL_PLAT manylinux2010_$AUDITWHEEL_ARCH
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV PATH /opt/rh/devtoolset-8/root/usr/bin:$PATH
ENV LD_LIBRARY_PATH /opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/usr/local/lib64:/usr/local/lib
ENV DEVTOOLSET_ROOTPATH /opt/rh/devtoolset-8/root
ENV PATH $DEVTOOLSET_ROOTPATH/usr/bin:$PATH
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
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig

COPY build_scripts /build_scripts
Expand Down
51 changes: 39 additions & 12 deletions docker/build_scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ MANYLINUX2010_DEPS="glibc-devel libstdc++-devel glib2-devel libX11-devel libXext
# Get build utilities
source $MY_DIR/build_utils.sh

# See https://unix.stackexchange.com/questions/41784/can-yum-express-a-preference-for-x86-64-over-i386-packages
echo "multilib_policy=best" >> /etc/yum.conf
# Prerequisite for architecture
case $AUDITWHEEL_ARCH in
x86_64)
# See https://unix.stackexchange.com/questions/41784/can-yum-express-a-preference-for-x86-64-over-i386-packages
echo "multilib_policy=best" >> /etc/yum.conf
;;
esac

# https://hub.docker.com/_/centos/
# "Additionally, images with minor version tags that correspond to install
Expand All @@ -46,19 +51,42 @@ echo "multilib_policy=best" >> /etc/yum.conf
# Decided not to clean at this point: https:/pypa/manylinux/pull/129
yum -y update

# Software collection (for devtoolset-8) and EPEL support (for cmake28 & yasm)
yum -y install centos-release-scl https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# EPEL support (for cmake28 & yasm)
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

case $AUDITWHEEL_ARCH in
x86_64)
# Install devtoolset-8
yum -y install centos-release-scl
yum -y install \
devtoolset-8-binutils \
devtoolset-8-gcc \
devtoolset-8-gcc-c++ \
devtoolset-8-gcc-gfortran \
;;
i686)
# Install devtoolset-7 (binutils, gcc, gcc-c++, gcc-gfortran)
devtoolset7s=(
"devtoolset-7-runtime-7.1-4.el6.i686.rpm"
"devtoolset-7-binutils-2.28-11.el6.i686.rpm"
"devtoolset-7-gcc-7.3.1-5.10.el6.i686.rpm"
"devtoolset-7-libstdc++-devel-7.3.1-5.10.el6.i686.rpm"
"devtoolset-7-gcc-c++-7.3.1-5.10.el6.i686.rpm"
"devtoolset-7-libquadmath-devel-7.3.1-5.10.el6.i686.rpm"
"devtoolset-7-gcc-gfortran-7.3.1-5.10.el6.i686.rpm"
)
for rpm in "${devtoolset7s[@]}"; do
yum install -y "https://www.repo.cloudlinux.com/cloudlinux/6.10/sclo/devtoolset-7/i386/$rpm"
done
;;
esac

# Development tools and libraries
yum -y install \
automake \
bison \
bzip2 \
cmake28 \
devtoolset-8-binutils \
devtoolset-8-gcc \
devtoolset-8-gcc-c++ \
devtoolset-8-gcc-gfortran \
diffutils \
gettext \
file \
Expand Down Expand Up @@ -183,9 +211,9 @@ find /opt/_internal -depth \
# Fix libc headers to remain compatible with C99 compilers.
find /usr/include/ -type f -exec sed -i 's/\bextern _*inline_*\b/extern __inline __attribute__ ((__gnu_inline__))/g' {} +

# remove useless things that have been installed by devtoolset-8
rm -rf /opt/rh/devtoolset-8/root/usr/share/man
find /opt/rh/devtoolset-8/root/usr/share/locale -mindepth 1 -maxdepth 1 -not \( -name 'en*' -or -name 'locale.alias' \) | xargs rm -rf
# remove useless things that have been installed by devtoolset
rm -rf $DEVTOOLSET_ROOTPATH/usr/share/man
find $DEVTOOLSET_ROOTPATH/usr/share/locale -mindepth 1 -maxdepth 1 -not \( -name 'en*' -or -name 'locale.alias' \) | xargs rm -rf
rm -rf /usr/share/backgrounds
# if we updated glibc, we need to strip locales again...
localedef --list-archive | grep -v -i ^en_US.utf8 | xargs localedef --delete-from-archive
Expand All @@ -194,4 +222,3 @@ build-locale-archive
find /usr/share/locale -mindepth 1 -maxdepth 1 -not \( -name 'en*' -or -name 'locale.alias' \) | xargs rm -rf
find /usr/local/share/locale -mindepth 1 -maxdepth 1 -not \( -name 'en*' -or -name 'locale.alias' \) | xargs rm -rf
rm -rf /usr/local/share/man

0 comments on commit 99c1938

Please sign in to comment.