5. CLI¶
hoplacli is a command-line interface designed to automate job submission and
execution using the hopla framework.
It loads a TOML configuration file, prepares an execution environment, submits
jobs (individually or in chunks), and produces a final execution report.
This guide explains how to use the CLI, how to structure the TOML
configuration file, and how the workflow operates.
5.1. Usage¶
hoplacli --config --config <config_file.toml> --njobs <N>
An experiment.toml demonstration configuration file can be found in the
project examples folder.
5.2. Workflow¶
Parse CLI arguments using
argparse.Load the TOML configuration file with
tomllib: expect four mandatory sections ([project],[inputs],[environment], and[config]) and one optional ([multi]).Initialize a :class:`~hopla.executor.Executor` with
[environment]settings.Extract and submit commands from the
[inputs]settings:If a
[multi]section is present, split commands into chunks and submit them as delayed submissions.Otherwise, submit commands directly.
Run the executor with the specified maximum number of jobs using the
[config]settings.Write a textual report to
report.txtinside the executor’s working directory.
5.3. TOML Configuration¶
The configuration file is divided into several sections.
5.3.1. [project]¶
name(str)Project name.
operator(str)Person responsible for running the analysis.
date(str)Date of the experiment in
DD/MM/YYYYformat.
5.3.2. [inputs]¶
commands(str or list)Commands to execute. May be a Python expression string (e.g.
"sleep {k}") or a list of explicit commands.parameters(str)Additional parameters passed to the container execution command (e.g.
"--cleanenv").
5.3.3. [environment]¶
See the Executor parameters.
5.3.4. [config]¶
dryrun(bool)Simulate job submission without executing.
delay_s(int)Delay (seconds) between submissions.
verbose(bool)Enable verbose logging.
5.3.5. [multi] (optional)¶
n_splits(int)Number of chunks to split commands into.
5.4. Notes¶
The
multisection is optional but required for chunked submissions.The
Configcontext manager is used internally to apply configuration settings during execution.