From 327f6825b8ccb32ad7b2a30e540ee9f57f882fe4 Mon Sep 17 00:00:00 2001 From: Jonathan Karr Date: Mon, 20 Sep 2021 15:54:58 -0400 Subject: [PATCH] build: added polling for PySCeS release to PyPI, updated Dockerfile to install PySCeS from PyPI --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++--------- .gitignore | 1 + Dockerfile | 20 ++++++++++++++-- Dockerfile-base | 21 ---------------- biosimulators_pysces/_version.py | 2 +- 5 files changed, 50 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63cb047..ea80b3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,6 +53,16 @@ jobs: ############################################# ## Update the version of the simulator ############################################# + - name: Check that the version of the simulator is available from PyPI + if: github.event.inputs.simulatorVersion + uses: emilioschepis/wait-for-endpoint@v1.0.0 + with: + url: https://pypi.org/pypi/pysces/${{ github.event.inputs.simulatorVersion }}/json + method: GET + expected-status: 200 + timeout: 3600000 # 1 hr + interval: 60000 # 1 min + - name: Update the version of the simulator if: github.event.inputs.simulatorVersion run: | @@ -127,17 +137,26 @@ jobs: python -m pip install git+https://github.com/modelon-community/Assimulo.git@Assimulo-${ASSIMULO_VERSION} - name: Install PySCeS - env: - PYSCES_REVISION: 470cd0b8afa4c14721a2b2bc00d4c71d80603801 - run: | - sudo apt-get update -y - sudo apt-get install -y --no-install-recommends \ - git \ - gcc \ - gfortran \ - libgfortran5 - - python -m pip install git+https://github.com/PySCeS/pysces.git@${PYSCES_REVISION} + uses: nick-invision/retry@v2 + with: + timeout_minutes: 20 + retry_on: error + retry_wait_seconds: 300 + max_attempts: 4 + command: | + sudo apt-get update -y + sudo apt-get install -y --no-install-recommends jq + + SIMULATOR_VERSION=$(jq -r '.version' biosimulators.json) + + sudo apt-get update -y + sudo apt-get install -y --no-install-recommends \ + git \ + gcc \ + gfortran \ + libgfortran5 + + python -m pip install "pysces==${SIMULATOR_VERSION}" # install package - name: Install the package diff --git a/.gitignore b/.gitignore index 4eb7a01..e7d7f93 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ __pycache__/ dist/ build/ _pystmptmp*_parsetab.py +*-sbml_conversion_errors.txt # coverage files htmlcov/ diff --git a/Dockerfile b/Dockerfile index eaf3b1c..777f51c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Base OS FROM ghcr.io/biosimulators/biosimulators_pysces/pysces_base:latest -ARG VERSION=0.1.21 +ARG VERSION=0.1.22 ARG SIMULATOR_VERSION="1.0.0" # metadata @@ -29,6 +29,23 @@ LABEL \ extra.identifiers.biotools="pysces" \ maintainer="BioSimulators Team " +# install PySCeS +RUN apt-get update -y \ + && apt-get install -y --no-install-recommends \ + git \ + gcc \ + gfortran \ + libgfortran5 \ + \ + && pip install "pysces[all]==${SIMULATOR_VERSION}" \ + \ + && apt-get remove -y \ + git \ + gcc \ + gfortran \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists + # Copy code for command-line interface into image and install it COPY . /root/Biosimulators_PySCeS RUN pip install /root/Biosimulators_PySCeS \ @@ -40,7 +57,6 @@ RUN pip install /root/Biosimulators_PySCeS \ && cp /root/Biosimulators_PySCeS/.pys_usercfg.Dockerfile.ini /Pysces/.pys_usercfg.ini \ && cp /root/Biosimulators_PySCeS/.pys_usercfg.Dockerfile.ini /root/Pysces/.pys_usercfg.ini \ && rm -rf /root/Biosimulators_PySCeS -RUN pip install "pysces==${SIMULATOR_VERSION}" # supported environment variables ENV ALGORITHM_SUBSTITUTION_POLICY=SIMILAR_VARIABLES \ diff --git a/Dockerfile-base b/Dockerfile-base index 4ecb564..6f6cee8 100644 --- a/Dockerfile-base +++ b/Dockerfile-base @@ -54,27 +54,6 @@ RUN apt-get update -y \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists -# install Python requirements for PySCeS -RUN pip install ipyparallel - -# install PySCeS -ARG PYSCES_REVISION=7478a05bc4480e580fabfe89acb259274ced7f6c -RUN apt-get update -y \ - && apt-get install -y --no-install-recommends \ - git \ - gcc \ - gfortran \ - libgfortran5 \ - \ - && pip install git+https://github.com/PySCeS/pysces.git@${PYSCES_REVISION} \ - \ - && apt-get remove -y \ - git \ - gcc \ - gfortran \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists - # fonts for matplotlib RUN apt-get update -y \ && apt-get install -y --no-install-recommends libfreetype6 \ diff --git a/biosimulators_pysces/_version.py b/biosimulators_pysces/_version.py index dccb61c..872472a 100644 --- a/biosimulators_pysces/_version.py +++ b/biosimulators_pysces/_version.py @@ -1 +1 @@ -__version__ = '0.1.21' +__version__ = '0.1.22'