mmirage.cli — Command-Line Interface¶
Command-line interface for MMIRAGE pipeline.
- mmirage.cli.run_local(config_path, shard_id=None)[source]¶
Run one shard in the current Python environment.
- mmirage.cli.launch_pipeline(cfg, config_path, force_retry=False, require_completion=False)[source]¶
Launch the pipeline according to execution mode and retry settings.
- Parameters:
cfg (MMirageConfig) – Parsed MMIRAGE configuration object.
config_path (str) – Absolute path to the MMIRAGE YAML config file.
force_retry (bool) – If True, enable retry orchestration regardless of config flag.
require_completion (bool) – If True, wait for completion and verify shard status before returning success in SLURM mode when auto-retry is off.
- Returns:
0 on success, 1 on failure.
- Return type:
Exit code
- mmirage.cli.configure_logging(level)[source]¶
Configure root logging.
- Parameters:
level (str) – Root log level name.
- Return type:
None
Attach common CLI arguments to a subcommand parser.
- Parameters:
parser (ArgumentParser) – Subcommand parser receiving shared arguments.
- Return type:
None
- mmirage.cli.build_argparser()[source]¶
Build the CLI parser.
- Returns:
Configured top-level argparse parser.
- Return type:
- mmirage.cli.log_merge_reports(reports)[source]¶
Log merge summary for one or more datasets.
- Parameters:
reports (List[MergeReport])
- Return type:
None
- mmirage.cli.parse_shard_ids(raw_value, num_shards=None)[source]¶
Parse a comma-separated shard id list.
- mmirage.cli.handle_run(args, cfg, config_path)[source]¶
Handle the canonical run command.
- Parameters:
args (Namespace) – Parsed CLI namespace.
cfg (MMirageConfig) – Parsed MMIRAGE configuration object.
config_path (str) – Absolute path to the MMIRAGE YAML config file.
- Returns:
Exit code for the run operation.
- Return type:
- mmirage.cli.handle_submit(args, cfg, config_path)[source]¶
Submit a SLURM array job and optionally wait.
- Parameters:
args (Namespace) – Parsed CLI namespace.
cfg (MMirageConfig) – Parsed MMIRAGE configuration object.
config_path (str) – Absolute path to the MMIRAGE YAML config file.
- Returns:
Exit code for submission/wait outcome.
- Return type:
- mmirage.cli.handle_check(args, cfg, config_path)[source]¶
Inspect shard status and optionally submit retries.
- Parameters:
args (Namespace) – Parsed CLI namespace.
cfg (MMirageConfig) – Parsed MMIRAGE configuration object.
config_path (str) – Absolute path to the MMIRAGE YAML config file.
- Returns:
Exit code based on shard status and optional retry submission.
- Return type:
- mmirage.cli.handle_retry(args, cfg, config_path)[source]¶
Submit retries for failed shards only.
- Parameters:
args (Namespace) – Parsed CLI namespace.
cfg (MMirageConfig) – Parsed MMIRAGE configuration object.
config_path (str) – Absolute path to the MMIRAGE YAML config file.
- Returns:
Exit code for retry submission outcome.
- Return type:
- mmirage.cli.handle_merge(args, cfg, _config_path)[source]¶
Merge shard outputs defined in config.loading_params.datasets.
- Parameters:
args (Namespace) – Parsed CLI namespace.
cfg (MMirageConfig) – Parsed MMIRAGE configuration object.
_config_path (str) – Absolute path to the MMIRAGE YAML config file (not needed here).
- Returns:
Exit code for merge outcome.
- Return type: