COBLE: Quick Start¶
Functionality Overview¶
An overview of the main functions, using an environment called codex:
To create environments¶
# Conda is the default
coble build --recipe my-recipe.cbl --env codex
# Or for a conda or singularity environment
coble build --recipe my-recipe.cbl --env codex --containers docker,singularity
To use environments¶
Conda¶
# Activate
conda activate codex
# Check the creation details (time, person, recipe)
coble me
# Check the validation if implemented
coble validate
Docker and Singularity (from the local build)¶
The containers have the environment ready activated when they load. Docker should have a working directory mapped to /workspace.
# Docker
docker run --rm -it \
-v .:/workspace -w /workspace \
cbl-my-env
# Singularity
singularity shell cbl-codex.sif
To recreate environments¶
For conda: the build will have created a file codex_export.cbl with the versioned files:
The Dockerfile includes a commented header section that shows the build args used so it can be rebuilt directly from docker - an example below
# This Dockerfile was generated by coble with the following build args:
# Started at 2026-03-01 10:26:25"
# User: ralcraft"
# ------------------------------
# RECIPE_CBL=codex.cbl
# BUILD_TAG=codex
# GITHUB_PAT=$GITHUB_PAT
# VAL_FILE=recipes/papers/ProvGigaPath/validate/validate.sh
# VAL_FOLDER=recipes/papers/ProvGigaPath/validate
# CODE_SOURCE=local
# ------------------------------
# Instructions to build the image:
# 1. Set the above environment variables in your terminal (or export them in your shell profile)
# 2. Run the below command ensuring to amend paths to your location correctly:
# ------------------------------
################### GENERIC COBLE DOCKERFILE ############################
# Build with local recipe:
#
# docker build -f "$DOCKERFILE" \
# --build-arg RECIPE_CBL="$INPUT_RECIPE" \
# --build-arg BUILD_TAG="$ENV_NAME" \
# --build-arg GITHUB_PAT="$GITHUB_PAT" \
# --build-arg VAL_FILE="$VAL_FILE" \
# --build-arg VAL_FOLDER="$VAL_FOLDER" \
# --no-cache \
# -t "$IMAGE_NAME" .
The Four Functions¶
Build: Create or update an environment from a recipe file.
--- Optional arguments: ---alias --containers --rebuild: Clean and rebuild the environment from scratch.
- --skip-errors: continue building even if some packages fail to install. Default behaviour os to exit and promt you to fix.
- --include-r-forge: include R-Forge when looking for packages as URLs through find: - by default it is turned off as it is slow.
- --debug: keep all interim log files.
Freeze: Freeze an existing environment into a coble recipe file.
--- Optional arguments: ---env: Active environment is frozen if not specified.
- --debug: keep temporary files for each package manager for debugging.
Network: Create a network dependency graph
--- Optional arguments: ---env: Active environment is frozen if not specified.
The output is to the same folder as the input, frozen, called:-
<env>_network_interactive.html : an interactive dependdency explorer
- <env>_dependencies.txt : the data for the dependency viewer
- <env>_network_stats.txt : some info on the network
Template: Generate a template recipe file to start from.
A coble recipe file¶
A simple recipe could look like this (my-recipe.cbl):
coble:
- environment: coble-env-versions
channels:
- bioconda
- conda-forge
languages:
- python=3.13.1@conda-forge
- r-base=4.3.1@conda-forge
conda:
- pysam
r-package:
- ggplot2
pip:
- NumPy
Additional Information¶
- The environment (
--env) can be either a name or a folder path. COBLE will automatically use--nameor--prefixas appropriate. - If you specify more than one R or more than one Python version in the language block, COBLE will complain and refuse to continue.
- There is a
finddirective that initiates a search across pypi, cran, bioconductor and github for a package source.