---
# System prepended metadata

title: Container solutions

---

# Container solutions
- Docker -> not-HPC friendly
- Singularity/Apptainer(?) -> better
- Conda -> might be a paid solution in the future
- python-based -> ok-ish
    - venv
    - [uv](https://github.com/astral-sh/uv) (in the trend, much faster)
- pixi -> personally have no experience...

more in:
https://www.nextflow.io/docs/latest/container.html#containers

# Existing schemas
| Schemas      |  link | Comments |
| --------     |  --- | ------- |
| Biocontainers|  https://biocontainers-edu.readthedocs.io/en/latest/what_is_biocontainers.html | widely used in scientific area; [Tutorial](https://github.com/BioContainers/specs?tab=readme-ov-file#242-add-a-container); [Specifications](https://github.com/BioContainers/specs/blob/master/container-specs.md)         |
| Bilayer      | https://bilayers.org/custom-algorithm/ | Deep-learning-oriented; New & Image-focused containerisation solution; [simple example](https://github.com/bilayer-containers/bilayers/tree/main/src/bilayers/algorithms/classical_segmentation) |
| nf-core      | https://nf-co.re/docs/guidelines/pipelines/recommendations/custom_containers | Biocontainer-compatible; Largely adopted by sequencing community        |

# FAIR Container Features(?)
| Features | Priority   | comment | 
| ------------ |  -----    | --- | 
| CLI runnable  | Minimum requirement   | CLI: command line interface |
| FAIR | Minimum requirement | _FAIR: findable, accessible, interoperable, reusable._ |
| Input-output declaration | Top    | Enhance user-friendliness|
| Unified mounting dir     | ?    | Better standarisation (?) |
| Image visualisation     | ?    |  |
| DL model pre-download    | ? | flexibility vs. reproducibility|
| Unit-tested  | Top       | Otherwise hard to maintain |

# Bilayer uses a config.yaml file to create additional layers on top of docker image:

| parameter | description |
| --------     | -------- |
| docker_image     | Defines the Docker image used for execution, including the organization, repository name, and tag |
| citations | References relevant research citation, doi, and license associated with the algorithm |
| algorithm_folder_name | Specifies the directory where the generated Gradio and Jupyter Notebook interface files are stored |
| exec_function | Defines the function that converts the config.yaml (i.e. spec file) into a Gradio or Jupyter Notebook interface. It also includes the base command (e.g., python -m cellpose) that serves as the entry point for execution and a special hidden_args section if applicable |
| inputs | Refers to the elements that are translated into command-line arguments for our supported interfaces. Additionally, they contribute to adapting the Bilayers specification for integration with workflow management tools such as Snakemake, Nextflow, or WDL |
| outputs | Primarily used for refining the Bilayers specification to be compatible with workflow management tools like Snakemake, Nextflow, or WDL. While they may or may not include a cli_tag, they are NOT involved in generating our interfaces |
| display_only | Contains fields that are displayed on the interface but do not affect CLI execution. These objects must not include a cli_tag |

# bilayer team discussions:
https://github.com/orgs/bilayer-containers/discussions