Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Sep 24, 2021
0 parents commit 7901387
Show file tree
Hide file tree
Showing 11 changed files with 2,158 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
README.md
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build and push Docker image

on:
push:

jobs:
buildAndPushImage:
name: Build and push Docker image
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/[email protected]

# Build Docker image
- id: get-timestamp
name: Get timestamp
run: |
TIMESTAMP=$(date --rfc-3339=seconds | sed 's/ /T/')
echo "::set-output name=timestamp::$TIMESTAMP"
- name: Build Docker image
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}}"
registry: ghcr.io
stages_image_name: biosimulators/biosimulators-tutorials-stages
image_name: biosimulators/biosimulators-tutorials-stages
image_tag: ${{github.sha}}
push_image_and_stages: true
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: "${{ secrets.DOCKER_REGISTRY_TOKEN }}"

- name: Label Docker image
run: |
docker image tag ghcr.io/biosimulators/biosimulators-tutorials-stages:${{github.sha}} ghcr.io/biosimulators/biosimulators-tutorials:${{github.sha}}
docker image tag ghcr.io/biosimulators/biosimulators-tutorials-stages:${{github.sha}} ghcr.io/biosimulators/biosimulators-tutorials:latest
# Test tutorials
- name: Test tutorials
run: |
cwd=$(pwd)
docker run \
--rm \
--entrypoint bash \
--mount type=bind,source=${cwd},target=/app/Biosimulators_tutorials \
ghcr.io/biosimulators/biosimulators-tutorials:latest \
-c "
pipenv run pip install nbmake pytest pytest-forked
/bin/bash /xvfb-startup.sh pipenv run python -m pytest --forked --verbose --nbmake Biosimulators_tutorials/tutorials/
"
# Get version number
- id: get-version-number
name: Get version number
if: startsWith(github.ref, 'refs/tags/')
env:
TAG: ${{ github.ref }}
run: |
version="${TAG/refs\/tags\//}"
echo "::set-output name=version::$version"
# Create GitHub release
- name: Create GitHub release
if: startsWith(github.ref, 'refs/tags/')
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get-version-number.outputs.version }}
release_name: Release ${{ steps.get-version-number.outputs.version }}

# Push Docker image
- name: Push Docker image
if: startsWith(github.ref, 'refs/tags/')
env:
VERSION: ${{ steps.get-version-number.outputs.version }}
run: |
docker image tag ghcr.io/biosimulators/biosimulators-tutorials:${{github.sha}} ghcr.io/biosimulators/biosimulators-tutorials:${VERSION}
docker login ghcr.io \
--username ${{ secrets.DOCKER_REGISTRY_USERNAME }} \
--password ${{ secrets.DOCKER_REGISTRY_TOKEN }}
docker push ghcr.io/biosimulators/biosimulators-tutorials:${{github.sha}}
docker push ghcr.io/biosimulators/biosimulators-tutorials:latest
docker push ghcr.io/biosimulators/biosimulators-tutorials:${VERSION}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
__pycache__/
123 changes: 123 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[[email protected]](mailto:[email protected]).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).

The Community Impact Guidelines were inspired by [Mozilla's Code of Conduct Enforcement ladder](https://github.com/mozilla/diversity).

Answers to common questions about this code of conduct are available at
https://www.contributor-covenant.org/faq. Translations of this code of conduct are available at
https://www.contributor-covenant.org/translations.
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Contributing to the BioSimulators tutorials

We enthusiastically welcome contributions to the BioSimulators tutorials!

## Coordinating contributions

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.

## Repository organization

* `README.md`: Overview of this repository
* `tutorials/`: Tutorials
* `LICENSE`: License for this package
* `CONTRIBUTING.md`: Guide to contributing to this package (this document)
* `CODE_OF_CONDUCT.md`: Code of conduct for developers of this package
* `GOVERNANCE.md`: Governance structure for this package

## Submitting changes

Please use GitHub pull requests to submit changes. Each request should include a brief description of the new and/or modified features.

## Releasing new versions

To release changes, contact the [lead developers](mailto:[email protected]) to request their release.

Below are instructions for releasing a new version:

1. Commit the changes to this repository.
2. Add a tag for the new version by running `git tag { version }`.
3. Push these commits and the new tag to GitHub by running `git push && git push --tags`.
4. This push will trigger a GitHub action which will execute the following tasks:
* Compile a Docker image for this package.
* Push the Docker image to the GitHub Container Registry (GHCR).
* Create a GitHub release for the version.

## Reporting issues

Please use [GitHub issues](https://github.com/biosimulators/Biosimulators_tutorials/issues) to report any issues to the development community.

## Getting help

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]).
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ghcr.io/biosimulators/biosimulators:0.0.3

LABEL \
org.opencontainers.image.title="BioSimulators Jupyter server" \
org.opencontainers.image.description="Jupyter server in a Python environment with the validated simulation tools registered with BioSimulators" \
org.opencontainers.image.url="https://github.com/biosimulators/Biosimulators_tutorials" \
org.opencontainers.image.documentation="https://biosimulators.org/help" \
org.opencontainers.image.source="https://github.com/biosimulators/Biosimulators_tutorials" \
org.opencontainers.image.authors="BioSimulators Team <[email protected]>" \
org.opencontainers.image.vendor="BioSimulators Team"

RUN pip install \
notebook \
jupyterhub \
jupyterlab \
matplotlib \
pyyaml
ENV MPLBACKEND=

ARG NB_USER=biosimulators
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME=/home/${NB_USER}

RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}

COPY tutorials/ ${HOME}
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}
WORKDIR ${HOME}

CMD /bin/bash /xvfb-startup.sh
25 changes: 25 additions & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Project governance

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).

## Maintainer responsibilities

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.

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.

## Becoming a Maintainer

To become a maintainer you need to demonstrate the following:

* Participation in project discussions
* Contribution of significant pull requests
* Ability to write quality code, tests, examples, and/or documentation
* Ability to collaborate with the maintainers
* Understanding of the project's goals, organization, and conventions

Prospective maintainers can request maintainer privileges by sending a message to the current maintainers at [email protected].

## Project meetings

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.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 Center for Reproducible Biomedical Modeling

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
![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.

## Getting started

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

### Running the tutorials on your own machine
Run the following commands to launch a Jupyter notebook server at http://localhost:8888 for the tutorials in this repository:
```
docker pull ghcr.io/biosimulators/biosimulators_tutorials
docker run -it --rm -p 8888:8888 ghcr.io/biosimulators/biosimulators_tutorials jupyter notebook --ip=0.0.0.0 --port=8888
```

## License

This package is released under the [MIT license](LICENSE).

## Development team

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).

- [Bilal Shaikh](https://www.bshaikh.com)
- [Jonathan Karr](https://www.karrlab.org)

## Funding

This package was developed with support from the National Institute for Bioimaging and Bioengineering (award P41EB023912).

## Questions and comments

Please contact us at [[email protected]](mailto:[email protected]) with any questions or comments.
Loading

0 comments on commit 7901387

Please sign in to comment.