Skip to content

ci: add ppc64le & s390x manylinux2014 builds #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ branches:
- master
- /^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$/

os: linux
dist: focal
language: python
python: "3.8"

matrix:
include:
Expand All @@ -18,12 +21,14 @@ matrix:
env:
- PYTHON_VERSION=2.7.18

- os: linux
arch: arm64-graviton2
- arch: arm64-graviton2
virt: vm
group: edge
dist: focal
language: generic

- arch: ppc64le

- arch: s390x



cache:
Expand Down Expand Up @@ -63,15 +68,19 @@ before_install:
-v $(pwd):/io \
--env TRAVIS=True \
--env TRAVIS_OS_NAME="${TRAVIS_OS_NAME}" \
quay.io/pypa/manylinux2014_aarch64 \
/io/scripts/manylinux2014-aarch64-build-and-test-wheel.sh
quay.io/pypa/manylinux2014_$(uname -m) \
/io/scripts/manylinux2014-build-and-test-wheel.sh
fi

install:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
ci install
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
MACHINE=$(uname -m)
if [[ "${MACHINE}" == "s390x" ]] || [[ "${MACHINE}" == "ppc64le" ]]; then
pip install $(pwd)/cryptography*.whl
fi
pip install twine
fi

Expand Down
21 changes: 7 additions & 14 deletions scikit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ before_install:
PATH: /opt/python/$<MANYLINUX_PYTHON>/bin:$<PATH>
SETUP_CMAKE_ARGS: -DCMAKE_JOB_POOL_COMPILE:STRING=compile -DCMAKE_JOB_POOL_LINK:STRING=link '-DCMAKE_JOB_POOLS:STRING=compile=4;link=3'
commands:
- |
if [[ ${DEFAULT_DOCKCROSS_IMAGE} == *"manylinux2014-aarch64"* ]]; then
./scripts/manylinux2014-aarch64-build-and-install-openssl.sh
fi
- python: |
import ci, os
image_name=os.environ["DEFAULT_DOCKCROSS_IMAGE"].split(":")[0].split("/")[1]
Expand All @@ -37,14 +33,6 @@ before_install:
# SETUP_CMAKE_ARGS
if arch in ["x86", "x64"]:
os.environ["SETUP_CMAKE_ARGS"] = "-DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl " + os.environ["SETUP_CMAKE_ARGS"]
# SETUP_BDIST_WHEEL_ARGS
if arch == "aarch64":
os.environ["SETUP_BDIST_WHEEL_ARGS"] = "--plat-name %s" % os.environ["AUDITWHEEL_PLAT"]
setup_cmake_args = []
# Remove this after addressing https://github.com/dockcross/dockcross/issues/431
setup_cmake_args.append("-DOPENSSL_ROOT_DIR:PATH=/tmp/openssl-install")
setup_cmake_args.append("-DSTRIP_EXECUTABLE:FILEPATH=" + os.environ["CROSS_ROOT"] + "/" + os.environ["CROSS_TRIPLE"] + "/bin/strip")
os.environ["SETUP_CMAKE_ARGS"] = " ".join(setup_cmake_args) + " " + os.environ["SETUP_CMAKE_ARGS"]
ci.driver.Driver.save_env(os.environ)

travis:
Expand All @@ -64,11 +52,16 @@ before_install:
os.environ["SETUP_BDIST_WHEEL_ARGS"] = "--plat-name %s" % os.environ["AUDITWHEEL_PLAT"]
setup_cmake_args = []
setup_cmake_args.append("-DSTRIP_EXECUTABLE:FILEPATH=/opt/rh/devtoolset-9/root/usr/" + "/bin/strip")
if platform.machine() == "aarch64":
if platform.machine() in {"aarch64", "ppc64le", "s390x"}:
# Remove this after addressing https://github.com/dockcross/dockcross/issues/431
setup_cmake_args.append("-DOPENSSL_ROOT_DIR:PATH=/tmp/openssl-install")
os.environ["SETUP_CMAKE_ARGS"] = " ".join(setup_cmake_args)
os.environ["SETUP_MAKE_ARGS"] = "-j$(nproc)"
if platform.machine() in {"ppc64le"}:
# the container sees all 16 threads but building with all of them
# triggers the OoM killer due to RAM limitations
os.environ["SETUP_MAKE_ARGS"] = "-j4"
else:
os.environ["SETUP_MAKE_ARGS"] = "-j$(nproc)"
ci.driver.Driver.save_env(os.environ)

install:
Expand Down
32 changes: 0 additions & 32 deletions scripts/manylinux2014-aarch64-build-and-test-wheel.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,37 @@ check_var CROSS_TRIPLE

# OPENSSL_INSTALL_DIR=${CROSS_ROOT}/${CROSS_TRIPLE}
# Support using older manylinux2014-aarch64 images where 'sudo' is broken
OPENSSL_INSTALL_DIR=/tmp/openssl-install

OPENSSL_INSTALL_DIR=$1
shift

cd /tmp

# Download
wget http://www.openssl.org/source/${OPENSSL_ROOT}.tar.gz
curl -fsSLO http://www.openssl.org/source/${OPENSSL_ROOT}.tar.gz
check_sha256sum ${OPENSSL_ROOT}.tar.gz ${OPENSSL_HASH}
tar -xzf ${OPENSSL_ROOT}.tar.gz
rm -rf ${OPENSSL_ROOT}.tar.gz

if [ "$(uname -m)" == "s390x" ]; then
TARGET=linux64-s390x
else
TARGET=linux-$(uname -m)
fi

# Configure
cd ${OPENSSL_ROOT}
./Configure \
linux-aarch64 \
${TARGET} \
--cross-compile-prefix= \
--prefix=${OPENSSL_INSTALL_DIR} \
shared
$*

# Build
make -j$(nproc)

# Install
make install
make install > /dev/null

cd /tmp
rm -rf ${OPENSSL_ROOT}
41 changes: 41 additions & 0 deletions scripts/manylinux2014-build-and-test-wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

set -e
set -x

MANYLINUX_PYTHON_BIN=/opt/python/cp38-cp38/bin
export PATH="${MANYLINUX_PYTHON_BIN}:$PATH"

cd /io
./scripts/manylinux2014-build-and-install-openssl.sh /tmp/openssl-install shared

MACHINE=$(uname -m)
if [ "${MACHINE}" == "s390x" ] || [ "${MACHINE}" == "ppc64le" ]; then
# build cryptography from sources
yum install -y libffi-devel
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable --profile minimal --no-modify-path
export PATH=${HOME}/.cargo/bin:${PATH}
./scripts/manylinux2014-build-and-install-openssl.sh /tmp/openssl-cryptography no-shared -fPIC
CFLAGS="-I/tmp/openssl-cryptography/include" LDFLAGS="-L/tmp/openssl-cryptography/lib" ${MANYLINUX_PYTHON_BIN}/pip wheel --no-binary :all: cryptography
${MANYLINUX_PYTHON_BIN}/pip install ./cryptography*.whl
fi

ci_before_install() {
${MANYLINUX_PYTHON_BIN}/python scripts/ssl-check.py
${MANYLINUX_PYTHON_BIN}/pip install scikit-ci scikit-ci-addons scikit-build
}

ci_install() {
${MANYLINUX_PYTHON_BIN}/ci install
}
ci_test() {
${MANYLINUX_PYTHON_BIN}/ci test
}
ci_after_success() {
${MANYLINUX_PYTHON_BIN}/ci after_test
}

ci_before_install
ci_install
ci_test
ci_after_success