-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Klaus Ma <klaus1982.cn@gmail.com>
- Loading branch information
Showing
45 changed files
with
439 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
Copyright 2020 The Volcano Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
// Action is the action that Job controller will take according to the event. | ||
type Action string | ||
|
||
const ( | ||
|
||
// AbortJobAction if this action is set, the whole job will be aborted: | ||
// all Pod of Job will be evicted, and no Pod will be recreated | ||
AbortJobAction Action = "AbortJob" | ||
|
||
// RestartJobAction if this action is set, the whole job will be restarted | ||
RestartJobAction Action = "RestartJob" | ||
|
||
// RestartTaskAction if this action is set, only the task will be restarted; default action. | ||
// This action can not work together with job level events, e.g. JobUnschedulable | ||
RestartTaskAction Action = "RestartTask" | ||
|
||
// TerminateJobAction if this action is set, the whole job wil be terminated | ||
// and can not be resumed: all Pod of Job will be evicted, and no Pod will be recreated. | ||
TerminateJobAction Action = "TerminateJob" | ||
|
||
// CompleteJobAction if this action is set, the unfinished pods will be killed, job completed. | ||
CompleteJobAction Action = "CompleteJob" | ||
|
||
// ResumeJobAction is the action to resume an aborted job. | ||
ResumeJobAction Action = "ResumeJob" | ||
|
||
// Note: actions below are only used internally, should not be used by users. | ||
|
||
// SyncJobAction is the action to sync Job/Pod status. | ||
SyncJobAction Action = "SyncJob" | ||
|
||
// EnqueueAction is the action to sync Job inqueue status. | ||
EnqueueAction Action = "EnqueueJob" | ||
|
||
// SyncQueueAction is the action to sync queue status. | ||
SyncQueueAction Action = "SyncQueue" | ||
|
||
// OpenQueueAction is the action to open queue | ||
OpenQueueAction Action = "OpenQueue" | ||
|
||
// CloseQueueAction is the action to close queue | ||
CloseQueueAction Action = "CloseQueue" | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
Copyright 2020 The Volcano Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
// Event represent the phase of Job, e.g. pod-failed. | ||
type Event string | ||
|
||
const ( | ||
|
||
// AnyEvent means all event | ||
AnyEvent Event = "*" | ||
|
||
// PodFailedEvent is triggered if Pod was failed | ||
PodFailedEvent Event = "PodFailed" | ||
|
||
// PodEvictedEvent is triggered if Pod was deleted | ||
PodEvictedEvent Event = "PodEvicted" | ||
|
||
// JobUnknownEvent These below are several events can lead to job 'Unknown' | ||
// 1. Task Unschedulable, this is triggered when part of | ||
// pods can't be scheduled while some are already running in gang-scheduling case. | ||
JobUnknownEvent Event = "Unknown" | ||
|
||
// TaskCompletedEvent is triggered if the 'Replicas' amount of pods in one task are succeed | ||
TaskCompletedEvent Event = "TaskCompleted" | ||
|
||
// Note: events below are used internally, should not be used by users. | ||
|
||
// OutOfSyncEvent is triggered if Pod/Job were updated | ||
OutOfSyncEvent Event = "OutOfSync" | ||
|
||
// CommandIssuedEvent is triggered if a command is raised by user | ||
CommandIssuedEvent Event = "CommandIssued" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.