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

Create google colab 'sandbox' environment for Biosimulators interaction #5

Draft
wants to merge 20 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
41ff0d3
adjusted Dockerfile for wheel build crash and added notebook(to be a …
AlexPatrie Apr 26, 2023
7382e40
removed sudo from Dockerfile
AlexPatrie Apr 26, 2023
b76f919
Adjusted upper bounds of biosimulator-utils in requirements
AlexPatrie Apr 27, 2023
7aa872d
Added upgrade pip command
AlexPatrie Apr 27, 2023
cf90c2e
Added upgrade setuptools wheel command to Dockerfile
AlexPatrie Apr 27, 2023
a70bd90
Adding no binary on pip install in Dockerfile
AlexPatrie Apr 27, 2023
22ea0bf
Added no use PEP517 header to pip install command
AlexPatrie Apr 27, 2023
17a5bbd
manually installing evalidate in Dockerfile before requirements install
AlexPatrie Apr 27, 2023
134212d
pytest.ini file added to filter out Import Error
AlexPatrie Apr 27, 2023
7ca314b
fixed syntax error
AlexPatrie Apr 27, 2023
c2fa3d8
minor adjustments
AlexPatrie Apr 27, 2023
3160d46
added setup.cfg file to assert glpk wheel build
AlexPatrie Apr 27, 2023
6f13bd4
Added build-essential and libglpk-dev to CI file
AlexPatrie Apr 27, 2023
ba2e95e
adjusted setup file for wheel build
AlexPatrie Apr 27, 2023
ae75d3f
added specs for glpk wheel that are PEP517 compliant
AlexPatrie Apr 27, 2023
41c3471
adjusted pytest file to Ignore
AlexPatrie Apr 27, 2023
538ed02
adding nbconvert to test requirements
AlexPatrie Apr 27, 2023
08346bb
minor adjustment
AlexPatrie Apr 27, 2023
21da003
Added Colab badge to README along with corresponding wording
AlexPatrie May 1, 2023
5583e2d
Enabled sandbox mode which disables editing as well as offline access.
AlexPatrie May 1, 2023
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
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
- name: Checkout repository
uses: actions/[email protected]

# Install dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libglpk-dev build-essential

# Build Docker image
- id: get-timestamp
name: Get timestamp
Expand All @@ -37,14 +43,14 @@ jobs:
uses: whoan/docker-build-with-cache-action@v5
with:
dockerfile: Dockerfile
build_extra_args: "--compress=true --label org.opencontainers.image.revision=${{github.sha}} --label org.opencontainers.image.created=${{steps.get-timestamp.outputs.timestamp}}"
build_extra_args: '--compress=true --label org.opencontainers.image.revision=${{github.sha}} --label org.opencontainers.image.created=${{steps.get-timestamp.outputs.timestamp}}'
registry: ghcr.io
stages_image_name: biosimulators/tutorials-stages
image_name: biosimulators/tutorials-stages
image_tag: ${{github.sha}}
push_image_and_stages: true
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: "${{ secrets.DOCKER_REGISTRY_TOKEN }}"
password: '${{ secrets.DOCKER_REGISTRY_TOKEN }}'

- name: Label Docker image
run: |
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ LABEL \
org.opencontainers.image.vendor="BioSimulators Team"

COPY requirements.txt /tmp/requirements.txt
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools wheel
RUN pip install -r /tmp/requirements.txt \
&& rm /tmp/requirements.txt \
&& pip uninstall -y ipyparallel
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1aI7Z6ZBcQzOc9PJllW9N9oeTcFtXfhTd#offline=true&sandboxMode=true)

[![Binder](https://mybinder.org/badge_logo.svg)](https://tutorial.biosimulators.org/)
[![All Contributors](https://img.shields.io/github/all-contributors/biosimulators/Biosimulators_tutorials/HEAD)](#contributors-)

![Logo](https://raw.githubusercontent.com/biosimulations/Biosimulations/dev/libs/shared/assets/src/assets/images/biosimulators-logo/logo-white.svg)

# BioSimulators tutorials

This repository contains Jupyter notebooks with tutorials for the Python APIs for the simulation tools registered with BioSimulators and a Jupyter notebook server for running the notebooks.
This repository contains Jupyter notebooks with tutorials for the Python APIs for the simulation tools registered with BioSimulators and a Jupyter notebook server for running the notebooks. NEW: As an alternative to the Jupyter Notebooks and relative Jupyter Notebook server, we have added a [Google Colab Notebook](https://colab.research.google.com/drive/1aI7Z6ZBcQzOc9PJllW9N9oeTcFtXfhTd#offline=true&sandboxMode=true) for users that are more comfortable with a shareable, annotatable "sandbox environment". Complete with the required dependencies, input data, and explicitly-defined methods that are essential to interacting with `Biosimulators`, this Google Colab notebook serves as "click and play" experience.

The tutorials are located in the [`tutorials`](tutorials) subdirectory. The [README](tutorials/README.md) in this directory summarizes the content of the tutorials.

## Getting started

### Running the tutorials online with Google Colab (web-based, minimal setup)

Simply open [the Colab notebook](https://colab.research.google.com/drive/1aI7Z6ZBcQzOc9PJllW9N9oeTcFtXfhTd#offline=true&sandboxMode=true) in your browser or click on the above Colab badge.

### Running the tutorials online with Binder
The easiest way to run the tutorials is with Binder. Simply open https://tutorial.biosimulators.org/ in your browser.

Simply open https://tutorial.biosimulators.org/ in your browser or click on the above Binder Badge.

### Running the tutorials on your own machine

Run the following command to download the tutorials:

```
docker pull ghcr.io/biosimulators/tutorials
```

Run the following command to launch a Jupyter notebook server at http://localhost:8888 for the tutorials in this repository:

```
docker run -it --rm -p 8888:8888 ghcr.io/biosimulators/tutorials jupyter notebook --ip=0.0.0.0 --port=8888
```

Alternatively, run the following command to launch a Jupyter lab server at http://localhost:8888 for the tutorials in this repository:

```
docker run -it --rm -p 8888:8888 ghcr.io/biosimulators/tutorials jupyter lab --ip=0.0.0.0 --port=8888
```
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[build-system]
requires = ["setuptools", "wheel", "cython"]
build-backend = "setuptools.build_meta"

[tool.cythondialect]
include_dirs = ["include"]

[tool.glpk]
include_dirs = ["include"]
library_dirs = ["lib"]
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
filterwarnings =
ignore::ImportWarning:evalidate
1 change: 1 addition & 0 deletions requirements.tests.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest
nbmake
nbconvert
pytest-forked
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ biosimulators-cbmpy
biosimulators-copasi
biosimulators-cobrapy
biosimulators-tellurium
biosimulators-utils[sbml,logging,containers]>=0.1.152
biosimulators-utils[sbml,logging,containers]>=0.1.175
ipython
kisao
numpy
Expand Down