condatainer

command module
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: BSD-3-Clause Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README ยถ

CondaTainer

CondaTainer Logo

Read the Docs Go Reference GitHub Release

CondaTainer is a rootless CLI for managing tools / data / project environments and launching apps on HPC โ€” designed for individuals and small teams using institutional or regional compute resources.

  • Web-App Ready: Launch RStudio, VS Code, noVNC and more with one command.
  • Unified Management: Centralize group resources and easily isolate project environments.
  • Inode Saver: Packing 30k+ Conda files into a single portable image.
  • LustreFS Friendly: Stages conda creation on node-local SSD to reduce network filesystem load.
  • Scheduler Native: Out-of-the-box integration with Slurm, PBS, LSF, and HTCondor.

[!NOTE] Slurm is the primary, tested scheduler. Others are experimental, bug reports are welcome!

For qsub, only PBS Pro (OpenPBS) is supported. Torque and SGE are not supported.

๐Ÿ› ๏ธ Installation

curl -fsSL https://get-condatainer.justype.net | bash

You will be prompted to confirm the installation path (defaults to $SCRATCH/condatainer/ or $HOME/condatainer/). The script will also update shell config and run condatainer config init for you.

๐Ÿงฐ Tools/Data Management

condatainer avail # List available recipes
condatainer list  # List installed tools/data

# Create and run a specific tool
condatainer create samtools/1.16
condatainer exec -o samtools/1.16 samtools --version

# Print helpful info when running with overlays
condatainer exec -o grch38/cellranger/2024-A bash
# [CNT] Overlay envs:
#   CELLRANGER_REF_DIR: cellranger reference dir

CondaTainer will set PATH and other environment variables for you.

๐Ÿ“ฆ Project Environment Management

CondaTainer supports both read-only (.sqf) and writable (.img) overlays, ensuring production stability alongside development flexibility.

Read-Only Environments (Production)

Create an immutable bundle overlay directly from a Conda YAML file:

condatainer create -f environment.yml -p my_analysis
condatainer exec -o my_analysis.sqf bash
Writable Environments (Development)

Manage a writable workspace overlay for development and testing:

condatainer overlay create -s 5G env.img   # Create a 5G overlay
condatainer overlay resize -s 10G env.img  # Resize an overlay to 10G
condatainer overlay chown --root env.img   # Make it compatible with --fakeroot

condatainer exec -w -o env.img bash  # Launch a shell in writable mode
condatainer e                        # Quick shortcut for the above command

Inside a writable mode, use mm-* Micromamba wrappers to manage packages

mm-install r-base=4.4 r-tidyverse  # Install packages
mm-pin r-base         # Pin a package version
mm-pin -r r-base      # Unpin a package
mm-remove r-tidyverse # Remove a package
mm-update             # Update packages
mm-export             # Export environment to YAML

๐Ÿ•โ€๐Ÿฆบ Web Apps & GUI Helpers

CondaTainer includes built-in helpers to launch apps (like RStudio, XFCE4 noVNC) directly on compute nodes.

condatainer helper --update       # Fetch the latest helper scripts
condatainer helper --list         # View all available apps

condatainer helper vscode-tunnel  # Start a VS Code tunnel
condatainer helper igv -p 10212   # Start IGV via noVNC on port 10212

Please check out ReadTheDocs - Helpers HPC for more details and examples.

๐Ÿš€ Automation

CondaTainer can parse scripts to resolve dependencies (#DEP:) and scheduler directives (#SBATCH, #PBS, or #BSUB).

Example Script (salmon_quant.sh):

#!/bin/bash
#SBATCH --time=4:00:00
#SBATCH --cpus-per-task=8
#SBATCH --mem=30G
#DEP:salmon/1.10.2
#DEP:grch38/salmon/1.10.2/gencode47

salmon quant \
  -i $SALMON_INDEX_DIR \
  -p $NCPUS \
  -l A -r reads.fq -o quants/

Install missing dependencies first:

condatainer check -a salmon_quant.sh

After all dependencies are installed, submit as a job:

condatainer run salmon_quant.sh

Useful ENVs are automatically set in the container (single task job):

Variable Name Description Slurm PBS LSF HTCondor
$NCPUS CPUs per task --cpus-per-task ncpus -n with span[host=1] request_cpus
$MEM/$MEM_GB Mem per task MB/GB --mem mem rusage[mem]*cpu request_memory

For MPI jobs (ntasks > 1), CondaTainer will detect mpiexec and wrap the command accordingly.

Job Array and Dependency

All [CNT] messages go to stderr. Only job ID is printed to stdout, so you can capture it for downstream.

HTCondor uses its own DAGMan for job dependencies, so --afterok is not supported.

TRIM=$(condatainer run --array samples.txt --array-limit 10 trim.sh)
ALGN=$(condatainer run --array samples.txt --array-limit 10 --afterok "$TRIM" align.sh)
QUANT=$(condatainer run --array samples.txt --array-limit 10 --afterok "$ALGN" quant.sh)
condatainer run --afterok "$QUANT" collect_results.sh samples.txt

Please see cnt-tutorials - Airway Salmon Quant for a real-world example.

Related tools and resources:

Acknowledgements

This project used computational resources provided by

McMaster University Logo ย ย ย  Digital Research Alliance of Canada Logo

Documentation ยถ

The Go Gopher

There is no documentation for this package.

Directories ยถ

Path Synopsis
internal
scheduler
Package scheduler provides a unified interface for HPC job schedulers
Package scheduler provides a unified interface for HPC job schedulers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL