Skip to content

Commit

Permalink
build: added polling for PySCeS release to PyPI, updated Dockerfile t…
Browse files Browse the repository at this point in the history
…o install PySCeS from PyPI
  • Loading branch information
jonrkarr committed Sep 20, 2021
1 parent 7561e9f commit 327f682
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 35 deletions.
41 changes: 30 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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: |
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ __pycache__/
dist/
build/
_pystmptmp*_parsetab.py
*-sbml_conversion_errors.txt

# coverage files
htmlcov/
Expand Down
20 changes: 18 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -29,6 +29,23 @@ LABEL \
extra.identifiers.biotools="pysces" \
maintainer="BioSimulators Team <[email protected]>"

# 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 \
Expand All @@ -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 \
Expand Down
21 changes: 0 additions & 21 deletions Dockerfile-base
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion biosimulators_pysces/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.21'
__version__ = '0.1.22'

0 comments on commit 327f682

Please sign in to comment.