Skip to content

Commit

Permalink
feat: Add support for the docker backend (#1)
Browse files Browse the repository at this point in the history
* feat: add support for the docker backend

Signed-off-by: Vassilis Vassiliadis <[email protected]>

* docs: add an example to run a small-scale experiment using docker/podman

Signed-off-by: Vassilis Vassiliadis <[email protected]>

---------

Signed-off-by: Vassilis Vassiliadis <[email protected]>
  • Loading branch information
VassilisVassiliadis authored Aug 1, 2023
1 parent f06d38c commit 85244f5
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ rest_uid = api.api_experiment_start("nanopore-geometry-experiment", payload)

**Note**: The [example notebook](nanopore-geometry-experiment.ipynb) shows a full example.

**Note**: You can also run a small scale experiment using docker/podman. See our example [here](docker-example/README.md).

## Help and Support

Please feel free to create an issue and alert the maintainers listed in the [MAINTAINERS.md](MAINTAINERS.md) page.
Expand Down
20 changes: 19 additions & 1 deletion conf/flowir_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ variables:
numberOfNanopores: 3
probeRadius_A: 1.4
zeo_memory: '2Gi'
docker:
global:
numberOfNanopores: 1

blueprint:
openshift:
Expand All @@ -106,6 +109,11 @@ blueprint:
config:
walltime: 14400.0
backend: kubernetes
docker:
global:
resourceManager:
config:
backend: docker

environments:
default:
Expand Down Expand Up @@ -162,6 +170,8 @@ components:
kubernetes:
image: quay.io/st4sd/community-applications/raspa-source-mdlab:latest
cpuUnitsPerCore: 0.25
docker:
image: quay.io/st4sd/community-applications/raspa-source-mdlab:latest
resourceRequest:
memory: 512Mi
workflowAttributes:
Expand All @@ -181,7 +191,8 @@ components:
resourceManager:
kubernetes:
image: quay.io/st4sd/community-applications/geometry-mdlab:latest
cpuUnitsPerCore: 1.0
docker:
image: quay.io/st4sd/community-applications/geometry-mdlab:latest
resourceRequest:
memory: '%(zeo_memory)s'
workflowAttributes:
Expand All @@ -203,6 +214,8 @@ components:
kubernetes:
image: quay.io/st4sd/community-applications/geometry-mdlab:latest
cpuUnitsPerCore: 0.25
docker:
image: quay.io/st4sd/community-applications/geometry-mdlab:latest
resourceRequest:
memory: 256Mi

Expand All @@ -220,6 +233,8 @@ components:
kubernetes:
image: quay.io/st4sd/community-applications/geometry-mdlab:latest
cpuUnitsPerCore: 0.25
docker:
image: quay.io/st4sd/community-applications/geometry-mdlab:latest
resourceRequest:
memory: 256Mi

Expand All @@ -236,6 +251,8 @@ components:
kubernetes:
image: quay.io/st4sd/community-applications/geometry-mdlab:latest
cpuUnitsPerCore: 0.25
docker:
image: quay.io/st4sd/community-applications/geometry-mdlab:latest
resourceRequest:
memory: 256Mi
workflowAttributes:
Expand All @@ -249,5 +266,6 @@ output:

platforms:
- openshift
- docker

version: 1.0.0
36 changes: 36 additions & 0 deletions docker-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Run nanopore-geometry-experiment using the Docker backend of ST4SD

## Prerequisites

1. A recent version of python 3 - [python 3.7+](https://www.python.org/downloads/)
2. The [docker](https://docs.docker.com/get-docker/) container runtime
3. The [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) command-line utility


## Instructions

You can try out the experiment on your laptop by:

1. creating a python virtual environment, activating it, and installing the python module `st4sd-runtime-core`
2. cloning this repository
3. launching the experiment


For example:

```bash
#!/usr/bin/env sh

# Download virtual experiment
git clone https://github.com/st4sd/nanopore-geometry-experiment.git

# Setup ST4SD runtime-core
python3 -m venv --copies venv
. venv/bin/activate
python3 -m pip install "st4sd-runtime-core"

# Run experiment
./nanopore-geometry-experiment/docker-example/run.sh
```

**Note**: Make sure you run the `git clone` command in a directory that `docker` (or `podman`) can mount later when you execute the experiment.
1 change: 1 addition & 0 deletions docker-example/cif_files.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CoRE2019/GUJVOX_clean
28 changes: 28 additions & 0 deletions docker-example/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env sh
cd $(dirname ${0})/..

docker_like_location=""
if ! which docker >/dev/null; then
echo "The docker command is not available on this system, will try to use podman" >&2

if location=$(which podman); then
docker_like_location="--dockerExecutableOverride=${location}"
echo "Podman located at ${location}" >&2
else
echo "No docker or podman command on this system - aborting" >&2
exit 2
fi
fi

# Run experiment
echo "Executing the experiment ..." >&2
elaunch.py --failSafeDelays=no ${docker_like_location} -l40 \
--instanceName nanopore-geometry-experiment \
--manifest manifest.yaml \
--input docker-example/cif_files.dat \
--platform docker conf/flowir_package.yaml

# See outputs of experiment
echo "\n\nMeasured properties are:" >&2
output_dir=$(ls -td nanopore-geometry-experiment*.instance | head -1)
cat "${output_dir}/output/properties.csv"

0 comments on commit 85244f5

Please sign in to comment.