Skip to main content

MiniDMR Local Cluster

MiniDMR is a CLI tool for creating and managing local Docker-based DMR clusters. It is the recommended way to run DMR locally for demos, development, and CI pipelines.

Use cases

Use caseDescription
Demos / workshopsReproducible multi-node cluster, starts and stops cleanly
DMR core developmentContainer images with all dependencies preinstalled
App developmentSeparate image with DMR fully installed; focus on your app
CI pipelinesTemporary containerized cluster for integration testing

Installation

Latest release:

curl -fsSL https://gitlab.bsc.es/accelcom/releases/dmr/tools/minidmr/-/raw/master/scripts/install.sh | bash

Specific version (e.g. v0.0.4):

curl -fsSL https://gitlab.bsc.es/accelcom/releases/dmr/tools/minidmr/-/raw/master/scripts/install.sh | bash -s -- v0.0.4

Install to a custom directory (no sudo):

curl -fsSL .../install.sh | bash -s -- --install-dir ~/.local/bin

For manual installation, download the binary from the Releases page.

Commands

CommandDescription
startStart a multi-node Docker-based DMR cluster
enterDrop into the controller node interactively
execRun an arbitrary command on the controller node
srunRun a Slurm job on the cluster via srun, blocking
sbatchSubmit a batch job to the cluster via sbatch
installInstall RPM packages with dnf in the running cluster
upgradeUpgrade minidmr to the latest or a specific release
statusShow whether the cluster is running and how many nodes it has
stopStop and remove all containers
versionPrint the current version
completionGenerate shell autocompletion scripts
helpDisplay help about any command

Quick example

# Start a 4-node cluster
minidmr start --nodes 4

# Start a cluster whose image already ships with the user, injecting env vars
# into every container (controller + workers)
minidmr start --no-user-setup -e DMR_PATH=/home/malluser/dmr

# Enter the controller node
minidmr enter

# Run an arbitrary command on the controller node (e.g. to compile DMR)
minidmr exec -u malluser -- bash -c 'source env_setup.sh && ./build.sh'

# Run a Slurm job, blocking until it finishes; the exit code is propagated
minidmr srun -u malluser -e DMR_CHECKPOINT_RESTART=1 -- -N2 mpirun ./my_test

# Submit a batch job via sbatch, from a script on the controller node
minidmr sbatch -u malluser -- job.sbatch

# Or, for a quick one-off job without a script file
minidmr sbatch -u malluser -- --wrap 'hostname'

# Install packages on all cluster nodes
minidmr install blas-devel lapack-devel

# Install a package only on the controller node
minidmr install --controller-only gcc-gfortran

# Upgrade minidmr to the latest release
minidmr upgrade

# Check whether the cluster is running and how many nodes it has
minidmr status

# Same, as machine-readable JSON
minidmr status --json

# Stop and remove the cluster
minidmr stop

Running DMR tests

minidmr start --nodes 4
minidmr enter

Inside the controller node:

git clone https://gitlab.bsc.es/accelcom/releases/dmr/dmr.git
cd dmr
export DMR_PATH=$(pwd)

cd tests/ci
./dmr_full_test_run.sh compile/build_slurm4dmr_notalp.sh

The build_slurm4dmr_notalp.sh script is compatible with MiniDMR out of the box.

Global flags

FlagDescriptionDefault
--data_dirDirectory for storing cluster data and configuration$HOME/.minihpc

start flags

FlagDescriptionDefault
-i, --imageContainer image to useslurm-docker-cluster:slurm4dmr
-n, --nodesNumber of slurmd nodes4
--packages-fileJSON package manifest installed after startup$data_dir/packages.json if it exists
--no-user-setupSkip creating/configuring the demo user, for images that already ship with the target userfalse
-e, --envEnv var (KEY=VALUE) injected into every container; repeatable-

By default, start looks for a package manifest at $data_dir/packages.json and installs it when present. The manifest can be a plain array:

["blas-devel", "lapack-devel"]

Or an object with packages for all nodes and controller-only packages:

{
"packages": ["blas-devel", "lapack-devel"],
"controller": ["gcc-gfortran"]
}

install flags

FlagDescription
-c, --controller-onlyInstall only on the controller node

upgrade flags

FlagDescription
-v, --versionInstall a specific release tag instead of the latest

status flags

FlagDescription
--jsonOutput status as JSON instead of human-readable text

enter flags

FlagDescription
-w, --workdirWorking directory inside the container (default: mapped from current working directory)
note

If stopped containers from a previous cluster are found (e.g. after a reboot), minidmr start resumes them instead of creating a new cluster. If --nodes is explicitly set and differs from the previous cluster size, start asks whether to remove the old cluster and create a new one.