job_control
job_control
¶
Job lifecycle control service — conductor-only proxy.
Every operation routes through the conductor via DaemonClient IPC.
If the conductor is not running, all operations fail with clear errors.
There is no subprocess fallback.
Classes¶
JobStartResult
dataclass
¶
Result of starting a job.
JobActionResult
dataclass
¶
Result of a job action (pause/resume/cancel).
ProcessHealth
dataclass
¶
ProcessHealth(pid, is_alive, is_zombie_state, process_exists, cpu_percent=None, memory_mb=None, uptime_seconds=None)
Process health check result (derived from conductor state).
JobControlService
¶
Conductor-only proxy for job lifecycle control.
Parameters¶
daemon_client:
A DaemonClient connected to the conductor's Unix socket.
Source code in src/marianne/dashboard/services/job_control.py
Functions¶
start_job
async
¶
Submit a new job to the conductor.
Only file-based configs are supported (the conductor requires a
path it can resolve). Inline config_content is written to a
temporary file and the path is forwarded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
Path | None
|
Path to YAML config file. |
None
|
config_content
|
str | None
|
Inline YAML config content (written to temp file). |
None
|
workspace
|
Path | None
|
Override workspace directory. |
None
|
start_sheet
|
int
|
Starting sheet number. |
1
|
self_healing
|
bool
|
Enable self-healing mode. |
False
|
Returns:
| Type | Description |
|---|---|
JobStartResult
|
JobStartResult with job details. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither config_path nor config_content provided. |
FileNotFoundError
|
If config_path doesn't exist. |
RuntimeError
|
If the conductor rejects the submission. |
Source code in src/marianne/dashboard/services/job_control.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
pause_job
async
¶
Pause a running job via the conductor.
Source code in src/marianne/dashboard/services/job_control.py
resume_job
async
¶
Resume a paused job via the conductor.
Source code in src/marianne/dashboard/services/job_control.py
cancel_job
async
¶
Cancel a running or paused job via the conductor.
Source code in src/marianne/dashboard/services/job_control.py
delete_job
async
¶
Delete a terminal job from the conductor registry.
Source code in src/marianne/dashboard/services/job_control.py
verify_process_health
async
¶
Check job health by querying conductor state.
Returns a ProcessHealth derived from the job's CheckpointState
as reported by the conductor.