How to use looper with bulker
Bulker is a multi-container environment manager that provides containerized CLI tools via lightweight shim scripts. Looper ships with built-in compute packages for running bulker-activated pipelines, both locally and on SLURM clusters.
1. Specify the bulker crate in your pipeline interface
Section titled “1. Specify the bulker crate in your pipeline interface”The pipeline author specifies which bulker crate to use in the compute section of the pipeline interface:
pipeline_name: my_pipelinesample_interface: command_template: > my_tool {sample.input_file}compute: bulker_crate: bulker/demo:default2. Run locally with bulker_local
Section titled “2. Run locally with bulker_local”To run bulker-activated pipelines on your local machine:
looper run --package bulker_localThis activates the bulker crate and runs the pipeline command inside the bulker environment. The submission command is sh, so jobs run sequentially in the current shell.
3. Submit to SLURM with bulker_slurm
Section titled “3. Submit to SLURM with bulker_slurm”To submit bulker-activated pipelines to a SLURM cluster:
looper run --package bulker_slurm \ --compute partition=standard time='04:00:00' cores='8' mem='16000'This uses the built-in bulker_slurm template, which handles SLURM submission headers and bulker activation automatically.
4. Use pre-commands for environment setup
Section titled “4. Use pre-commands for environment setup”On many HPC systems, bulker needs additional setup before it can run — for example, loading a module or setting TMPDIR to a shared scratch location. Use pre_command for this:
looper run --package bulker_slurm \ --compute partition=standard time='04:00:00' cores='8' mem='16000' \ pre_command='export TMPDIR=/scratch/$USER/tmp && mkdir -p $TMPDIR && module load apptainer'Or set it in your looper config so you don't have to type it every time:
pep_config: pep_config.yamloutput_dir: resultspipeline_interfaces: - pipeline/pipeline_interface.yamlcli: run: package: bulker_slurm compute: partition: standard time: '04:00:00' cores: '8' mem: '16000' pre_command: > export TMPDIR=/scratch/$USER/tmp && mkdir -p $TMPDIR && module load apptainerAvailable bulker packages
Section titled “Available bulker packages”| Package | Submission | Description |
|---|---|---|
bulker_local | sh | Run bulker-activated pipelines locally |
bulker_slurm | sbatch | Submit bulker-activated pipelines to SLURM |
Appendix: Built-in bulker templates
Section titled “Appendix: Built-in bulker templates”bulker_local template
Section titled “bulker_local template”#!/bin/bash
echo 'Compute node:' `hostname`echo 'Start time:' `date +'%Y-%m-%d %T'`
{PRE_COMMAND}
eval "$(bulker activate -e {BULKER_CRATE})"
{ {CODE}} | tee {LOGFILE} -i
{POST_COMMAND}bulker_slurm template
Section titled “bulker_slurm template”#!/bin/bash#SBATCH --job-name='{JOBNAME}'#SBATCH --output='{LOGFILE}'#SBATCH --mem='{MEM}'#SBATCH --cpus-per-task='{CORES}'#SBATCH --time='{TIME}'#SBATCH --partition='{PARTITION}'#SBATCH -m block#SBATCH --ntasks=1
echo 'Compute node:' `hostname`echo 'Start time:' `date +'%Y-%m-%d %T'`
{PRE_COMMAND}
eval "$(bulker activate -e {BULKER_CRATE})"
{CODE}
{POST_COMMAND}See also
Section titled “See also”- Configuring cluster computing -- tutorial on compute settings
- Custom submission templates -- create your own compute packages
- Running jobs in containers -- Docker and Apptainer packages