Skip to content

Commit

Permalink
Added manylinux dockerfile and script.
Browse files Browse the repository at this point in the history
Build manylinux binary wheels for tags on travis, pypi upload.
  • Loading branch information
pkittenis committed Aug 16, 2017
1 parent b1d6f6c commit 3eedf3d
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 5 deletions.
14 changes: 13 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
script: skip
before_deploy:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- ./docker/build-packages.sh
- ./ci/docker/build-packages.sh
deploy:
- provider: releases
skip_cleanup: true
Expand All @@ -57,3 +57,15 @@ jobs:
user: pkittenis
password:
secure: "eEBo76bmNWArLOzLNkv8whYO81HqkYpwUu3RqBHv6PNW/sI70VSIVfPTWo8ThlNkYSBy1Sxci6eU+Vd8qYH/vaCbl4068BkzroGUqGMLHXLRLEPQjO2pxTvnQ7Nbj/Mi9enoslLJKflx2USy2iPz1yGCWZrPzjLWmEMcx6j5e3fEUGF2p6p01w/zWxmiSoyJgBsby9P8Fl5nflsNMVR/or8frK4K1T6Y2oTuEx9aYymmBPFOO5DHaedDxnhZ04KKaACIECvKrT5V3PMM1jrE3qu6hJ1LS0/mSivEdCwCszHanjIQy/enkNtLgxVm4jIRUjuAwL1MmxPtkAUcKrQor1YokMqm5fExdwvnp+qjtyejfA3IvT93nYvCj4IEYNMDtUGFUBjsYLqg7Ked/jvO53Ek5WEAE/Mx8F/OAtuvkpEeUKTIWxfd+V0b7pgShVuU5zFyi3y97vpRtdwqzOFr8QT3Hq+g/RIdghPQ9pGQ3GOomTMO1B7mAyOG6SYyQM/wra2h2dQTHCbgzAtsPzZLiZhWIGcU7/mGLm0kZBT6McnH2//hsIPXG8S94u2MWE0KRH5YhJ/2ATWneYyFHWQfwqDeR/1CZe66gFcPJ9cOIG+8pcmXueLhnueDbh2EWa8jmumtrAz+z+rcokih0c7catT7pByDv24Ouuw2Yf3my60="
- stage: build wheels
python: 3.6
install:
- pip install twine
script:
- if [[ ! -z "$TRAVIS_TAG" ]]; then
echo "Building wheels for tag ${TRAVIS_TAG}" &&
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" &&
./ci/travis/build-manylinux.sh;
fi
after_success:
- twine upload -u $PYPI_U -p $PYPI_P wheelhouse/*.whl
8 changes: 4 additions & 4 deletions docker/build-packages.sh → ci/docker/build-packages.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -xe

for x in `ls -1d docker/{fedora,centos}*`; do
name=`echo "$x" | awk -F/ '{print $2}'`
for x in `ls -1d ci/docker/{fedora,centos}*`; do
name=`echo "$x" | awk -F/ '{print $3}'`
dist_num=`echo "$name" | sed -r 's/[a-z]+([0-9]+)/\1/'`
docker_tag="parallelssh/ssh2-python:$name"
if [[ $dist_num -gt 20 ]]; then
Expand All @@ -17,8 +17,8 @@ for x in `ls -1d docker/{fedora,centos}*`; do
docker run -v "$(pwd):/src/" "$name" --rpm-dist $dist -s python -t rpm setup.py
done

for x in `ls -1d docker/{debian,ubuntu}*`; do
name=`echo "$x" | awk -F/ '{print $2}' | awk -F. '{print $1}'`
for x in `ls -1d ci/docker/{debian,ubuntu}*`; do
name=`echo "$x" | awk -F/ '{print $3}' | awk -F. '{print $1}'`
docker_tag="parallelssh/ssh2-python:$name"
docker pull $docker_tag || echo
docker build --cache-from $docker_tag $x -t $name
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions ci/docker/manylinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM quay.io/pypa/manylinux1_x86_64

ENV CMAKE cmake-2.8.12.2-Linux-i386
ENV OPENSSL openssl-1.0.2l
ENV LIBSSH2 libssh2-1.8.0

RUN yum install zlib-devel -y

# Cmake
RUN wget --no-check-certificate https://cmake.org/files/v2.8/${CMAKE}.tar.gz && \
tar -xzf ${CMAKE}.tar.gz && cp -af ${CMAKE}/share/* /usr/share/ && \
cp -af ${CMAKE}/bin/* /usr/bin/

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

# Libssh2
RUN wget --no-check-certificate https://www.libssh2.org/download/${LIBSSH2}.tar.gz && \
tar -xzf ${LIBSSH2}.tar.gz

RUN cd ${LIBSSH2} && cmake ../${LIBSSH2} -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 ${CMAKE}* ${OPENSSL}* ${LIBSSH2}*
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions ci/travis/build-manylinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -xe

docker_tag="parallelssh/ssh2-manylinux"

rm -rf build dist

docker pull $docker_tag || echo
docker build --cache-from $docker_tag ci/docker/manylinux -t $docker_tag
docker push $docker_tag
docker run --rm -v `pwd`:/io $docker_tag /io/ci/travis/build-wheels.sh
ls wheelhouse/
18 changes: 18 additions & 0 deletions ci/travis/build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash -xe

# Compile wheels
for PYBIN in /opt/python/*/bin; do
# "${PYBIN}/pip" install -r /io/dev-requirements.txt
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
done

# Bundle external shared libraries into the wheels
for whl in wheelhouse/*.whl; do
auditwheel repair "$whl" -w /io/wheelhouse/
done

# Install packages and test
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install ssh2-python --no-index -f /io/wheelhouse
(cd "$HOME"; "${PYBIN}/python" -c 'from ssh2.session import Session; Session()')
done

0 comments on commit 3eedf3d

Please sign in to comment.