Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a33519c
Use cmake3.
dilawar Jan 31, 2020
d54db91
Making things bit modular.
dilawar Jan 31, 2020
c19aa9b
Building with 2014.
dilawar Jan 31, 2020
d38b67d
Renamed.
dilawar Jan 31, 2020
b3f0ac3
Minor update to Dockerfile.
Jan 31, 2020
d4add5a
Docker build is successful.
Jan 31, 2020
94baa4e
Only python3 on OSX.
Apr 6, 2020
49a5799
pymoose deploy (forked)
dilawar Oct 11, 2020
2982136
builds from BhallaLab/moose-core
dilawar Oct 11, 2020
2ebc89a
Merge remote-tracking branch 'origin/devel'
dilawar Oct 11, 2020
a932a4b
temp commit.
dilawar Oct 11, 2020
46626ad
Fixes. Works in docker image now.
dilawar Oct 11, 2020
83e5c76
Disable py27 and py35
dilawar Oct 11, 2020
9ca3909
Merge branch 'master' of github.com:dilawar/pymoose-deploy
dilawar Oct 11, 2020
9c5c6ef
Updated a bit more.
dilawar Oct 11, 2020
d6525ba
Removed `sudo` as it has no effect on travis anymore.
dilawar Oct 11, 2020
b0babd0
Creating wheel
dilawar Oct 11, 2020
429798c
Update a little bit more.
dilawar Oct 12, 2020
2634f92
One more test.
dilawar Oct 12, 2020
26cf8ed
Updated a little bit more.
dilawar Oct 12, 2020
c511d6f
Use __token__
dilawar Oct 12, 2020
a087235
Using travis password.
dilawar Oct 12, 2020
5246d31
__token__ is set
dilawar Oct 12, 2020
5295a97
Fixed env variable name in dockerfile.
dilawar Oct 12, 2020
580fcf2
Fix wheel before uploading them to pypi
dilawar Oct 12, 2020
7301112
version bump
dilawar Oct 12, 2020
913d8b8
version is read from moose-core.
dilawar Oct 12, 2020
80b3d71
builds from master branch.
dilawar Oct 12, 2020
5f25252
Delete VERSION
dilawar Oct 12, 2020
f2066df
Update README.md
dilawar Oct 12, 2020
b0205bb
Using multiple xcode.
Oct 12, 2020
09df3e4
don't update.
Oct 12, 2020
89bb152
removed xcode9.
dilawar Oct 12, 2020
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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
sudo : required

matrix:
include:
- os: osx
osx_image: xcode12
- os : osx
osx_image: xcode11
- os: osx
osx_image: xcode10
- os: linux
sudo: required


services:
- docker
Expand Down
15 changes: 15 additions & 0 deletions BuildImages2014/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM quay.io/pypa/manylinux2014_x86_64
MAINTAINER Dilawar Singh <dilawar.s.rajput@gmail.com>

ARG PYPI_PASSWORD

MAINTAINER Dilawar Singh <dilawar.s.rajput@gmail.com>
ENV PATH=/usr/local/bin:$PATH
RUN yum install -y cmake3 wget vim git
WORKDIR /root
RUN curl -O https://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz && \
tar xvf gsl*.tar.gz && \
cd gsl* && CFLAGS=-fPIC ./configure --enable-static && make $MAKEOPTS && make install
COPY build_wheels_linux.sh .
# RUN ./build_wheels_linux.sh
CMD [ "bash" ]
7 changes: 7 additions & 0 deletions BuildImages2014/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
IMAGE := bhallalab/manylinux

all : Dockerfile
docker build -t $(IMAGE) .

run :
docker run -it $(IMAGE) bash
93 changes: 93 additions & 0 deletions BuildImages2014/build_wheels_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#!/usr/bin/env bash

set -e -x

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NPROC=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
NUM_WORKERS=$((NPROC+1))

if [ "$TRAVIS" == "true" ]; then
NUM_WORKERS=3
fi
MAKEOPTS="-j$NUM_WORKERS"

# Place to store wheels.
WHEELHOUSE=${1-$HOME/wheelhouse}
echo "Path to store wheels : $WHEELHOUSE"
mkdir -p $WHEELHOUSE

# tag on github and revision number. Make sure that they are there.
[ -f ./BRANCH ] || echo "master" >> ./BRANCH
BRANCH=$(cat ./BRANCH)
VERSION="3.2.0.dev$(date +%Y%m%d)"

echo "Building version $REVISION, from branch $BRANCH"

GSL_STATIC_LIBS="/usr/local/lib/libgsl.a;/usr/local/lib/libgslcblas.a"

if [ ! -f /usr/local/lib/libgsl.a ]; then
#wget --no-check-certificate ftp://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz
curl -O https://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz
tar xvf gsl-2.4.tar.gz
cd gsl-2.4
CFLAGS=-fPIC ./configure --enable-static && make $MAKEOPTS
make install
cd ..
fi

MOOSE_SOURCE_DIR=$SCRIPT_DIR/moose-core

if [ ! -d $MOOSE_SOURCE_DIR ]; then
git clone https://github.com/dilawar/moose-core --depth 10 --branch $BRANCH
fi

# Try to link statically.
CMAKE=/usr/bin/cmake3

# Build wheels here.
for PYV in 38 37m 36m; do
PYDIR=/opt/python/cp${PYV}-cp${PYV}
PYVER=$(basename $PYDIR)
mkdir -p $PYVER
(
cd $PYVER
echo "Building using $PYDIR in $PYVER"
PYTHON=$(ls $PYDIR/bin/python?.?)
$PYTHON -m pip install numpy twine
$PYTHON -m pip install matplotlib
$PYTHON -m pip install twine
$PYTHON -m pip uninstall pymoose -y || echo "No pymoose"
git pull || echo "Failed to pull $BRANCH"
$CMAKE -DPYTHON_EXECUTABLE=$PYTHON \
-DGSL_STATIC_LIBRARIES=$GSL_STATIC_LIBS \
-DVERSION_MOOSE=$VERSION \
${MOOSE_SOURCE_DIR}
make $MAKEOPTS

# Now build bdist_wheel
cd python
cp setup.cmake.py setup.py
$PYTHON -m pip wheel . -w $WHEELHOUSE
echo "Content of WHEELHOUSE"
ls -lh $WHEELHOUSE/*.whl
)
done

# List all wheels.
ls -lh $WHEELHOUSE/*.whl

# now check the wheels.
for whl in $WHEELHOUSE/pymoose*.whl; do
auditwheel show "$whl"
done

echo "Installing before testing ... "

/opt/python/cp36-cp36/bin/pip install $WHEELHOUSE/pymoose-$VERSION-py3-none-any.whl
/opt/python/cp38-cp38/bin/pip install $WHEELHOUSE/pymoose-$VERSION-py3-none-any.whl
for PYV in 38 36; do
/opt/python/cp${PYV}-cp${PYV}/bin/pip install $WHEELHOUSE/pymoose-$VERSION-py3-none-any.whl
PYDIR=/opt/python/cp${PYV}-cp${PYV}
PYTHON=$(ls $PYDIR/bin/python?.?)
$PYTHON -c 'import moose; print(moose.__version__)'
done
23 changes: 17 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# This docker image is based on bhallalab/manylinux2010 which is
# ./hub.docker.com/wheel/Makefile
FROM bhallalab/manylinux2010:latest
FROM quay.io/pypa/manylinux2010_x86_64
MAINTAINER Dilawar Singh <dilawar.s.rajput@gmail.com>

ARG PYMOOSE_PYPI_PASSWORD
ENV PYMOOSE_PYPI_PASSWORD=$PYMOOSE_PYPI_PASSWORD

RUN yum install -y cmake3 git tree && rm -rf /var/cache/yum/*

ENV PATH /usr/local/bin:$PATH
RUN ln -s /usr/bin/cmake3 /usr/local/bin/cmake

WORKDIR /root
COPY ./BRANCH .

RUN curl -O https://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz \
&& tar xvf gsl-2.4.tar.gz \
&& cd gsl-2.4 \
&& CFLAGS=-fPIC ./configure --enable-static && make $MAKEOPTS \
&& make install

COPY ./build_wheels_linux.sh .
RUN PYMOOSE_PYPI_PASSWORD=$PYMOOSE_PYPI_PASSWORD ./build_wheels_linux.sh
RUN ./build_wheels_linux.sh
CMD [ "bash", "-c", "./build_wheels_linux.sh"]
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
VERSION:=$(shell cat ./VERSION)

all : wheels

DOCKERFILE:="bhallalab/pymoose_wheels_$(USER):$(VERSION)"
DOCKERFILE:="dilawars/pymoose-manylinux2010:latest"

wheels : ./Dockerfile ./build_wheels_linux.sh
mkdir -p $(HOME)/wheelhouse
docker build \
-t $(DOCKERFILE) \
docker build -t $(DOCKERFILE) \
--build-arg PYMOOSE_PYPI_PASSWORD=$(PYMOOSE_PYPI_PASSWORD) .

run:
docker run -it $(DOCKERFILE) /bin/bash
run : ./Dockerfile
docker run -it quay.io/pypa/manylinux2010_x86_64

upload:
docker push $(DOCKERFILE)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/BhallaLab/deploy.svg?branch=master)](https://travis-ci.org/BhallaLab/deploy)
[![Build Status](https://travis-ci.org/dilawar/pymoose-deploy.svg?branch=master)](https://travis-ci.org/dilawar/pymoose-deploy)

This repository contains all scripts required to build and release pymoose.

Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

89 changes: 34 additions & 55 deletions build_wheels_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ set -e -x

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NPROC=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
NUM_WORKERS=$((NPROC))
NUM_WORKERS=$((NPROC-1))

if [ "$TRAVIS" == "true" ]; then
NUM_WORKERS=2
fi
MAKEOPTS="-j$NUM_WORKERS"

# Place to store wheels.
Expand All @@ -14,8 +18,8 @@ echo "Path to store wheels : $WHEELHOUSE"
mkdir -p $WHEELHOUSE

# tag on github and revision number. Make sure that they are there.
[ -f ./BRANCH ] || echo "master" > ./BRANCH
BRANCH=$(cat ./BRANCH)
VERSION="3.2dev$(date +%Y%m%d)"

# Create a test script and upload.
TESTFILE=/tmp/test.py
Expand All @@ -27,52 +31,45 @@ moose.reinit()
moose.start( 1 )
EOF


echo "Building version $VERSION, from branch $BRANCH"

if [ ! -f /usr/local/lib/libgsl.a ]; then
#wget --no-check-certificate ftp://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz
curl -O https://ftp.gnu.org/gnu/gsl/gsl-2.4.tar.gz
tar xvf gsl-2.4.tar.gz
cd gsl-2.4
CFLAGS=-fPIC ./configure --enable-static && make $MAKEOPTS
make install

# GSL will be linked statically.
GSL_STATIC_LIBS="/usr/local/lib/libgsl.a;/usr/local/lib/libgslcblas.a"

cd ..
fi

MOOSE_SOURCE_DIR=$SCRIPT_DIR/moose-core
if [ -d $MOOSE_SOURCE_DIR ]; then
cd $MOOSE_SOURCE_DIR && git checkout $BRANCH && git pull origin $BRANCH
rm -rf dist
else
git clone https://github.com/dilawar/moose-core $MOOSE_SOURCE_DIR \
--depth 1 --branch $BRANCH

if [ ! -d $MOOSE_SOURCE_DIR ]; then
git clone https://github.com/dilawar/moose-core --depth 10 --branch $BRANCH
fi

# Try to link statically.
GSL_STATIC_LIBS="/usr/local/lib/libgsl.a;/usr/local/lib/libgslcblas.a"
CMAKE=/usr/bin/cmake3

# Build wheels here.
PY27=$(ls /opt/python/cp27-cp27m/bin/python?.?)
PY35=$(ls /opt/python/cp35-cp35m/bin/python?.?)
PY36=$(ls /opt/python/cp36-cp36m/bin/python?.?)
PY37=$(ls /opt/python/cp37-cp37m/bin/python?.?)
PY38=$(ls /opt/python/cp38-cp38/bin/python?.?)

for PYTHON in $PY38 $PY37 $PY36 $PY35 $PY27; do
# install latest cmake using pip and its location to PATH
$PY38 -m pip install cmake --user
$PY38 -m pip install twine auditwheel

export PATH=/opt/python/cp38-cp38/bin:/root/.local/bin:$PATH

for PYTHON in $PY38 $PY37 $PY36; do
echo "========= Building using $PYTHON ..."
$PYTHON -m pip install pip setuptools --upgrade
if [[ "$PYV" -eq "27" ]]; then
$PYTHON -m pip install numpy==1.15
$PYTHON -m pip install matplotlib==2.2.3
else
$PYTHON -m pip install numpy twine
$PYTHON -m pip install matplotlib
fi

$PYTHON -m pip install numpy twine
$PYTHON -m pip install matplotlib
$PYTHON -m pip install twine

# Removing existing pymoose if any.
$PYTHON -m pip uninstall pymoose -y || echo "No pymoose"

Expand All @@ -82,44 +79,26 @@ for PYTHON in $PY38 $PY37 $PY36 $PY35 $PY27; do
$PYTHON setup.py bdist_wheel --skip-build
(
echo "Install and test this wheel"
# NOTE: Not sure why I have to do this. But cant install wheel from build
# directory.
auditwheel repair $MOOSE_SOURCE_DIR/dist/*.whl -w $WHEELHOUSE/
$PYTHON -m pip install $MOOSE_SOURCE_DIR/dist/*.whl || echo "Failed to install"
cd /tmp
$PYTHON -m pip install $MOOSE_SOURCE_DIR/dist/*.whl
$PYTHON $TESTFILE
mv $MOOSE_SOURCE_DIR/dist/*.whl $WHEELHOUSE
rm -rf $MOOSE_SOURCE_DIR/dist/*.whl
)
done


# List all wheels.
ls -lh $WHEELHOUSE/*.whl

# now check the wheels.
for whl in $WHEELHOUSE/pymoose*.whl; do
auditwheel show "$whl"
# Fix the tag and remove the old wheel.
auditwheel repair "$whl" -w $WHEELHOUSE && rm -f "$whl"
done

# upload to PYPI.
$PY38 -m pip install twine
TWINE="$PY38 -m twine"
for whl in `find $WHEELHOUSE -name "pymoose*.whl"`; do
# If successful, upload using twine.
if [ -n "$PYMOOSE_PYPI_PASSWORD" ]; then
$TWINE upload $whl \
--user bhallalab \
--password $PYMOOSE_PYPI_PASSWORD --skip-existing
else
echo "PYPI password is not set"
fi
done
$PY38 -m twine upload $WHEELHOUSE/*.whl \
--user __token__ --password $PYMOOSE_PYPI_PASSWORD \
--skip-existing

# Now upload the source distribution.
set -e
cd $MOOSE_SOURCE_DIR
rm -rf dist
$PY38 setup.py sdist
$TWINE upload dist/pymoose*.tar.gz \
--user bhallalab --password $PYMOOSE_PYPI_PASSWORD \
--skip-existing || echo "Failed to upload source distribution."
rm -rf dist && \
$PY38 setup.py sdist && \
$PY38 -m twine upload dist/pymoose*.tar.gz \
--user __token__ --password $PYMOOSE_PYPI_PASSWORD \
--skip-existing || echo "Failed to upload source distribution."
Loading