diff --git a/README.md b/README.md index 00a8dbc..8de5a5f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/conf/flowir_package.yaml b/conf/flowir_package.yaml index ba6cd1c..8e32d79 100644 --- a/conf/flowir_package.yaml +++ b/conf/flowir_package.yaml @@ -98,6 +98,9 @@ variables: numberOfNanopores: 3 probeRadius_A: 1.4 zeo_memory: '2Gi' + docker: + global: + numberOfNanopores: 1 blueprint: openshift: @@ -106,6 +109,11 @@ blueprint: config: walltime: 14400.0 backend: kubernetes + docker: + global: + resourceManager: + config: + backend: docker environments: default: @@ -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: @@ -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: @@ -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 @@ -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 @@ -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: @@ -249,5 +266,6 @@ output: platforms: - openshift + - docker version: 1.0.0 diff --git a/docker-example/README.md b/docker-example/README.md new file mode 100644 index 0000000..b9a8ca6 --- /dev/null +++ b/docker-example/README.md @@ -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. \ No newline at end of file diff --git a/docker-example/cif_files.dat b/docker-example/cif_files.dat new file mode 100644 index 0000000..855cfd6 --- /dev/null +++ b/docker-example/cif_files.dat @@ -0,0 +1 @@ +CoRE2019/GUJVOX_clean \ No newline at end of file diff --git a/docker-example/run.sh b/docker-example/run.sh new file mode 100755 index 0000000..67a7724 --- /dev/null +++ b/docker-example/run.sh @@ -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"