From 42b7dd5602b80665681720dfa7e635c04c30b452 Mon Sep 17 00:00:00 2001 From: Jonas Vautherin Date: Tue, 17 Dec 2019 15:00:47 +0100 Subject: [PATCH 1/4] add support for manylinux2014-x64 --- Makefile | 28 +++++++++++++++++++++-- manylinux2014-x64/Dockerfile.in | 37 +++++++++++++++++++++++++++++++ manylinux2014-x64/Toolchain.cmake | 11 +++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 manylinux2014-x64/Dockerfile.in create mode 100644 manylinux2014-x64/Toolchain.cmake diff --git a/Makefile b/Makefile index 217fa1f..fe011e5 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,11 @@ BIN = ./bin STANDARD_IMAGES = linux-s390x android-arm android-arm64 linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv5-musl linux-armv6 linux-armv7 linux-armv7a linux-mips linux-mipsel linux-ppc64le windows-static-x86 windows-static-x64 windows-static-x64-posix windows-shared-x86 windows-shared-x64 windows-shared-x64-posix # Generated Dockerfiles. -GEN_IMAGES = linux-s390x linux-mips manylinux1-x64 manylinux1-x86 manylinux2010-x64 manylinux2010-x86 web-wasm linux-arm64 windows-static-x86 windows-static-x64 windows-static-x64-posix windows-shared-x86 windows-shared-x64 windows-shared-x64-posix linux-armv7 linux-armv7a linux-armv5 linux-armv5-musl linux-ppc64le +GEN_IMAGES = linux-s390x linux-mips manylinux1-x64 manylinux1-x86 manylinux2010-x64 manylinux2010-x86 manylinux2014-x64 web-wasm linux-arm64 windows-static-x86 windows-static-x64 windows-static-x64-posix windows-shared-x86 windows-shared-x64 windows-shared-x64-posix linux-armv7 linux-armv7a linux-armv5 linux-armv5-musl linux-ppc64le GEN_IMAGE_DOCKERFILES = $(addsuffix /Dockerfile,$(GEN_IMAGES)) # These images are expected to have explicit rules for *both* build and testing -NON_STANDARD_IMAGES = web-wasm manylinux1-x64 manylinux1-x86 manylinux2010-x64 manylinux2010-x86 +NON_STANDARD_IMAGES = web-wasm manylinux1-x64 manylinux1-x86 manylinux2010-x64 manylinux2010-x86 manylinux2014-x64 DOCKER_COMPOSITE_SOURCES = common.docker common.debian common.manylinux common.crosstool common.windows @@ -97,6 +97,30 @@ web-wasm.test: web-wasm $(BIN)/dockcross-web-wasm python test/run.py --exe-suffix ".js" rm -rf web-wasm/test +# +# manylinux2014-x64 +# +manylinux2014-x64: manylinux2014-x64/Dockerfile + mkdir -p $@/imagefiles && cp -r imagefiles $@/ + $(DOCKER) build -t $(ORG)/manylinux2014-x64:latest \ + --build-arg IMAGE=$(ORG)/manylinux2014-x64 \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ + --build-arg VCS_URL=`git config --get remote.origin.url` \ + --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + -f manylinux2014-x64/Dockerfile . + $(DOCKER) build -t $(ORG)/manylinux2014-x64:$(TAG) \ + --build-arg IMAGE=$(ORG)/manylinux2014-x64 \ + --build-arg VERSION=$(TAG) \ + --build-arg VCS_REF=`git rev-parse --short HEAD` \ + --build-arg VCS_URL=`git config --get remote.origin.url` \ + --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ + -f manylinux2014-x64/Dockerfile . + rm -rf $@/imagefiles + +manylinux2014-x64.test: manylinux2014-x64 + $(DOCKER) run $(RM) dockcross/manylinux2014-x64 > $(BIN)/dockcross-manylinux2014-x64 && chmod +x $(BIN)/dockcross-manylinux2014-x64 + $(BIN)/dockcross-manylinux2014-x64 /opt/python/cp35-cp35m/bin/python test/run.py + # # manylinux2010-x64 # diff --git a/manylinux2014-x64/Dockerfile.in b/manylinux2014-x64/Dockerfile.in new file mode 100644 index 0000000..c619e46 --- /dev/null +++ b/manylinux2014-x64/Dockerfile.in @@ -0,0 +1,37 @@ +FROM quay.io/pypa/manylinux2014_x86_64 +MAINTAINER Matt McCormick "matt.mccormick@kitware.com" + +ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux2014-x64 + +#include "common.manylinux" + +#include "common.docker" + +ENV CROSS_TRIPLE x86_64-linux-gnu +ENV CROSS_ROOT /opt/rh/devtoolset-8/root/usr/bin +ENV AS=${CROSS_ROOT}/as \ + AR=${CROSS_ROOT}/ar \ + CC=${CROSS_ROOT}/gcc \ + CPP=${CROSS_ROOT}/cpp \ + CXX=${CROSS_ROOT}/g++ \ + LD=${CROSS_ROOT}/ld \ + FC=${CROSS_ROOT}/gfortran + +COPY linux-x64/${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop + +COPY manylinux2014-x64/Toolchain.cmake ${CROSS_ROOT}/../lib/ +ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/../lib/Toolchain.cmake + +# Build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG IMAGE=dockcross/manylinux2014-x64 +ARG VERSION=latest +ARG VCS_REF +ARG VCS_URL +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$IMAGE \ + org.label-schema.version=$VERSION \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url=$VCS_URL \ + org.label-schema.schema-version="1.0" +ENV DEFAULT_DOCKCROSS_IMAGE ${IMAGE}:${VERSION} diff --git a/manylinux2014-x64/Toolchain.cmake b/manylinux2014-x64/Toolchain.cmake new file mode 100644 index 0000000..fe89e3c --- /dev/null +++ b/manylinux2014-x64/Toolchain.cmake @@ -0,0 +1,11 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_CROSSCOMPILING FALSE) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR x86_64) + +set(MANYLINUX2014 TRUE) + +set(CMAKE_C_COMPILER /opt/rh/devtoolset-8/root/usr/bin/gcc) +set(CMAKE_CXX_COMPILER /opt/rh/devtoolset-8/root/usr/bin/g++) +set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) +set(CMAKE_Fortran_COMPILER /opt/rh/devtoolset-8/root/usr/bin/gfortran) From a8add1afe299dabb17cd328880dee08d37458e2a Mon Sep 17 00:00:00 2001 From: Jonas Vautherin Date: Tue, 17 Dec 2019 18:30:42 +0100 Subject: [PATCH 2/4] add manylinux2014-x64 to circleci --- .circleci/config.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 844dbee..f61146e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -385,6 +385,26 @@ jobs: - save_cache: key: manylinux2010-x86-assets-{{ .Revision }} paths: ~/docker/manylinux2010-x86.tar + manylinux2014-x64: + <<: *build-settings + steps: + - restore_cache: + key: base-assets-{{ .Revision }} + - run: + name: manylinux2014-x64 build + no_output_timeout: 1.5h + command: | + docker load -i ~/docker/base.tar + make manylinux2014-x64 + tagged=$(docker images -q -f 'since=dockcross/manylinux2014-x64:latest' --format '{{.Repository}}:{{.Tag}}' | grep manylinux2014-x64) + docker save -o ~/docker/manylinux2014-x64.tar dockcross/manylinux2014-x64:latest $tagged + - run: + name: manylinux2014-x64 test + command: | + make manylinux2014-x64.test + - save_cache: + key: manylinux2014-x64-assets-{{ .Revision }} + paths: ~/docker/manylinux2014-x64.tar windows-static-x64: <<: *build-settings steps: @@ -711,6 +731,18 @@ jobs: tagged=$(docker images -q -f 'since=dockcross/manylinux2010-x64:latest' --format '{{.Repository}}:{{.Tag}}' | grep manylinux2010-x64) docker push $tagged fi + - restore_cache: + key: manylinux2014-x64-assets-{{ .Revision }} + - deploy: + name: Deploy manylinux2014-x64 + command: | + docker load -i ~/docker/manylinux2014-x64.tar + if [ "${CIRCLE_BRANCH}" == "master" ]; then + docker login -u $DOCKER_USER -p $DOCKER_PASS + docker push dockcross/manylinux2014-x64:latest + tagged=$(docker images -q -f 'since=dockcross/manylinux2014-x64:latest' --format '{{.Repository}}:{{.Tag}}' | grep manylinux2014-x64) + docker push $tagged + fi - restore_cache: key: windows-static-x64-assets-{{ .Revision }} - deploy: @@ -841,6 +873,9 @@ workflows: - manylinux2010-x86: requires: - base + - manylinux2014-x64: + requires: + - base - windows-static-x64: requires: - base @@ -879,6 +914,7 @@ workflows: - manylinux1-x86 - manylinux2010-x64 - manylinux2010-x86 + - manylinux2014-x64 - windows-static-x64 - windows-static-x64-posix - windows-static-x86 From d0f327e9ac9287939f4cb384203bed26e7fe5329 Mon Sep 17 00:00:00 2001 From: Jonas Vautherin Date: Tue, 17 Dec 2019 21:11:25 +0100 Subject: [PATCH 3/4] Add manylinux2014 to README --- README.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.rst b/README.rst index 682d2ee..52c00e3 100644 --- a/README.rst +++ b/README.rst @@ -189,6 +189,14 @@ dockcross/linux-x86 |linux-x86-images| Linux i686 cross compiler. +.. |manylinux2014-x64-images| image:: https://images.microbadger.com/badges/image/dockcross/manylinux2014-x64.svg + :target: https://microbadger.com/images/dockcross/manylinux2014-x64 + +dockcross/manylinux2014-x64 + |manylinux2014-x64-images| Docker `manylinux2014 `_ image for building Linux x86_64 / amd64 `Python wheel packages `_. It includes Python 2.7, 3.4, 3.5, 3.6, 3.7 and 3.8. + Also has support for the dockcross script, and it has installations of CMake, Ninja, and `scikit-build `_. For CMake, it sets `MANYLINUX2014` to "TRUE" in the toolchain. + + .. |manylinux2010-x64-images| image:: https://images.microbadger.com/badges/image/dockcross/manylinux2010-x64.svg :target: https://microbadger.com/images/dockcross/manylinux2010-x64 From 491127598521463ca2b385780f986858ef3c2aea Mon Sep 17 00:00:00 2001 From: Jonas Vautherin Date: Tue, 17 Dec 2019 21:16:11 +0100 Subject: [PATCH 4/4] Add digest to base image, for reproducibility --- manylinux2014-x64/Dockerfile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manylinux2014-x64/Dockerfile.in b/manylinux2014-x64/Dockerfile.in index c619e46..d17bfa0 100644 --- a/manylinux2014-x64/Dockerfile.in +++ b/manylinux2014-x64/Dockerfile.in @@ -1,4 +1,4 @@ -FROM quay.io/pypa/manylinux2014_x86_64 +FROM quay.io/pypa/manylinux2014_x86_64@sha256:4a5b19c57f38f59a85da695948f55bd690198a88c0df9273383f4e3fbeb457ba MAINTAINER Matt McCormick "matt.mccormick@kitware.com" ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux2014-x64