Skip to content
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

Fixes #152 Deploy to Circle CI #153

Merged
merged 32 commits into from
Jul 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c7b9422
[circle] refs #152 Added deploy test in aarch64 and added deploy to t…
Jul 12, 2019
4a42b2b
[circle] refs #152 Change de imagen to base test
Jul 12, 2019
d73d831
skyapi] refs #152 Correcting version
Jul 12, 2019
7709f97
[circle] refs #152 Create script the deploy
Jul 12, 2019
46f5788
[circle] refs #152 Correcting path in script deploy
Jul 12, 2019
d274a8a
Merge branch '0.25.dev' of https://github.com/skycoin/pyskycoin into …
Jul 12, 2019
bd104ee
[circle] refs #152 Correcting parse file upload_pypi.sh
Jul 12, 2019
3c744d6
[circle] refs #152 Separate all compilations
Jul 12, 2019
eaf3fed
[circle] refs #152 Correcting parse in script circle_wheels
Jul 12, 2019
ab003f4
[circle] refs #152 Create folder after build .wheel
Jul 12, 2019
d988e46
[circle] refs #152 Remove $PIP install requiremnt this imagen test
Jul 12, 2019
4da38f4
[circle] refs #152 Repair path in checking auditwheel
Jul 12, 2019
6d2e8cd
[circle] refs #152 Change path the export pip wheel in arm
Jul 12, 2019
89b27a7
[skyapi] refs #152 Changes in setup.py parameter need install
Jul 12, 2019
a05ea77
[circle] refs #152 Include in repair to intel and ARM
Jul 12, 2019
f5270c4
[circle] refs #152 Remove bad compilations
Jul 12, 2019
927d361
[skyapi] refs #152 Include README.md
Jul 12, 2019
a0b89d7
[circle] refs #152 Added deploy to pypi.org armv7 and aarch64
Jul 12, 2019
f11a2d4
[circle] refs #152 Added install auditwheel in ARM
Jul 12, 2019
5a0cd8c
[circle] refs #152 Upgrade version pip to deploy skyapi
Jul 12, 2019
12ea8df
[skyapi] refs #152 Restore setup.py
Jul 12, 2019
cf24db0
[circle] refs #152 Remove auditwheel the ARM
Jul 12, 2019
f1e01bf
[circle] refs #152 Remove bad declarations
Jul 12, 2019
558341f
[skyapi] refs #152 Added README.md
Jul 12, 2019
8c6d3c8
[circle][skyapi] refs #152 Exclude aarch64 to deploy test.pypi.org
Jul 13, 2019
d776ff0
[circle] refs #152 Added deploy to github and pypi.org
Jul 13, 2019
26b207d
[circle] refs #152 Remove packages in conflict
Jul 13, 2019
3e23009
[circle] refs #152 Remove pip install auditwheel because not working …
Jul 13, 2019
90071b9
[circle] refs #152 Install cmake y make
Jul 13, 2019
d7df54e
[circle] refs #152 Declare install SWIG in set -ex
Jul 13, 2019
eef07b1
[circle] refs #152 Remove bad definiction s in run install swig
Jul 13, 2019
20ba710
[circle] refs #152 Change he conpile file and intall repo
Jul 13, 2019
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
12 changes: 9 additions & 3 deletions .circleci/circle_wheels.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install -r /io/requirements.dev.txt
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
"${PYBIN}/pip" install -r /io/requirements.txt
"${PYBIN}/pip" install -r /io/lib/skyapi/requirements.txt
"${PYBIN}/pip" wheel /io/ -w /io/wheelhouse/
"${PYBIN}/pip" wheel /io/lib/skyapi/ -w /io/wheelhouse/
done

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

rm -rfv /io/wheelhouse/*linux_i686.whl
rm -rfv /io/wheelhouse/*linux_x86_64.whl
13 changes: 3 additions & 10 deletions .circleci/circle_wheels_arm.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# Compile wheels
pip wheel /io/ -w /io/wheelhouse/
pip wheel /io/lib/skyapi/ -w /io/wheelhouse/
# python3.4 -m pip wheel /io/ -w wheelhouse/
pip3 wheel /io/lib/skyapi/ -w /io/wheelhouse/
pip3 wheel /io/ -w /io/wheelhouse/
# python3.6 -m pip wheel /io/ -w wheelhouse/
# python3.7 -m pip wheel /io/ -w wheelhouse/

# # Bundle external shared libraries into the wheels
# for whl in wheelhouse/*.whl; do
# python -m auditwheel repair "$whl" -w /io/wheelhouse/
# # python3.4 -m auditwheel repair "$whl" -w /io/wheelhouse/
# python3 -m auditwheel repair "$whl" -w /io/wheelhouse/
# # python3.6 -m auditwheel repair "$whl" -w /io/wheelhouse/
# # python3.7 -m auditwheel repair "$whl" -w /io/wheelhouse/
# done
# python3.7 -m pip wheel /io/ -w wheelhouse/
40 changes: 27 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,70 @@ version: 2
jobs:
manylinux64:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/pyskycoin
steps:
- run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin
- checkout
- setup_remote_docker:
version: 18.06.0-ce
- run: docker build --build-arg GO_ARCH=amd64 --build-arg ARCH=x86_64 --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test
# - run: docker build --build-arg IMAGE=debian --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/test/Dockerfile $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test
docker_layer_caching: true
- run: docker build --build-arg URL_DEPLOY=https://test.pypi.org/legacy/ --build-arg PYPI_USER=pyskycoin --build-arg PYPI_PASSWD="prerelease_0.X" --build-arg GO_ARCH=amd64 --build-arg ARCH=x86_64 --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test

manylinux32:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/pyskycoin
steps:
- run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin
- checkout
- setup_remote_docker:
version: 18.06.0-ce
- run: docker build --build-arg GO_ARCH=386 --build-arg ARCH=i686 --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test
# - run: docker build --build-arg IMAGE=i386/debian --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/test/Dockerfile $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test
docker_layer_caching: true
- run: docker build --build-arg URL_DEPLOY=https://test.pypi.org/legacy/ --build-arg PYPI_USER=pyskycoin --build-arg PYPI_PASSWD="prerelease_0.X" --build-arg GO_ARCH=386 --build-arg ARCH=i686 --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test

manylinuxarmv7:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/pyskycoin
steps:
- run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin
- checkout
- setup_remote_docker:
version: 18.06.0-ce
- run: docker build --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile-arm $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test
docker_layer_caching: true
- run: docker build --build-arg URL_DEPLOY=https://test.pypi.org/legacy/ --build-arg PYPI_USER=pyskycoin --build-arg PYPI_PASSWD="prerelease_0.X" --build-arg ARCH=armv7hf --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile-arm $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test

publish-github-release_32:
manylinuxaarch64:
docker:
- image: docker:18.06.0-ce-git
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/pyskycoin
steps:
- run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin
- checkout
- setup_remote_docker:
version: 18.06.0-ce
- run: if [[ $CIRCLE_TAG ]]; then docker build --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg QEMU_PLATFORM=raspberrypi3 --build-arg VERSION --file $GOPATH/src/github.com/skycoin/libskycoin/docker/images/circle/Dockerfile $GOPATH/src/github.com/skycoin/libskycoin -t skydev-deploy ; fi
docker_layer_caching: true
- run: docker build --build-arg URL_DEPLOY=https://test.pypi.org/legacy/ --build-arg PYPI_USER=pyskycoin --build-arg PYPI_PASSWD="prerelease_0.X" --build-arg ARCH=aarch64 --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile-arm $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test

deploy_all:
docker:
- image: circleci/golang:1.12
working_directory: $GOPATH/src/github.com/skycoin/pyskycoin
steps:
- run: mkdir -p $GOPATH/src/github.com/ $GOPATH/src/github.com/skycoin
- checkout
- setup_remote_docker:
version: 18.06.0-ce
docker_layer_caching: true
- run: cd $GOPATH/src/github.com/skycoin/pyskycoin/.circleci && bash deploy.sh

workflows:
version: 2
arm_test:
jobs:
- manylinux64
- manylinux32
- manylinuxarmv7
- publish-github-release_32
# - manylinuxaarch64 TODO: Not working deploy to test.pypi.org
- deploy_all
14 changes: 14 additions & 0 deletions .circleci/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -x

git --version

export VERSION="$(git describe --tags --exact-match HEAD)"

if [[ "$VERSION" ]]; then
docker build --build-arg VERSION --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg GO_ARCH=386 --build-arg ARCH=i686 --build-arg $PYPI_USER --build-arg $PYPI_PASSWD --build-arg URL_DEPLOY=https://pypi.org/legacy/ --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-deploy
docker build --build-arg VERSION --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg GO_ARCH=amd64 --build-arg ARCH=x86_64 --build-arg $PYPI_USER --build-arg $PYPI_PASSWD --build-arg URL_DEPLOY=https://pypi.org/legacy/ --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-deploy
docker build --build-arg VERSION --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg $PYPI_USER --build-arg $PYPI_PASSWD --build-arg ARCH=armv7hf --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile-arm $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test
docker build --build-arg VERSION --build-arg SHA1=$CIRCLE_SHA1 --build-arg GITHUB_OAUTH_TOKEN --build-arg PROJECT_USERNAME=$CIRCLE_PROJECT_USERNAME --build-arg PROJECT_REPONAME=$CIRCLE_PROJECT_REPONAME --build-arg $PYPI_USER --build-arg $PYPI_PASSWD --build-arg ARCH=aarch64 --file $GOPATH/src/github.com/skycoin/pyskycoin/docker/images/deploy/Dockerfile-arm $GOPATH/src/github.com/skycoin/pyskycoin -t skydev-test
fi
15 changes: 15 additions & 0 deletions .circleci/upload_pypi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -x

if [[ "$URL_DEPLOY" ]]; then

$TWINE_PATH upload -u ${PYPI_USER} -p ${PYPI_PASSWD} --skip-existing --repository-url ${URL_DEPLOY} /io/dist/*

else

$TWINE_PATH upload -u ${PYPI_USER} -p ${PYPI_PASSWD} --skip-existing /io/dist/*
go get github.com/tcnksm/ghr
ghr -t ${GITHUB_OAUTH_TOKEN} -u ${PROJECT_USERNAME} -r ${PROJECT_REPONAME} -c ${SHA1} ${VERSION} /io/dist/

fi
24 changes: 16 additions & 8 deletions docker/images/deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,29 @@ ARG ARCH
FROM quay.io/pypa/manylinux1_${ARCH}

ARG GO_ARCH
ARG URL_DEPLOY
ARG PYPI_USER
ARG PYPI_PASSWD

ARG GITHUB_OAUTH_TOKEN
ARG PROJECT_USERNAME
ARG PROJECT_REPONAME
ARG SHA1
ARG VERSION

ADD . /io

RUN ls /io
RUN yum install -y sudo pcre pcre-devel curl git --skip-broken
RUN mkdir -p "$HOME/bin"
ENV PIP "/opt/python/cp27-cp27m/bin/pip"
ENV PIP "/opt/python/cp37-cp37m/bin/pip"
ENV REPO_ROOT "/io/"
RUN curl -sL -o "$HOME/bin/gimme" https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
RUN chmod +x "$HOME/bin/gimme"
ENV PATH="${PATH}:$HOME/bin/gimme"
RUN eval "$(gimme 1.11)"

RUN $PIP install --upgrade pip setuptools tox-travis
RUN $PIP install -r "$REPO_ROOT/requirements.dev.txt"
RUN $PIP install -r "$REPO_ROOT/lib/skyapi/requirements.txt"
RUN $PIP install -r "$REPO_ROOT/lib/skyapi/test-requirements.txt"

RUN mkdir swig_build && \
cd swig_build && \
Expand All @@ -32,8 +38,8 @@ RUN mkdir swig_build && \
cd ../../ && \
rm -rf swig_build

RUN curl -sL -o "go1.11.3.linux-${GO_ARCH}.tar.gz" https://storage.googleapis.com/golang/go1.11.3.linux-${GO_ARCH}.tar.gz
RUN tar -zxf go1.11.3.linux-${GO_ARCH}.tar.gz -C /usr/local
RUN curl -sL -o "go1.11.12.linux-${GO_ARCH}.tar.gz" https://storage.googleapis.com/golang/go1.11.12.linux-${GO_ARCH}.tar.gz
RUN tar -zxf go1.11.12.linux-${GO_ARCH}.tar.gz -C /usr/local
ENV GOROOT=/usr/local/go
ENV PATH="${PATH}:/usr/local/go/bin"
ENV CGO_ENABLE=1
Expand All @@ -44,13 +50,15 @@ RUN go get github.com/gz-c/gox
RUN cd /io && git submodule update --init --recursive
RUN make -C /io/gopath/src/github.com/skycoin/libskycoin dep
RUN make -C /io build-libc
RUN make -C /io build-swig
RUN make -C /io build-swig
RUN mkdir -p /io/wheelhouse
RUN sh /io/.circleci/circle_wheels.sh

RUN ls /io/wheelhouse
RUN mkdir -p /io/dist
RUN cp -v /io/wheelhouse/* /io/dist
RUN $PIP install twine
RUN /opt/python/cp27-cp27m/bin/twine upload -u pyskycoin -p "prerelease_0.X" --skip-existing --repository-url https://test.pypi.org/legacy/ /io/dist/*
ENV TWINE_PATH=/opt/python/cp37-cp37m/bin/twine
RUN bash /io/.circleci/upload_pypi.sh

WORKDIR /io
Loading