|
1 | 1 | //! Durable handoff and run-location evidence for detached Lab jobs. |
2 | 2 |
|
3 | | -use crate::core::run_outcome_envelope::RunOutcomeEnvelope; |
4 | | -use crate::core::runner_execution_envelope::{ |
5 | | - PathMaterializationPlan, RunnerExecutionArtifactRef, RunnerExecutionNextAction, |
6 | | - RunnerExecutionRecord, |
7 | | -}; |
| 3 | +use crate::core::path_materialization::PathMaterializationPlan; |
8 | 4 |
|
9 | 5 | use super::RunnerWorkloadArtifactRef; |
10 | 6 |
|
@@ -258,46 +254,6 @@ impl RunnerHandoffEnvelope { |
258 | 254 | follow_commands, |
259 | 255 | } |
260 | 256 | } |
261 | | - |
262 | | - pub fn runner_execution_record(&self) -> RunnerExecutionRecord { |
263 | | - let record = if self.status == "running" { |
264 | | - RunnerExecutionRecord::in_flight(self.job_id.clone(), self.runner_id.clone(), "daemon") |
265 | | - } else { |
266 | | - RunnerExecutionRecord::terminal( |
267 | | - self.job_id.clone(), |
268 | | - self.runner_id.clone(), |
269 | | - "daemon", |
270 | | - if self.status == "succeeded" { 0 } else { 1 }, |
271 | | - ) |
272 | | - }; |
273 | | - record |
274 | | - .with_job_id(self.job_id.clone()) |
275 | | - .with_mirror_run_id( |
276 | | - self.mirror_run_id |
277 | | - .clone() |
278 | | - .or_else(|| self.persisted_run_id.clone()) |
279 | | - .or_else(|| self.durable_run_id.clone()), |
280 | | - ) |
281 | | - .with_path_materialization_plan(self.path_materialization_plan.clone()) |
282 | | - .with_artifact_refs(self.evidence.artifact_refs.iter().map(|artifact| { |
283 | | - RunnerExecutionArtifactRef { |
284 | | - id: artifact.id.clone(), |
285 | | - name: artifact.name.clone(), |
286 | | - path: artifact.path.clone(), |
287 | | - url: artifact.url.clone(), |
288 | | - } |
289 | | - })) |
290 | | - .with_next_actions(self.evidence.next_commands.iter().map(|command| { |
291 | | - RunnerExecutionNextAction { |
292 | | - label: command.label.clone(), |
293 | | - command: command.command.clone(), |
294 | | - } |
295 | | - })) |
296 | | - } |
297 | | - |
298 | | - pub fn run_outcome_envelope(&self) -> RunOutcomeEnvelope { |
299 | | - RunOutcomeEnvelope::from_runner_execution_record(&self.runner_execution_record()) |
300 | | - } |
301 | 257 | } |
302 | 258 |
|
303 | 259 | impl RunnerHandoffArtifactManifestRef { |
|
0 commit comments