Skip to content

Add Linux AArch64 wheel build support #154

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 2 commits into from
Oct 30, 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
45 changes: 45 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,44 @@ jobs:
command: |
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/*

manylinux2014-aarch64:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
steps:
- checkout
- python/load-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
dependency-file: requirements_dev.txt
- run:
name: Git LFS
command: |
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install
git lfs pull
- run:
name: Deps
command: |
sudo apt-get install python3-pip
pip3 install -U pip
pip3 install twine
which twine
- python/save-cache:
key: manylinuxdepsv6-{{ .Branch }}.{{ arch }}
dependency-file: requirements_dev.txt
- run:
name: Build Wheels
command: |
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" ;
fi
./ci/travis/build-manylinux.sh
- run:
name: Upload Wheels
command: |
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/*

workflows:
version: 2.1
main:
Expand All @@ -132,6 +170,13 @@ workflows:
only: /.*/
branches:
ignore: /.*/
- manylinux2014-aarch64:
context: Docker
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- osx:
matrix:
parameters:
Expand Down
27 changes: 27 additions & 0 deletions ci/docker/manylinux/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM quay.io/pypa/manylinux2014_aarch64

ENV OPENSSL openssl-1.1.1g
ENV SYSTEM_LIBSSH2 1
ENV LIBSSH2_VERSION 1.9.0

RUN yum install zlib-devel -y

ADD libssh2-${LIBSSH2_VERSION}.tar.gz libssh2-${LIBSSH2_VERSION}.tar.gz
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz

RUN tar -xzf ${OPENSSL}.tar.gz
# Openssl
RUN cd ${OPENSSL} && \
./config --prefix=/usr --openssldir=/usr/openssl threads shared && \
make -j4 && make install

# Libssh2
RUN mkdir -p build_libssh2 && cd build_libssh2 && \
cmake ../libssh2-${LIBSSH2_VERSION}.tar.gz/libssh2-libssh2-${LIBSSH2_VERSION} \
-DBUILD_SHARED_LIBS=ON -DENABLE_ZLIB_COMPRESSION=ON \
-DENABLE_CRYPT_NONE=ON -DENABLE_MAC_NONE=ON -DCMAKE_INSTALL_PREFIX=/usr && \
cmake --build . --config Release --target install

RUN rm -rf ${OPENSSL}* build_libssh2 libssh2.tar.gz

VOLUME /var/cache
8 changes: 7 additions & 1 deletion ci/travis/build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash -xe

docker_tag="parallelssh/ssh2-manylinux"
docker_file="ci/docker/manylinux/Dockerfile"

rm -rf build ssh2/libssh2.*
python ci/appveyor/fix_version.py .

if [[ `uname -m` == "aarch64" ]]; then
docker_tag=${docker_tag}-aarch64
docker_file=${docker_file}.aarch64
fi

docker pull $docker_tag || echo
docker build --cache-from $docker_tag ci/docker/manylinux -t $docker_tag
docker build --cache-from $docker_tag ci/docker/manylinux -t $docker_tag -f ${docker_file}
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then docker push $docker_tag; fi
docker run -e TRAVIS_TAG="$TRAVIS_TAG" --rm -v `pwd`:/io $docker_tag /io/ci/travis/build-wheels.sh
ls wheelhouse/