Skip to content

Commit

Permalink
promoted annotation gitsync to spec field
Browse files Browse the repository at this point in the history
Signed-off-by: Basit Hasan <[email protected]>
  • Loading branch information
basit9958 committed Apr 5, 2023
1 parent 4070005 commit 17be123
Show file tree
Hide file tree
Showing 17 changed files with 694 additions and 45 deletions.
4 changes: 4 additions & 0 deletions apis/training/v1alpha1/elasticdljob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ type ElasticDLJobSpec struct {
// "Master": ElasticDLReplicaSpec,
// }
ElasticDLReplicaSpecs map[common.ReplicaType]*common.ReplicaSpec `json:"elasticdlReplicaSpecs"`

// GitSyncConfig defines the configuration for syncing code from Git repository
// +optional
GitSyncConfig *common.GitSyncOptions `json:"gitSyncConfig,omitempty"`
}

// +genclient
Expand Down
4 changes: 4 additions & 0 deletions apis/training/v1alpha1/marsjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ type MarsJobSpec struct {
// MarsReplicaSpecs is a map of MarsReplicaType(key) to ReplicaSpec(value),
// specifying replicas and template of each type.
MarsReplicaSpecs map[commonv1.ReplicaType]*commonv1.ReplicaSpec `json:"marsReplicaSpecs"`

// GitSyncConfig defines the configuration for syncing code from Git repository
// +optional
GitSyncConfig *commonv1.GitSyncOptions `json:"gitSyncConfig,omitempty"`
}

// MarsJobStatus defines the observed state of MarsJob
Expand Down
4 changes: 4 additions & 0 deletions apis/training/v1alpha1/mpijob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ type MPIJobSpec struct {

// LegacySpec reserves the deprecated fields for backward compatibility.
*MPIJobLegacySpec `json:",inline"`

// GitSyncConfig defines the configuration for syncing code from Git repository
// +optional
GitSyncConfig *apiv1.GitSyncOptions `json:"gitSyncConfig,omitempty"`
}

// MPIJobLegacySpec is a collection of legacy fields that were used in v1alpha1/v1alpha2 but
Expand Down
4 changes: 4 additions & 0 deletions apis/training/v1alpha1/pytorchjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ type PyTorchJobSpec struct {
// CacheBackend is used to configure the cache engine for job
// +optional
CacheBackend *cachev1alpha1.CacheBackendSpec `json:"cacheBackend"`

// GitSyncConfig defines the configuration for syncing code from Git repository
// +optional
GitSyncConfig *common.GitSyncOptions `json:"gitSyncConfig,omitempty"`
}

// PyTorchJobStatus defines the observed state of PyTorchJob
Expand Down
2 changes: 1 addition & 1 deletion apis/training/v1alpha1/tfjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type TFJobSpec struct {

// GitSyncConfig defines the configuration for syncing code from Git repository
// +optional
GitSyncConfig string `json:"gitSyncConfig,omitempty"`
GitSyncConfig *commonv1.GitSyncOptions `json:"gitSyncConfig,omitempty"`
}

// +genclient
Expand Down
4 changes: 4 additions & 0 deletions apis/training/v1alpha1/xdljob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ type XDLJobSpec struct {
// MinFinishWorkPercentage takes precedence over MinFinishWorkerNum if both are
// specified.
MinFinishWorkerPercentage *int32 `json:"minFinishWorkRate,omitempty"`

// GitSyncConfig defines the configuration for syncing code from Git repository
// +optional
GitSyncConfig *v1.GitSyncOptions `json:"gitSyncConfig,omitempty"`
}

// XDLJobStatus defines the observed state of XDLJob
Expand Down
4 changes: 4 additions & 0 deletions apis/training/v1alpha1/xgboostjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ type XGBoostJobSpec struct {
// "Worker": ReplicaSpec,
// }
XGBReplicaSpecs map[commonv1.ReplicaType]*commonv1.ReplicaSpec `json:"xgbReplicaSpecs"`

// GitSyncConfig defines the configuration for syncing code from Git repository
// +optional
GitSyncConfig *commonv1.GitSyncOptions `json:"gitSyncConfig,omitempty"`
}

// XGBoostJobStatus defines the observed state of XGBoostJob
Expand Down
89 changes: 89 additions & 0 deletions config/crd/bases/training.kubedl.io_elasticdljobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3063,6 +3063,95 @@ spec:
type: object
type: object
type: object
gitSyncConfig:
properties:
branch:
type: string
depth:
type: string
destPath:
type: string
envs:
items:
properties:
name:
type: string
value:
type: string
valueFrom:
properties:
configMapKeyRef:
properties:
key:
type: string
name:
type: string
optional:
type: boolean
required:
- key
type: object
fieldRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
required:
- fieldPath
type: object
resourceFieldRef:
properties:
containerName:
type: string
divisor:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
resource:
type: string
required:
- resource
type: object
secretKeyRef:
properties:
key:
type: string
name:
type: string
optional:
type: boolean
required:
- key
type: object
type: object
required:
- name
type: object
type: array
image:
type: string
maxFailures:
type: integer
password:
type: string
revision:
type: string
rootPath:
type: string
source:
type: string
ssh:
type: boolean
sshFile:
type: string
user:
type: string
required:
- source
type: object
schedulingPolicy:
properties:
minAvailable:
Expand Down
89 changes: 89 additions & 0 deletions config/crd/bases/training.kubedl.io_marsjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,95 @@ spec:
required:
- schedule
type: object
gitSyncConfig:
properties:
branch:
type: string
depth:
type: string
destPath:
type: string
envs:
items:
properties:
name:
type: string
value:
type: string
valueFrom:
properties:
configMapKeyRef:
properties:
key:
type: string
name:
type: string
optional:
type: boolean
required:
- key
type: object
fieldRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
required:
- fieldPath
type: object
resourceFieldRef:
properties:
containerName:
type: string
divisor:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
resource:
type: string
required:
- resource
type: object
secretKeyRef:
properties:
key:
type: string
name:
type: string
optional:
type: boolean
required:
- key
type: object
type: object
required:
- name
type: object
type: array
image:
type: string
maxFailures:
type: integer
password:
type: string
revision:
type: string
rootPath:
type: string
source:
type: string
ssh:
type: boolean
sshFile:
type: string
user:
type: string
required:
- source
type: object
marsReplicaSpecs:
additionalProperties:
properties:
Expand Down
89 changes: 89 additions & 0 deletions config/crd/bases/training.kubedl.io_mpijobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,95 @@ spec:
required:
- schedule
type: object
gitSyncConfig:
properties:
branch:
type: string
depth:
type: string
destPath:
type: string
envs:
items:
properties:
name:
type: string
value:
type: string
valueFrom:
properties:
configMapKeyRef:
properties:
key:
type: string
name:
type: string
optional:
type: boolean
required:
- key
type: object
fieldRef:
properties:
apiVersion:
type: string
fieldPath:
type: string
required:
- fieldPath
type: object
resourceFieldRef:
properties:
containerName:
type: string
divisor:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
resource:
type: string
required:
- resource
type: object
secretKeyRef:
properties:
key:
type: string
name:
type: string
optional:
type: boolean
required:
- key
type: object
type: object
required:
- name
type: object
type: array
image:
type: string
maxFailures:
type: integer
password:
type: string
revision:
type: string
rootPath:
type: string
source:
type: string
ssh:
type: boolean
sshFile:
type: string
user:
type: string
required:
- source
type: object
gpus:
format: int32
type: integer
Expand Down
Loading

0 comments on commit 17be123

Please sign in to comment.