Skip to content

Commit 4337437

Browse files
authored
Arm wheels (#40)
* Added aarch64 (ARM) manylinux-2014 wheel builds * Updated CI cfg * Updated OSX targets
1 parent ca3bc23 commit 4337437

12 files changed

+220
-64
lines changed

Diff for: .appveyor.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# This file is part of ssh-python.
2+
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
3+
#
4+
# This library is free software; you can redistribute it and/or
5+
# modify it under the terms of the GNU Lesser General Public
6+
# License as published by the Free Software Foundation, version 2.1.
7+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
# Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public
14+
# License along with this library; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
116
max_jobs: 5
217
build:
318
parallel: true
@@ -17,7 +32,7 @@ environment:
1732
PYTHON_DEF: "C:\\Python38-x64"
1833
PYTHON_VERSION: "3.8"
1934
# Python versions to build wheels for
20-
PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64 C:\Python39-x64
35+
PYTHONVERS: C:\Python36-x64 C:\Python37-x64 C:\Python38-x64 C:\Python39-x64 C:\Python310-x64
2136
PYTHON_ARCH: "64"
2237

2338
install:

Diff for: .circleci/config.yml

+30-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# This file is part of ssh-python.
2+
# Copyright (C) 2017-2021 Panos Kittenis and contributors.
3+
#
4+
# This library is free software; you can redistribute it and/or
5+
# modify it under the terms of the GNU Lesser General Public
6+
# License as published by the Free Software Foundation, version 2.1.
7+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
# Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public
14+
# License along with this library; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
116
version: 2.1
217

318
orbs:
@@ -72,10 +87,10 @@ jobs:
7287
command: |
7388
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD wheels/*
7489
75-
manylinux:
90+
manylinux-x86_64:
7691
machine:
7792
image: ubuntu-1604:201903-01
78-
steps:
93+
steps: &manylinux-steps
7994
- checkout
8095
- run:
8196
name: sdist
@@ -93,7 +108,8 @@ jobs:
93108
- run:
94109
name: Deps
95110
command: |
96-
sudo apt-get install python-pip
111+
sudo apt-get install python3-pip
112+
pyenv global 3.7.0 || pyenv global 3.9.1
97113
pip install -U pip
98114
pip install twine
99115
which twine
@@ -112,6 +128,12 @@ jobs:
112128
command: |
113129
twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASSWORD dist/* wheelhouse/*
114130
131+
manylinux2014-aarch64:
132+
machine:
133+
image: ubuntu-2004:202101-01
134+
resource_class: arm.medium
135+
steps: *manylinux-steps
136+
115137
workflows:
116138
version: 2.1
117139
main:
@@ -126,19 +148,21 @@ workflows:
126148
filters:
127149
tags:
128150
ignore: /.*/
129-
- manylinux:
151+
- manylinux-x86_64: &manylinux-wf
130152
context: Docker
131153
filters:
132154
tags:
133155
only: /.*/
134156
branches:
135157
ignore: /.*/
158+
- manylinux2014-aarch64: *manylinux-wf
136159
- osx:
137160
matrix:
138161
parameters:
139162
xcode_ver:
140-
- "11.6.0"
141-
- "11.1.0"
163+
- "13.1.0"
164+
- "13.0.0"
165+
- "12.5.1"
142166
context: Docker
143167
filters:
144168
tags:

Diff for: _setup_libssh.py

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# This file is part of ssh-python.
2+
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
3+
#
4+
# This library is free software; you can redistribute it and/or
5+
# modify it under the terms of the GNU Lesser General Public
6+
# License as published by the Free Software Foundation, version 2.1.
7+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
# Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public
14+
# License along with this library; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
116
import os
217

318
from sys import stderr

Diff for: ci/build-manylinux.sh

+32-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
11
#!/bin/bash -xe
2+
# This file is part of ssh-python.
3+
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
4+
#
5+
# This library is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation, version 2.1.
8+
#
9+
# This library is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# Lesser General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public
15+
# License along with this library; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
218

319
docker_tag="parallelssh/ssh-manylinux"
20+
docker_files=("ci/docker/manylinux/Dockerfile" "ci/docker/manylinux/Dockerfile.2014_x86_64")
421

522
rm -rf local build ssh/libssh.* ssh/*.so
623
python ci/appveyor/fix_version.py .
724

8-
docker pull $docker_tag || echo
9-
docker build --pull --cache-from $docker_tag ci/docker/manylinux -t $docker_tag
10-
if [[ -z "$CIRCLE_PR_NUMBER" ]]; then docker push $docker_tag; fi
11-
docker run --rm -v `pwd`:/io $docker_tag /io/ci/build-wheels.sh
12-
ls wheelhouse/
25+
if [[ $(uname -m) == "aarch64" ]]; then
26+
docker_tag=${docker_tag}:aarch64
27+
docker_files=("ci/docker/manylinux/Dockerfile.aarch64")
28+
fi
29+
30+
for docker_file in "${docker_files[@]}"; do
31+
if [[ ${docker_file} == "ci/docker/manylinux/Dockerfile_2014_x86_64" ]]; then
32+
docker_tag="${docker_tag}:2014_x86_64"
33+
fi
34+
docker pull $docker_tag || echo
35+
docker build --pull --cache-from $docker_tag ci/docker/manylinux -t $docker_tag -f ${docker_file}
36+
if [[ -z "${CIRCLE_PULL_REQUEST}" ]]; then docker push $docker_tag; fi
37+
docker run --rm -v "$(pwd)":/io $docker_tag /io/ci/build-wheels.sh
38+
ls wheelhouse/
39+
done

Diff for: ci/build-wheels.sh

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
#!/bin/bash -xe
2+
# This file is part of ssh-python.
3+
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
4+
#
5+
# This library is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation, version 2.1.
8+
#
9+
# This library is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# Lesser General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public
15+
# License along with this library; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
218

319
# Compile wheels
420
rm -rf /io/build
5-
for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do
21+
for PYBIN in $(ls -1d /opt/python/*/bin | grep -v cpython); do
622
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
723
done
824

@@ -12,7 +28,7 @@ for whl in wheelhouse/*.whl; do
1228
done
1329

1430
# Install packages and test
15-
for PYBIN in `ls -1d /opt/python/*/bin | grep -v cpython`; do
31+
for PYBIN in $(ls -1d /opt/python/*/bin | grep -v cpython); do
1632
"${PYBIN}/pip" install ssh-python --no-index -f /io/wheelhouse
1733
(cd "$HOME"; "${PYBIN}/python" -c 'from ssh.session import Session; Session()')
1834
done

Diff for: ci/build_ssh.sh

+16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/bin/bash -xe
2+
# This file is part of ssh-python.
3+
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
4+
#
5+
# This library is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation, version 2.1.
8+
#
9+
# This library is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# Lesser General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public
15+
# License along with this library; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
218

319
if [ -d /usr/local/opt/openssl ]; then
420
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl

Diff for: ci/docker/manylinux/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ FROM quay.io/pypa/manylinux2010_x86_64
22

33
ENV OPENSSL openssl-1.1.1g
44
ENV LIBSSH 0.9.6
5+
ENV KRB 1.18.4
56
ENV SYSTEM_LIBSSH 1
67
ENV CFLAGS "-g0 -s"
78

89
RUN yum install zlib-devel cmake3 -y
910

1011
ADD libssh-${LIBSSH}.tar.xz libssh.tar.xz
1112
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
12-
ADD krb5-1.18.4.tar.xz krb5-1.18.4.tar.xz
13+
ADD krb5-${KRB}.tar.xz krb5-${KRB}.tar.xz
1314

1415
RUN tar -xzf ${OPENSSL}.tar.gz
1516
# Openssl
@@ -18,7 +19,7 @@ RUN cd ${OPENSSL} && \
1819
make -j6 && make install_sw
1920

2021
# Kerberos
21-
RUN cd krb5-1.18.4.tar.xz/krb5-1.18.4/src && \
22+
RUN cd krb5-${KRB}.tar.xz/krb5-${KRB}/src && \
2223
./configure && \
2324
make -j6 && \
2425
make install
@@ -29,6 +30,6 @@ RUN mkdir -p build_libssh && cd build_libssh && \
2930
-DWITH_GSS_API=ON && \
3031
make -j6 install/strip
3132

32-
RUN rm -rf ${OPENSSL}* libssh build_libssh krb5-1.18.4.tar.xz
33+
RUN rm -rf ${OPENSSL}* libssh build_libssh krb5-${KRB}.tar.xz
3334

3435
VOLUME /var/cache

Diff for: ci/docker/manylinux/Dockerfile.2014_x86_64

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM quay.io/pypa/manylinux2014_x86_64
2+
3+
ENV OPENSSL openssl-1.1.1g
4+
ENV LIBSSH 0.9.6
5+
ENV KRB 1.18.4
6+
ENV SYSTEM_LIBSSH 1
7+
ENV CFLAGS "-g0 -s"
8+
9+
RUN yum install zlib-devel cmake3 -y
10+
11+
ADD libssh-${LIBSSH}.tar.xz libssh.tar.xz
12+
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
13+
ADD krb5-${KRB}.tar.xz krb5-${KRB}.tar.xz
14+
15+
RUN tar -xzf ${OPENSSL}.tar.gz
16+
# Openssl
17+
RUN cd ${OPENSSL} && \
18+
./config --prefix=/usr --openssldir=/usr/openssl threads shared && \
19+
make -j6 && make install_sw
20+
21+
# Kerberos
22+
RUN cd krb5-${KRB}.tar.xz/krb5-${KRB}/src && \
23+
./configure && \
24+
make -j6 && \
25+
make install
26+
27+
# Libssh
28+
RUN mkdir -p build_libssh && cd build_libssh && \
29+
cmake3 ../libssh.tar.xz/libssh-${LIBSSH} -DCMAKE_BUILD_TYPE=Release \
30+
-DWITH_GSS_API=ON && \
31+
make -j6 install/strip
32+
33+
RUN rm -rf ${OPENSSL}* libssh build_libssh krb5-${KRB}.tar.xz
34+
35+
VOLUME /var/cache

Diff for: ci/docker/manylinux/Dockerfile.aarch64

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM quay.io/pypa/manylinux2014_aarch64
2+
3+
ENV OPENSSL openssl-1.1.1g
4+
ENV LIBSSH 0.9.6
5+
ENV KRB 1.18.4
6+
ENV SYSTEM_LIBSSH 1
7+
ENV CFLAGS "-g0 -s"
8+
9+
RUN yum install epel-release -y
10+
RUN yum install zlib-devel cmake3 -y
11+
12+
ADD libssh-${LIBSSH}.tar.xz libssh.tar.xz
13+
ADD https://www.openssl.org/source/${OPENSSL}.tar.gz ${OPENSSL}.tar.gz
14+
ADD krb5-${KRB}.tar.xz krb5-${KRB}.tar.xz
15+
16+
RUN tar -xzf ${OPENSSL}.tar.gz
17+
# Openssl
18+
RUN cd ${OPENSSL} && \
19+
./config --prefix=/usr --openssldir=/usr/openssl threads shared && \
20+
make -j6 && make install_sw
21+
22+
# Kerberos
23+
RUN cd krb5-${KRB}.tar.xz/krb5-${KRB}/src && \
24+
./configure && \
25+
make -j6 && \
26+
make install
27+
28+
# Libssh
29+
RUN mkdir -p build_libssh && cd build_libssh && \
30+
cmake3 ../libssh.tar.xz/libssh-${LIBSSH} -DCMAKE_BUILD_TYPE=Release \
31+
-DWITH_GSS_API=ON && \
32+
make -j6 install/strip
33+
34+
RUN rm -rf ${OPENSSL}* libssh build_libssh krb5-${KRB}.tar.xz
35+
36+
VOLUME /var/cache

Diff for: ci/osx-wheel.sh

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
#!/bin/bash -xe
2+
# This file is part of ssh-python.
3+
# Copyright (C) 2017-2022 Panos Kittenis and contributors.
4+
#
5+
# This library is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation, version 2.1.
8+
#
9+
# This library is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
# Lesser General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public
15+
# License along with this library; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
218

319
pip3 install -U virtualenv
420
python3 -m virtualenv -p "$(which python3)" venv
@@ -20,7 +36,7 @@ ls -l wheels/*.whl
2036
rm -f /usr/local/lib/libssh*
2137
pip3 install -v wheels/*.whl
2238
pwd; mkdir -p temp; cd temp; pwd
23-
python3 -c "from ssh.session import Session; Session()" && echo "Import successfull"
39+
python3 -c "from ssh.session import Session; Session()" && echo "Import successful"
2440
cd ..; pwd
2541
set +x
2642
deactivate

0 commit comments

Comments
 (0)