MCPcopy
hub / github.com/cortexlabs/cortex / SetStatusForJob

Function SetStatusForJob

pkg/operator/resources/job/state.go:269–293  ·  view source on GitHub ↗
(jobKey spec.JobKey, jobStatus status.JobCode)

Source from the content-addressed store, hash-verified

267}
268
269func SetStatusForJob(jobKey spec.JobKey, jobStatus status.JobCode) error {
270 switch jobStatus {
271 case status.JobEnqueuing:
272 return SetEnqueuingStatus(jobKey)
273 case status.JobRunning:
274 return SetRunningStatus(jobKey)
275 case status.JobEnqueueFailed:
276 return SetEnqueueFailedStatus(jobKey)
277 case status.JobCompletedWithFailures:
278 return SetCompletedWithFailuresStatus(jobKey)
279 case status.JobSucceeded:
280 return SetSucceededStatus(jobKey)
281 case status.JobUnexpectedError:
282 return SetUnexpectedErrorStatus(jobKey)
283 case status.JobWorkerError:
284 return SetWorkerErrorStatus(jobKey)
285 case status.JobWorkerOOM:
286 return SetWorkerOOMStatus(jobKey)
287 case status.JobTimedOut:
288 return SetTimedOutStatus(jobKey)
289 case status.JobStopped:
290 return SetStoppedStatus(jobKey)
291 }
292 return nil
293}
294
295func UpdateLiveness(jobKey spec.JobKey) error {
296 s3Key := path.Join(jobKey.Prefix(config.ClusterConfig.ClusterUID), _enqueuingLivenessFile)

Callers 1

ManageJobResourcesFunction · 0.92

Calls 10

SetEnqueuingStatusFunction · 0.85
SetRunningStatusFunction · 0.85
SetEnqueueFailedStatusFunction · 0.85
SetSucceededStatusFunction · 0.85
SetUnexpectedErrorStatusFunction · 0.85
SetWorkerErrorStatusFunction · 0.85
SetWorkerOOMStatusFunction · 0.85
SetTimedOutStatusFunction · 0.85
SetStoppedStatusFunction · 0.85

Tested by

no test coverage detected