clone
clone
¶
Conductor clone support — isolated conductor instances for safe testing.
When --conductor-clone is passed to any Marianne CLI command, all daemon interactions are routed to a clone conductor instead of the production one. The clone has its own socket, PID file, state DB, and log file.
This enables safe testing of Marianne CLI commands and daemon features without risking the production conductor. The production conductor continues running undisturbed.
Usage
mzt start --conductor-clone # Start default clone mzt start --conductor-clone=staging # Start named clone mzt run score.yaml --conductor-clone # Submit to default clone mzt status --conductor-clone=staging # Query named clone
Architecture
- A module-level _clone_name stores the active clone (set by CLI callback)
- _resolve_socket_path() in detect.py checks get_clone_name() before falling back to SocketConfig defaults
- resolve_clone_paths() computes all isolated paths from a clone name
- build_clone_config() produces a DaemonConfig with clone-specific paths
Classes¶
ClonePaths
dataclass
¶
Isolated paths for a conductor clone instance.
Functions¶
set_clone_name
¶
get_clone_name
¶
is_clone_active
¶
resolve_clone_paths
¶
Compute isolated paths for a clone instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Clone name (None or empty for default clone, string for named clone). |
required |
Returns:
| Type | Description |
|---|---|
ClonePaths
|
ClonePaths with socket, PID, state DB, and log paths. |
ClonePaths
|
All paths are in /tmp for socket/PID (matching production convention) |
ClonePaths
|
and ~/.marianne for state DB/log. |
Source code in src/marianne/daemon/clone.py
build_clone_config
¶
Build a DaemonConfig with clone-specific paths.
Inherits all non-path settings from base_config (or defaults). Overrides socket, PID file, and log paths with clone-specific values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Clone name (None for default clone). |
required |
base_config
|
DaemonConfig | None
|
Production DaemonConfig to inherit from. |
None
|
Returns:
| Type | Description |
|---|---|
DaemonConfig
|
A DaemonConfig with isolated clone paths. |