Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 3.31 KB

README.md

File metadata and controls

69 lines (53 loc) · 3.31 KB

Cookiecutter For o²S²PARC CLI Services

Template library to generate an o²S²PARC compatible computational service that installs and executes command-line tools. For more general use-cases, with standardized definitions of inputs/outputs, please take a look at cookiecutter-osparc-service.

Requirements

  • GNU Make
  • Python3
  • Python3-venv (recommended to work in a virtual environment)
  • cookiecutter
  • Docker (if you wish to build and test the service locally)

To install the cookiecutter:

sudo apt-get update
sudo apt-get install -y make python3-venv
python3 -m venv .venv
source .venv/bin/activate
pip install cookiecutter jinja2_time

Usage

Generate a new Service based on the cookiecutter template layout:

python3 -m venv .venv
source .venv/bin/activate
cookiecutter git+ssh://git@github.com/ITISFoundation/cookiecutter-osparc-cli-service

Information for the developers of this cookiecutter

Run the tests

This will create a simple project, based on cookiecutter.json, will build the images (this can take some time) and run a command in the container:

make tests

License

This project is licensed under the terms of the MIT License

More Details

The service code is in the folder {{cookiecutter.project_slug}}. Users find instructions on how to create the service in the README

How does this work

In most use-cases, users only need to install the desired tool in the Dockerfile

The input and outputs of the service are already defined (users are not required to modify them). The first input is a string for executing the required command and the second input is one file or more files (in a zip). The input file(s) are optional.

The script service.cli/execute.sh takes care of all the logic:

  • retrieves inputs and copies them to the working directory
  • executes the command
  • retrieves the outputs: all the new files generated by the execution are copied and zipped in the output folder. If no output file is generated, the execution will terminate with an error.

Example use-cases

The cookiecutter has been tested to create Services with the following tools:


Made with love (and lots of hard work) at www.z43.swiss