Skip to content

Commit

Permalink
New CI system (#123)
Browse files Browse the repository at this point in the history
* Drone CI -> Woodpecker CI
  • Loading branch information
bjodah authored Apr 24, 2024
1 parent 21c6966 commit 9c6dbb9
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 123 deletions.
15 changes: 8 additions & 7 deletions .ci/run_ci.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -xe
#!/bin/bash

set -u
set -eux
export PKG_NAME=$1
SUNDBASE=$2
set +u
Expand All @@ -10,19 +10,20 @@ if [ ! -e "$SUNDBASE/include/sundials/sundials_config.h" ]; then
exit 1
fi

# REPO_TEMP_DIR="$(mktemp -d)"
# trap 'rm -rf -- "$REPO_TEMP_DIR"' EXIT
# cp -ra . "$REPO_TEMP_DIR/."
# cd "$REPO_TEMP_DIR"

mkdir -p $HOME/.config/pip/
echo -e "[global]\nno-cache-dir = false\ndownload-cache = $(pwd)/ci_cache/pip_cache" >$HOME/.config/pip/pip.conf
echo -e "[global]\nno-cache-dir = false\ndownload-cache = $CI_WORKSPACE/cache-ci/pip_cache" >$HOME/.config/pip/pip.conf
python3 -m pip install symcxx pysym # unofficial backends, symengine is tested in the conda build

# (cd ./tmp/pycvodes;
SUND_CFLAGS="-isystem $SUNDBASE/include $CFLAGS"
SUND_LDFLAGS="-Wl,--disable-new-dtags -Wl,-rpath,$SUNDBASE/lib -L$SUNDBASE/lib $LDFLAGS"
CFLAGS=$SUND_CFLAGS LDFLAGS=$SUND_LDFLAGS python3 -m pip install pycvodes
git clean -xfd # -e tmp/

# export CPATH=$SUNDBASE/include
# export LIBRARY_PATH=$SUNDBASE/lib
# export LD_LIBRARY_PATH=$SUNDBASE/lib

python3 setup.py sdist
PKG_VERSION=$(python3 setup.py --version)
Expand Down
98 changes: 0 additions & 98 deletions .drone.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "external/anyode"]
path = external/anyode
url = git://github.com/bjodah/anyode
url = https://github.com/bjodah/anyode
76 changes: 76 additions & 0 deletions .woodpecker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
when:
- event: [push]

steps:

- name: restore-cache
image: bjodah/bjodahimg20dot:21.8.a
commands:
- curl ftp://${CI_REPO_NAME}:$${ARTIFACTS_PASS}@$${FTP_SERVER}/cache/cache-ci.tar | tar -C / x || mkdir -p $CI_WORKSPACE/cache-ci/pip_cache
secrets: [ ARTIFACTS_PASS, FTP_SERVER ]
when:
- event: push
repo: bjodah/pyodesys

- name: test-sund-5.7.0-rel
depends_on: restore-cache
image: bjodah/bjodahimg20dot:21.8.a
environment:
- CC=gcc-11
- CXX=g++-11
- OMP_NUM_THREADS=1
- ANYODE_NUM_THREADS=2
- CPLUS_INCLUDE_PATH=/usr/include/suitesparse:/opt/boost-1.77.0/include
- LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
- LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
- SUNDBASE=/opt/sundials-5.7.0-release
commands:
- cp -ra $CI_WORKSPACE /tmp/test-sund-5.7.0-rel
- cd /tmp/test-sund-5.7.0-rel
- python3 -m pip install --cache-dir $CI_WORKSPACE/cache-ci/pip_cache --upgrade-strategy=eager --upgrade cython https://github.com/bjodah/pycompilation/archive/master.tar.gz
- bash -c "ulimit -v 2048000; .ci/run_ci.sh pyodesys $SUNDBASE"
- ./scripts/prepare_deploy.sh
- bash -c '[[ $(python3 setup.py --version) =~ ^[0-9]+.* ]]'
- cp -ra /tmp/test-sund-5.7.0-rel/deploy $CI_WORKSPACE/

- name: test-sund-5.7.0-extended
depends_on: restore-cache
image: bjodah/bjodahimg20dot:21.8.a
environment:
- CC=gcc-11
- CXX=g++-11
- OMP_NUM_THREADS=1
- ANYODE_NUM_THREADS=2
- CPLUS_INCLUDE_PATH=/usr/include/suitesparse:/opt/boost-1.77.0/include
- LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
- LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
- SUNDBASE=/opt/sundials-5.7.0-extended
- PYCVODES_NO_LAPACK=1
- PYCVODES_NO_KLU=1
commands:
- cp -ra $CI_WORKSPACE/ /tmp/test-sund-5.7.0-extended
- cd /tmp/test-sund-5.7.0-extended
- python3 -m pip install --cache-dir $CI_WORKSPACE/cache-ci/pip_cache --upgrade-strategy=eager --upgrade cython
- bash -c "ulimit -v 2048000; .ci/run_ci.sh pyodesys $SUNDBASE"
- ./scripts/grep-for-merge-blocking-token.sh
- ./scripts/grep-for-binary-data.sh

- name: rebuild-cache
image: bjodah/bjodahimg20dot:21.8.a
commands:
- find $CI_WORKSPACE/cache-ci/ -type f -mtime +90 -exec rm {} \;
- tar cf cache-ci.tar $CI_WORKSPACE/cache-ci/
- curl -T cache-ci.tar ftp://${CI_REPO_NAME}:$${ARTIFACTS_PASS}@$${FTP_SERVER}/cache/
secrets: [ ARTIFACTS_PASS, FTP_SERVER ]
depends_on:
- test-sund-5.7.0-rel

- name: deploy-public-html
image: bjodah/bjodahimg20dot:21.8.a
commands:
- tar -C deploy/public_html -czf ${CI_REPO_NAME}-${CI_COMMIT_BRANCH}.tar.gz .
- curl -T ${CI_REPO_NAME}-${CI_COMMIT_BRANCH}.tar.gz ftp://${CI_REPO_NAME}:$${ARTIFACTS_PASS}@$${FTP_SERVER}/public_html/
secrets: [ ARTIFACTS_PASS, FTP_SERVER ]
depends_on:
- test-sund-5.7.0-rel

23 changes: 7 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
pyodesys
========

.. image:: http://hera.physchem.kth.se:8090/api/badges/bjodah/pyodesys/status.svg
:target: http://hera.physchem.kth.se:8090/bjodah/pyodesys
:alt: Build status on Drone
.. image:: https://circleci.com/gh/bjodah/pyodesys.svg?style=svg
:target: https://circleci.com/gh/bjodah/pyodesys
:alt: Build status on CircleCI
.. image:: http://hackspett.bjodah.se/api/badges/8/status.svg
:target: http://hackspett.bjodah.se/repos/8
:alt: Build status on Woodpecker CI
.. image:: https://img.shields.io/pypi/v/pyodesys.svg
:target: https://pypi.python.org/pypi/pyodesys
:alt: PyPI version
.. image:: https://img.shields.io/badge/python-3.7,3.8-blue.svg
:target: https://www.python.org/
:alt: Python version
.. image:: https://img.shields.io/pypi/l/pyodesys.svg
:target: https://github.com/bjodah/pyodesys/blob/master/LICENSE
:alt: License
.. image:: http://img.shields.io/badge/benchmarked%20by-asv-green.svg?style=flat
:target: http://hera.physchem.kth.se/~pyodesys/benchmarks
:alt: airspeedvelocity
.. image:: http://hera.physchem.kth.se/~pyodesys/branches/master/htmlcov/coverage.svg
:target: http://hera.physchem.kth.se/~pyodesys/branches/master/htmlcov
.. image:: http://artifacts.bjodah.se/pyodesys/branches/master/htmlcov/coverage.svg
:target: http://artifacts.bjodah.se/pyodesys/branches/master/htmlcov
:alt: coverage
.. image:: http://joss.theoj.org/papers/10.21105/joss.00490/status.svg
:target: https://doi.org/10.21105/joss.00490
Expand Down Expand Up @@ -63,7 +54,7 @@ Documentation
Auto-generated API documentation for latest stable release is found here:
`<https://bjodah.github.io/pyodesys/latest>`_
(and the development version for the current master branch is found here:
`<http://hera.physchem.kth.se/~pyodesys/branches/master/html>`_).
`<http://artifacts.bjodah.se/pyodesys/branches/master/html>`_).


Installation
Expand Down Expand Up @@ -227,7 +218,7 @@ further reduced by a factor equal to the number of cores of your CPU (number of
the environment variable ``ANYODE_NUM_THREADS``).

For further examples, see `examples/ <https://github.com/bjodah/pyodesys/tree/master/examples>`_, and rendered
jupyter notebooks here: `<http://hera.physchem.kth.se/~pyodesys/branches/master/examples>`_
jupyter notebooks here: `<http://artifacts.bjodah.se/pyodesys/branches/master/examples>`_

Run notebooks using binder
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion pyodesys/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _get_ny_nparams_from_kw(ny, nparams, kwargs):


def _get_lin_invar_mtx(lin_invar, be, ny, names=None):
if lin_invar is None or lin_invar == []:
if lin_invar is None or len(lin_invar) == 0:
return None
else:
if isinstance(lin_invar[0], dict) and names:
Expand Down

0 comments on commit 9c6dbb9

Please sign in to comment.