Skip to content

Commit 7901387

Browse files
committed
chore: initial commit
0 parents  commit 7901387

File tree

11 files changed

+2158
-0
lines changed

11 files changed

+2158
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Dockerfile
2+
README.md

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Build and push Docker image
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
buildAndPushImage:
8+
name: Build and push Docker image
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/[email protected]
14+
15+
# Build Docker image
16+
- id: get-timestamp
17+
name: Get timestamp
18+
run: |
19+
TIMESTAMP=$(date --rfc-3339=seconds | sed 's/ /T/')
20+
echo "::set-output name=timestamp::$TIMESTAMP"
21+
22+
- name: Build Docker image
23+
uses: whoan/docker-build-with-cache-action@v5
24+
with:
25+
dockerfile: Dockerfile
26+
build_extra_args: "--compress=true --label org.opencontainers.image.revision=${{github.sha}} --label org.opencontainers.image.created=${{steps.get-timestamp.outputs.timestamp}}"
27+
registry: ghcr.io
28+
stages_image_name: biosimulators/biosimulators-tutorials-stages
29+
image_name: biosimulators/biosimulators-tutorials-stages
30+
image_tag: ${{github.sha}}
31+
push_image_and_stages: true
32+
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
33+
password: "${{ secrets.DOCKER_REGISTRY_TOKEN }}"
34+
35+
- name: Label Docker image
36+
run: |
37+
docker image tag ghcr.io/biosimulators/biosimulators-tutorials-stages:${{github.sha}} ghcr.io/biosimulators/biosimulators-tutorials:${{github.sha}}
38+
docker image tag ghcr.io/biosimulators/biosimulators-tutorials-stages:${{github.sha}} ghcr.io/biosimulators/biosimulators-tutorials:latest
39+
40+
# Test tutorials
41+
- name: Test tutorials
42+
run: |
43+
cwd=$(pwd)
44+
docker run \
45+
--rm \
46+
--entrypoint bash \
47+
--mount type=bind,source=${cwd},target=/app/Biosimulators_tutorials \
48+
ghcr.io/biosimulators/biosimulators-tutorials:latest \
49+
-c "
50+
pipenv run pip install nbmake pytest pytest-forked
51+
/bin/bash /xvfb-startup.sh pipenv run python -m pytest --forked --verbose --nbmake Biosimulators_tutorials/tutorials/
52+
"
53+
54+
# Get version number
55+
- id: get-version-number
56+
name: Get version number
57+
if: startsWith(github.ref, 'refs/tags/')
58+
env:
59+
TAG: ${{ github.ref }}
60+
run: |
61+
version="${TAG/refs\/tags\//}"
62+
echo "::set-output name=version::$version"
63+
64+
# Create GitHub release
65+
- name: Create GitHub release
66+
if: startsWith(github.ref, 'refs/tags/')
67+
uses: actions/create-release@v1
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
with:
71+
tag_name: ${{ steps.get-version-number.outputs.version }}
72+
release_name: Release ${{ steps.get-version-number.outputs.version }}
73+
74+
# Push Docker image
75+
- name: Push Docker image
76+
if: startsWith(github.ref, 'refs/tags/')
77+
env:
78+
VERSION: ${{ steps.get-version-number.outputs.version }}
79+
run: |
80+
docker image tag ghcr.io/biosimulators/biosimulators-tutorials:${{github.sha}} ghcr.io/biosimulators/biosimulators-tutorials:${VERSION}
81+
82+
docker login ghcr.io \
83+
--username ${{ secrets.DOCKER_REGISTRY_USERNAME }} \
84+
--password ${{ secrets.DOCKER_REGISTRY_TOKEN }}
85+
docker push ghcr.io/biosimulators/biosimulators-tutorials:${{github.sha}}
86+
docker push ghcr.io/biosimulators/biosimulators-tutorials:latest
87+
docker push ghcr.io/biosimulators/biosimulators-tutorials:${VERSION}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.pyc
2+
__pycache__/

CODE_OF_CONDUCT.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
118+
119+
The Community Impact Guidelines were inspired by [Mozilla's Code of Conduct Enforcement ladder](https://github.com/mozilla/diversity).
120+
121+
Answers to common questions about this code of conduct are available at
122+
https://www.contributor-covenant.org/faq. Translations of this code of conduct are available at
123+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contributing to the BioSimulators tutorials
2+
3+
We enthusiastically welcome contributions to the BioSimulators tutorials!
4+
5+
## Coordinating contributions
6+
7+
Before getting started, please contact the lead developers at [[email protected]](mailto:[email protected]) to coordinate your planned contributions with other ongoing efforts. Please also use GitHub issues to announce your plans to the community so that other developers can provide input into your plans and coordinate their own work. As the development community grows, we will institute additional infrastructure as needed such as a leadership committee and regular online meetings.
8+
9+
## Repository organization
10+
11+
* `README.md`: Overview of this repository
12+
* `tutorials/`: Tutorials
13+
* `LICENSE`: License for this package
14+
* `CONTRIBUTING.md`: Guide to contributing to this package (this document)
15+
* `CODE_OF_CONDUCT.md`: Code of conduct for developers of this package
16+
* `GOVERNANCE.md`: Governance structure for this package
17+
18+
## Submitting changes
19+
20+
Please use GitHub pull requests to submit changes. Each request should include a brief description of the new and/or modified features.
21+
22+
## Releasing new versions
23+
24+
To release changes, contact the [lead developers](mailto:[email protected]) to request their release.
25+
26+
Below are instructions for releasing a new version:
27+
28+
1. Commit the changes to this repository.
29+
2. Add a tag for the new version by running `git tag { version }`.
30+
3. Push these commits and the new tag to GitHub by running `git push && git push --tags`.
31+
4. This push will trigger a GitHub action which will execute the following tasks:
32+
* Compile a Docker image for this package.
33+
* Push the Docker image to the GitHub Container Registry (GHCR).
34+
* Create a GitHub release for the version.
35+
36+
## Reporting issues
37+
38+
Please use [GitHub issues](https://github.com/biosimulators/Biosimulators_tutorials/issues) to report any issues to the development community.
39+
40+
## Getting help
41+
42+
Please use [GitHub issues](https://github.com/biosimulators/Biosimulators_tutorials/issues) to post questions or contact the lead developers at [[email protected]](mailto:[email protected]).

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM ghcr.io/biosimulators/biosimulators:0.0.3
2+
3+
LABEL \
4+
org.opencontainers.image.title="BioSimulators Jupyter server" \
5+
org.opencontainers.image.description="Jupyter server in a Python environment with the validated simulation tools registered with BioSimulators" \
6+
org.opencontainers.image.url="https://github.com/biosimulators/Biosimulators_tutorials" \
7+
org.opencontainers.image.documentation="https://biosimulators.org/help" \
8+
org.opencontainers.image.source="https://github.com/biosimulators/Biosimulators_tutorials" \
9+
org.opencontainers.image.authors="BioSimulators Team <[email protected]>" \
10+
org.opencontainers.image.vendor="BioSimulators Team"
11+
12+
RUN pip install \
13+
notebook \
14+
jupyterhub \
15+
jupyterlab \
16+
matplotlib \
17+
pyyaml
18+
ENV MPLBACKEND=
19+
20+
ARG NB_USER=biosimulators
21+
ARG NB_UID=1000
22+
ENV USER ${NB_USER}
23+
ENV NB_UID ${NB_UID}
24+
ENV HOME=/home/${NB_USER}
25+
26+
RUN adduser --disabled-password \
27+
--gecos "Default user" \
28+
--uid ${NB_UID} \
29+
${NB_USER}
30+
31+
COPY tutorials/ ${HOME}
32+
RUN chown -R ${NB_UID} ${HOME}
33+
USER ${NB_USER}
34+
WORKDIR ${HOME}
35+
36+
CMD /bin/bash /xvfb-startup.sh

GOVERNANCE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Project governance
2+
3+
The project is governed by a committee of maintainers who collectively decide the direction of the project with input from the community. A list of the current maintainers is available in the [README](README.md).
4+
5+
## Maintainer responsibilities
6+
7+
Maintainers are people who care about the project and are responsible for helping it grow and improve. Maintainers must contribute to the project, as well as help review contributions from the community. Maintainers must also work collaboratively with each other.
8+
9+
Maintainers have write access to this repository. Maintainers can merge their own contributions or contributions from others. Nevertheless, maintainers are encouraged to seek review from each other, particularly for significant changes.
10+
11+
## Becoming a Maintainer
12+
13+
To become a maintainer you need to demonstrate the following:
14+
15+
* Participation in project discussions
16+
* Contribution of significant pull requests
17+
* Ability to write quality code, tests, examples, and/or documentation
18+
* Ability to collaborate with the maintainers
19+
* Understanding of the project's goals, organization, and conventions
20+
21+
Prospective maintainers can request maintainer privileges by sending a message to the current maintainers at [email protected].
22+
23+
## Project meetings
24+
25+
Maintainers are expected to participate in the project's meetings, which occur online at 11am EST on Thursdays. Other members of the community are also welcome to attend the project's meetings to provide input and feedback on the project. Please contact the maintainers at [email protected] for the link for the project meetings.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020 Center for Reproducible Biomedical Modeling
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
![Logo](https://raw.githubusercontent.com/biosimulations/Biosimulations/dev/libs/shared/assets/src/assets/images/biosimulators-logo/logo-white.svg)
2+
3+
# BioSimulators tutorials
4+
5+
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.
6+
7+
## Getting started
8+
9+
### Running the tutorials online with Binder
10+
The easiest way to run the tutorials is with Binder. Simply open https://mybinder.org/v2/gh/biosimulators/Biosimulators_tutorials/HEAD in your browser.
11+
12+
### Running the tutorials on your own machine
13+
Run the following commands to launch a Jupyter notebook server at http://localhost:8888 for the tutorials in this repository:
14+
```
15+
docker pull ghcr.io/biosimulators/biosimulators_tutorials
16+
docker run -it --rm -p 8888:8888 ghcr.io/biosimulators/biosimulators_tutorials jupyter notebook --ip=0.0.0.0 --port=8888
17+
```
18+
19+
## License
20+
21+
This package is released under the [MIT license](LICENSE).
22+
23+
## Development team
24+
25+
This package was developed by the [Karr Lab](https://www.karrlab.org) at the Icahn School of Medicine at Mount Sinai in New York as part of the [Center for Reproducible Biomodeling Modeling](https://reproduciblebiomodels.org).
26+
27+
- [Bilal Shaikh](https://www.bshaikh.com)
28+
- [Jonathan Karr](https://www.karrlab.org)
29+
30+
## Funding
31+
32+
This package was developed with support from the National Institute for Bioimaging and Bioengineering (award P41EB023912).
33+
34+
## Questions and comments
35+
36+
Please contact us at [[email protected]](mailto:[email protected]) with any questions or comments.

0 commit comments

Comments
 (0)