mirror of https://github.com/volcano-sh/apis.git
Merge remote-tracking branch 'upstream/master' into network-topo
This commit is contained in:
commit
098cadb1fa
20
go.mod
20
go.mod
|
|
@ -3,11 +3,11 @@ module volcano.sh/apis
|
|||
go 1.22.0
|
||||
|
||||
require (
|
||||
k8s.io/api v0.31.1
|
||||
k8s.io/apimachinery v0.31.1
|
||||
k8s.io/apiserver v0.31.1
|
||||
k8s.io/client-go v0.31.1
|
||||
k8s.io/code-generator v0.31.1
|
||||
k8s.io/api v0.31.3
|
||||
k8s.io/apimachinery v0.31.3
|
||||
k8s.io/apiserver v0.31.3
|
||||
k8s.io/client-go v0.31.3
|
||||
k8s.io/code-generator v0.31.3
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
|
||||
|
|
@ -57,7 +57,7 @@ require (
|
|||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/component-base v0.31.1 // indirect
|
||||
k8s.io/component-base v0.31.3 // indirect
|
||||
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
|
|
@ -65,8 +65,8 @@ require (
|
|||
)
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.31.1
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.31.1
|
||||
k8s.io/apiserver => k8s.io/apiserver v0.31.1
|
||||
k8s.io/client-go => k8s.io/client-go v0.31.1
|
||||
k8s.io/api => k8s.io/api v0.31.3
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.31.3
|
||||
k8s.io/apiserver => k8s.io/apiserver v0.31.3
|
||||
k8s.io/client-go => k8s.io/client-go v0.31.3
|
||||
)
|
||||
|
|
|
|||
24
go.sum
24
go.sum
|
|
@ -154,18 +154,18 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
|||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
|
||||
k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
|
||||
k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
|
||||
k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
|
||||
k8s.io/apiserver v0.31.1 h1:Sars5ejQDCRBY5f7R3QFHdqN3s61nhkpaX8/k1iEw1c=
|
||||
k8s.io/apiserver v0.31.1/go.mod h1:lzDhpeToamVZJmmFlaLwdYZwd7zB+WYRYIboqA1kGxM=
|
||||
k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0=
|
||||
k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg=
|
||||
k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs=
|
||||
k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs=
|
||||
k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8=
|
||||
k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w=
|
||||
k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8=
|
||||
k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE=
|
||||
k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4=
|
||||
k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
|
||||
k8s.io/apiserver v0.31.3 h1:+1oHTtCB+OheqFEz375D0IlzHZ5VeQKX1KGXnx+TTuY=
|
||||
k8s.io/apiserver v0.31.3/go.mod h1:PrxVbebxrxQPFhJk4powDISIROkNMKHibTg9lTRQ0Qg=
|
||||
k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4=
|
||||
k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs=
|
||||
k8s.io/code-generator v0.31.3 h1:Pj0fYOBms+ZrsulLi4DMsCEx1jG8fWKRLy44onHsLBI=
|
||||
k8s.io/code-generator v0.31.3/go.mod h1:/umCIlT84g1+Yu5ZXtP1KGSRTnGiIzzX5AzUAxsNlts=
|
||||
k8s.io/component-base v0.31.3 h1:DMCXXVx546Rfvhj+3cOm2EUxhS+EyztH423j+8sOwhQ=
|
||||
k8s.io/component-base v0.31.3/go.mod h1:xME6BHfUOafRgT0rGVBGl7TuSg8Z9/deT7qq6w7qjIU=
|
||||
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo=
|
||||
k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ APIS_PKG="$3"
|
|||
GROUPS_WITH_VERSIONS="$4"
|
||||
shift 4
|
||||
|
||||
go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,conversion-gen}@v0.31.1
|
||||
go install k8s.io/code-generator/cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,conversion-gen}@v0.31.3
|
||||
|
||||
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
|
||||
GOBIN="$(go env GOBIN)"
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ EXT_APIS_PKG="$4"
|
|||
GROUPS_WITH_VERSIONS="$5"
|
||||
shift 5
|
||||
|
||||
go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}@v0.31.1
|
||||
go install k8s.io/code-generator/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen}@v0.31.3
|
||||
|
||||
# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise:
|
||||
GOBIN="$(go env GOBIN)"
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ type JobSpec struct {
|
|||
|
||||
// Specifies the maximum number of retries before marking this Job failed.
|
||||
// Defaults to 3.
|
||||
// +kubebuilder:default:=3
|
||||
// +optional
|
||||
MaxRetry int32 `json:"maxRetry,omitempty" protobuf:"bytes,9,opt,name=maxRetry"`
|
||||
|
||||
|
|
@ -203,6 +204,7 @@ type LifecyclePolicy struct {
|
|||
Timeout *metav1.Duration `json:"timeout,omitempty" protobuf:"bytes,5,opt,name=timeout"`
|
||||
}
|
||||
|
||||
// +kubebuilder:validation:Enum=none;best-effort;restricted;single-numa-node
|
||||
type NumaPolicy string
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -28,10 +28,16 @@ const (
|
|||
// 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.
|
||||
// RestartTaskAction if this action is set, only the task will be restarted
|
||||
// It means that all pods under the task will be deleted and recreated.
|
||||
// This action can not work together with job level events, e.g. JobUnschedulable
|
||||
RestartTaskAction Action = "RestartTask"
|
||||
|
||||
// RestartPodAction if this action is set, only the pod will be restarted
|
||||
// It means that only the pod corresponding to the event will be deleted and recreated.
|
||||
// This action can just work together with pod level events, e.g. PodFailed
|
||||
RestartPodAction Action = "RestartPod"
|
||||
|
||||
// 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"
|
||||
|
|
|
|||
|
|
@ -14,9 +14,11 @@ type Command struct {
|
|||
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
|
||||
// Action defines the action that will be took to the target object.
|
||||
// +optional
|
||||
Action string `json:"action,omitempty" protobuf:"bytes,2,opt,name=action"`
|
||||
|
||||
// TargetObject defines the target object of this command.
|
||||
// +optional
|
||||
TargetObject *metav1.OwnerReference `json:"target,omitempty" protobuf:"bytes,3,opt,name=target"`
|
||||
|
||||
// Unique, one-word, CamelCase reason for this command.
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package v1alpha1
|
||||
|
||||
// Event represent the phase of Job, e.g. pod-failed.
|
||||
// +kubebuilder:validation:Enum=*;PodPending;PodRunning;PodFailed;PodEvicted;Unknown;TaskCompleted;OutOfSync;CommandIssued;JobUpdated;TaskFailed
|
||||
type Event string
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -31,41 +31,63 @@ type JobFlowSpec struct {
|
|||
// Important: Run "make" to regenerate code after modifying this file
|
||||
|
||||
// Foo is an example field of JobFlow. Edit jobflow_types.go to remove/update
|
||||
// +optional
|
||||
Flows []Flow `json:"flows,omitempty"`
|
||||
JobRetainPolicy string `json:"jobRetainPolicy,omitempty"`
|
||||
// +optional
|
||||
JobRetainPolicy RetainPolicy `json:"jobRetainPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// Flow defines the dependent of jobs
|
||||
type Flow struct {
|
||||
// +kubebuilder:validation:MinLength=1
|
||||
// +required
|
||||
Name string `json:"name"`
|
||||
// +optional
|
||||
DependsOn *DependsOn `json:"dependsOn,omitempty"`
|
||||
}
|
||||
|
||||
type DependsOn struct {
|
||||
// +optional
|
||||
Targets []string `json:"targets,omitempty"`
|
||||
// +optional
|
||||
Probe *Probe `json:"probe,omitempty"`
|
||||
}
|
||||
|
||||
type Probe struct {
|
||||
// +optional
|
||||
HttpGetList []HttpGet `json:"httpGetList,omitempty"`
|
||||
// +optional
|
||||
TcpSocketList []TcpSocket `json:"tcpSocketList,omitempty"`
|
||||
// +optional
|
||||
TaskStatusList []TaskStatus `json:"taskStatusList,omitempty"`
|
||||
}
|
||||
|
||||
type HttpGet struct {
|
||||
// +optional
|
||||
TaskName string `json:"taskName,omitempty"`
|
||||
// +optional
|
||||
Path string `json:"path,omitempty"`
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
// +kubebuilder:validation:Maximum=65535
|
||||
Port int `json:"port,omitempty"`
|
||||
// +optional
|
||||
HTTPHeader v1.HTTPHeader `json:"httpHeader,omitempty"`
|
||||
}
|
||||
|
||||
type TcpSocket struct {
|
||||
// +optional
|
||||
TaskName string `json:"taskName,omitempty"`
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
// +kubebuilder:validation:Maximum=65535
|
||||
// +required
|
||||
Port int `json:"port"`
|
||||
}
|
||||
|
||||
type TaskStatus struct {
|
||||
// +optional
|
||||
TaskName string `json:"taskName,omitempty"`
|
||||
// +optional
|
||||
Phase string `json:"phase,omitempty"`
|
||||
}
|
||||
|
||||
|
|
@ -73,44 +95,65 @@ type TaskStatus struct {
|
|||
type JobFlowStatus struct {
|
||||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
|
||||
// +optional
|
||||
PendingJobs []string `json:"pendingJobs,omitempty"`
|
||||
// +optional
|
||||
RunningJobs []string `json:"runningJobs,omitempty"`
|
||||
// +optional
|
||||
FailedJobs []string `json:"failedJobs,omitempty"`
|
||||
// +optional
|
||||
CompletedJobs []string `json:"completedJobs,omitempty"`
|
||||
// +optional
|
||||
TerminatedJobs []string `json:"terminatedJobs,omitempty"`
|
||||
// +optional
|
||||
UnKnowJobs []string `json:"unKnowJobs,omitempty"`
|
||||
// +optional
|
||||
JobStatusList []JobStatus `json:"jobStatusList,omitempty"`
|
||||
// +optional
|
||||
Conditions map[string]Condition `json:"conditions,omitempty"`
|
||||
// +optional
|
||||
State State `json:"state,omitempty"`
|
||||
}
|
||||
|
||||
type JobStatus struct {
|
||||
// +optional
|
||||
Name string `json:"name,omitempty"`
|
||||
// +optional
|
||||
State v1alpha1.JobPhase `json:"state,omitempty"`
|
||||
// +optional
|
||||
StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`
|
||||
// +optional
|
||||
EndTimestamp metav1.Time `json:"endTimestamp,omitempty"`
|
||||
// +optional
|
||||
RestartCount int32 `json:"restartCount,omitempty"`
|
||||
// +optional
|
||||
RunningHistories []JobRunningHistory `json:"runningHistories,omitempty"`
|
||||
}
|
||||
|
||||
type JobRunningHistory struct {
|
||||
// +optional
|
||||
StartTimestamp metav1.Time `json:"startTimestamp,omitempty"`
|
||||
// +optional
|
||||
EndTimestamp metav1.Time `json:"endTimestamp,omitempty"`
|
||||
// +optional
|
||||
State v1alpha1.JobPhase `json:"state,omitempty"`
|
||||
}
|
||||
|
||||
type State struct {
|
||||
// +optional
|
||||
Phase Phase `json:"phase,omitempty"`
|
||||
}
|
||||
|
||||
type Phase string
|
||||
// +kubebuilder:validation:Enum=retain;delete
|
||||
type RetainPolicy string
|
||||
|
||||
const (
|
||||
Retain = "retain"
|
||||
Delete = "delete"
|
||||
Retain RetainPolicy = "retain"
|
||||
Delete RetainPolicy = "delete"
|
||||
)
|
||||
|
||||
type Phase string
|
||||
|
||||
const (
|
||||
Succeed Phase = "Succeed"
|
||||
Terminating Phase = "Terminating"
|
||||
|
|
|
|||
|
|
@ -25,18 +25,27 @@ import (
|
|||
|
||||
// ResourceInfo is the sets about resource capacity and allocatable
|
||||
type ResourceInfo struct {
|
||||
// +optional
|
||||
Allocatable string `json:"allocatable,omitempty"`
|
||||
// +optional
|
||||
Capacity int `json:"capacity,omitempty"`
|
||||
}
|
||||
|
||||
// CPUInfo is the cpu topology detail
|
||||
type CPUInfo struct {
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
// +optional
|
||||
NUMANodeID int `json:"numa,omitempty"`
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
// +optional
|
||||
SocketID int `json:"socket,omitempty"`
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
// +optional
|
||||
CoreID int `json:"core,omitempty"`
|
||||
}
|
||||
|
||||
// PolicyName is the policy name type
|
||||
// +kubebuilder:validation:Enum=CPUManagerPolicy;TopologyManagerPolicy
|
||||
type PolicyName string
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -21,9 +21,6 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// PodGroupPhase is the phase of a pod group at the current time.
|
||||
type PodGroupPhase string
|
||||
|
||||
// QueueState is state type of queue.
|
||||
type QueueState string
|
||||
|
||||
|
|
@ -38,6 +35,9 @@ const (
|
|||
QueueStateUnknown QueueState = "Unknown"
|
||||
)
|
||||
|
||||
// PodGroupPhase is the phase of a pod group at the current time.
|
||||
type PodGroupPhase string
|
||||
|
||||
// These are the valid phase of podGroups.
|
||||
const (
|
||||
// PodGroupPending means the pod group has been accepted by the system, but scheduler can not allocate
|
||||
|
|
@ -337,8 +337,11 @@ type QueueStatus struct {
|
|||
|
||||
// CluterSpec represents the template of Cluster
|
||||
type Cluster struct {
|
||||
// +optional
|
||||
Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
|
||||
// +optional
|
||||
Weight int32 `json:"weight,omitempty" protobuf:"bytes,2,opt,name=weight"`
|
||||
// +optional
|
||||
Capacity v1.ResourceList `json:"capacity,omitempty" protobuf:"bytes,3,opt,name=capacity"`
|
||||
}
|
||||
|
||||
|
|
@ -369,7 +372,10 @@ type NodeGroupAntiAffinity struct {
|
|||
|
||||
// QueueSpec represents the template of Queue.
|
||||
type QueueSpec struct {
|
||||
// +optional
|
||||
Weight int32 `json:"weight,omitempty" protobuf:"bytes,1,opt,name=weight"`
|
||||
|
||||
// +optional
|
||||
Capability v1.ResourceList `json:"capability,omitempty" protobuf:"bytes,2,opt,name=capability"`
|
||||
|
||||
// Reclaimable indicate whether the queue can be reclaimed by other queue
|
||||
|
|
|
|||
|
|
@ -17,11 +17,15 @@ limitations under the License.
|
|||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
flowv1alpha1 "volcano.sh/apis/pkg/apis/flow/v1alpha1"
|
||||
)
|
||||
|
||||
// JobFlowSpecApplyConfiguration represents a declarative configuration of the JobFlowSpec type for use
|
||||
// with apply.
|
||||
type JobFlowSpecApplyConfiguration struct {
|
||||
Flows []FlowApplyConfiguration `json:"flows,omitempty"`
|
||||
JobRetainPolicy *string `json:"jobRetainPolicy,omitempty"`
|
||||
JobRetainPolicy *flowv1alpha1.RetainPolicy `json:"jobRetainPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// JobFlowSpecApplyConfiguration constructs a declarative configuration of the JobFlowSpec type for use with
|
||||
|
|
@ -46,7 +50,7 @@ func (b *JobFlowSpecApplyConfiguration) WithFlows(values ...*FlowApplyConfigurat
|
|||
// WithJobRetainPolicy sets the JobRetainPolicy field in the declarative configuration to the given value
|
||||
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
|
||||
// If called multiple times, the JobRetainPolicy field is set to the value of the last call.
|
||||
func (b *JobFlowSpecApplyConfiguration) WithJobRetainPolicy(value string) *JobFlowSpecApplyConfiguration {
|
||||
func (b *JobFlowSpecApplyConfiguration) WithJobRetainPolicy(value flowv1alpha1.RetainPolicy) *JobFlowSpecApplyConfiguration {
|
||||
b.JobRetainPolicy = &value
|
||||
return b
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue