@@ -206,6 +206,8 @@ const (
206
206
OutOfSyncEvent Event = " OutOfSync"
207
207
// CommandIssuedEvent is triggered if a command is raised by user
208
208
CommandIssuedEvent Event = " CommandIssued"
209
+ // TaskCompletedEvent is triggered if the 'Replicas' amount of pods in one task are succeed
210
+ TaskCompletedEvent Event = " TaskCompleted"
209
211
)
210
212
211
213
// Action is the type of event handling
@@ -217,12 +219,11 @@ const (
217
219
AbortJobAction Action = " AbortJob"
218
220
// RestartJobAction if this action is set, the whole job will be restarted
219
221
RestartJobAction Action = " RestartJob"
220
- // RestartTaskAction if this action is set, only the task will be restarted; default action.
221
- // This action can not work together with job level events, e.g. JobUnschedulable
222
- RestartTaskAction Action = " RestartTask"
223
222
// TerminateJobAction if this action is set, the whole job wil be terminated
224
223
// and can not be resumed: all Pod of Job will be evicted, and no Pod will be recreated.
225
224
TerminateJobAction Action = " TerminateJob"
225
+ // CompleteJobAction if this action is set, the unfinished pods will be killed, job completed.
226
+ CompleteJobAction Action = " CompleteJob"
226
227
227
228
// ResumeJobAction is the action to resume an aborted job.
228
229
ResumeJobAction Action = " ResumeJob"
@@ -300,8 +301,8 @@ spec:
300
301
```
301
302
302
303
Some BigData framework (e.g. Spark) may have different requirements. Take Spark as example, the whole job will be restarted
303
- if 'driver' tasks failed and only restart the task if 'executor' tasks failed. As ` RestartTask ` is the default action of
304
- task events, ` RestartJob ` is set for driver ` spec.tasks.policies ` as follow.
304
+ if 'driver' tasks failed and only restart the task if 'executor' tasks failed. ` OnFailure ` restartPolicy is set for executor
305
+ and ` RestartJob ` is set for driver ` spec.tasks.policies ` as follow.
305
306
306
307
``` yaml
307
308
apiVersion : batch.volcano.sh/v1alpha1
@@ -327,6 +328,7 @@ spec:
327
328
containers :
328
329
- name : executor
329
330
image : executor-img
331
+ restartPolicy : OnFailure
330
332
` ` `
331
333
332
334
## Features Interaction
@@ -508,6 +510,8 @@ const (
508
510
OutOfSyncEvent Event = "OutOfSync"
509
511
// CommandIssuedEvent is triggered if a command is raised by user
510
512
CommandIssuedEvent Event = "CommandIssued"
513
+ // TaskCompletedEvent is triggered if the 'Replicas' amount of pods in one task are succeed
514
+ TaskCompletedEvent Event = "TaskCompleted"
511
515
)
512
516
513
517
// Action is the action that Job controller will take according to the event.
@@ -519,12 +523,11 @@ const (
519
523
AbortJobAction Action = "AbortJob"
520
524
// RestartJobAction if this action is set, the whole job will be restarted
521
525
RestartJobAction Action = "RestartJob"
522
- // RestartTaskAction if this action is set, only the task will be restarted; default action.
523
- // This action can not work together with job level events, e.g. JobUnschedulable
524
- RestartTaskAction Action = "RestartTask"
525
526
// TerminateJobAction if this action is set, the whole job wil be terminated
526
527
// and can not be resumed : all Pod of Job will be evicted, and no Pod will be recreated.
527
528
TerminateJobAction Action = "TerminateJob"
529
+ // CompleteJobAction if this action is set, the unfinished pods will be killed, job completed.
530
+ CompleteJobAction Action = "CompleteJob"
528
531
529
532
// ResumeJobAction is the action to resume an aborted job.
530
533
ResumeJobAction Action = "ResumeJob"
0 commit comments