8000 [Feature] [ML] Init Job (#1514) · arangodb/kube-arangodb@a7bd9cb · GitHub
[go: up one dir, main page]

Skip to content

Commit a7bd9cb

Browse files
authored
[Feature] [ML] Init Job (#1514)
1 parent 35967e9 commit a7bd9cb

17 files changed

+403
-67
lines changed

chart/kube-arangodb/templates/ml/role.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,10 @@ rules:
3434
- "get"
3535
- "list"
3636
- "watch"
37+
- apiGroups: [""]
38+
resources:
39+
- "secrets"
40+
- "pods"
41+
verbs: ["*"]
3742
{{- end }}
3843
{{- end }}

docs/api/ArangoDeployment.V1.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -910,31 +910,31 @@ Links:
910910

911911
### .spec.allowUnsafeUpgrade
912912

913-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L163)</sup>
913+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L152)</sup>
914914

915915
AllowUnsafeUpgrade determines if upgrade on missing member or with not in sync shards is allowed
916916

917917
***
918918

919919
### .spec.annotations
920920

921-
Type: `object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L126)</sup>
921+
Type: `object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L115)</sup>
922922

923923
Annotations specifies the annotations added to all ArangoDeployment owned resources (pods, services, PVC’s, PDB’s).
924924

925925
***
926926

927927
### .spec.annotationsIgnoreList
928928

929-
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L129)</sup>
929+
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L118)</sup>
930930

931931
AnnotationsIgnoreList list regexp or plain definitions which annotations should be ignored
932932

933933
***
934934

935935
### .spec.annotationsMode
936936

937-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L135)</sup>
937+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L124)</sup>
938938

939939
AnnotationsMode defines annotations mode which should be use while overriding annotations.
940940

@@ -947,7 +947,7 @@ Possible Values:
947947

948948
### .spec.architecture
949949

950-
Type: `[]string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L265)</sup>
950+
Type: `[]string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L254)</sup>
951951

952952
Architecture defines the list of supported architectures.
953953
First element on the list is marked as default architecture.
@@ -1026,7 +1026,7 @@ KillPodProbability is the chance of a pod being killed during an event
10261026

10271027
### .spec.ClusterDomain
10281028

1029-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L237)</sup>
1029+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L226)</sup>
10301030

10311031
ClusterDomain define domain used in the kubernetes cluster.
10321032
Required only of domain is not set to default (cluster.local)
@@ -1037,7 +1037,7 @@ Default Value: `cluster.local`
10371037

10381038
### .spec.communicationMethod
10391039

1040-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L245)</sup>
1040+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L234)</sup>
10411041

10421042
CommunicationMethod define communication method used in deployment
10431043

@@ -2872,7 +2872,7 @@ Links:
28722872

28732873
### .spec.disableIPv6
28742874

2875-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L109)</sup>
2875+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L98)</sup>
28762876

2877 10000 2877
DisableIPv6 setting prevents the use of IPv6 addresses by ArangoDB servers.
28782878
This setting cannot be changed after the deployment has been created.
@@ -2883,7 +2883,7 @@ Default Value: `false`
28832883

28842884
### .spec.downtimeAllowed
28852885

2886-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L104)</sup>
2886+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L93)</sup>
28872887

28882888
DowntimeAllowed setting is used to allow automatic reconciliation actions that yield some downtime of the ArangoDB deployment.
28892889
When this setting is set to false, no automatic action that may result in downtime is allowed.
@@ -2899,7 +2899,7 @@ Default Value: `false`
28992899

29002900
### .spec.environment
29012901

2902-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L65)</sup>
2902+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L54)</sup>
29032903

29042904
Environment setting specifies the type of environment in which the deployment is created.
29052905

@@ -3194,7 +3194,7 @@ Links:
31943194

31953195
### .spec.image
31963196

3197-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L78)</sup>
3197+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L67)</sup>
31983198

31993199
Image specifies the docker image to use for all ArangoDB servers.
32003200
In a development environment this setting defaults to arangodb/arangodb:latest.
@@ -3205,7 +3205,7 @@ It is highly recommend to use explicit version (not latest) for production envir
32053205

32063206
### .spec.imageDiscoveryMode
32073207

3208-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L94)</sup>
3208+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L83)</sup>
32093209

32103210
ImageDiscoveryMode specifies the image discovery mode.
32113211

@@ -3217,7 +3217,7 @@ Possible Values:
32173217

32183218
### .spec.imagePullPolicy
32193219

3220-
Type: `core.PullPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L86)</sup>
3220+
Type: `core.PullPolicy` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L75)</sup>
32213221

32223222
ImagePullPolicy specifies the pull policy for the docker image to use for all ArangoDB servers.
32233223

@@ -3233,31 +3233,31 @@ Possible Values:
32333233

32343234
### .spec.imagePullSecrets
32353235

3236-
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L89)</sup>
3236+
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L78)</sup>
32373237

32383238
ImagePullSecrets specifies the list of image pull secrets for the docker image to use for all ArangoDB servers.
32393239

32403240
***
32413241

32423242
### .spec.labels
32433243

3244-
Type: `object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L138)</sup>
3244+
Type: `object` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L127)</sup>
32453245

32463246
Labels specifies the labels added to Pods in this group.
32473247

32483248
***
32493249

32503250
### .spec.labelsIgnoreList
32513251

3252-
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L141)</sup>
3252+
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L130)</sup>
32533253

32543254
LabelsIgnoreList list regexp or plain definitions which labels should be ignored
32553255

32563256
***
32573257

32583258
### .spec.labelsMode
32593259

3260-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L147)</sup>
3260+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L136)</sup>
32613261

32623262
LabelsMode Define labels mode which should be use while overriding labels
32633263

@@ -3291,7 +3291,7 @@ Links:
32913291

32923292
### .spec.memberPropagationMode
32933293

3294-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L220)</sup>
3294+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L209)</sup>
32953295

32963296
MemberPropagationMode defines how changes to pod spec should be propogated.
32973297
Changes to a pod’s configuration require a restart of that pod in almost all cases.
@@ -3386,7 +3386,7 @@ Default Value: `true`
3 F438 3863386

33873387
### .spec.mode
33883388

3389-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L60)</sup>
3389+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L49)</sup>
33903390

33913391
Mode specifies the type of ArangoDB deployment to create.
33923392

@@ -3401,7 +3401,7 @@ This field is **immutable**: Change of the ArangoDeployment Mode is not possible
34013401

34023402
### .spec.networkAttachedVolumes
34033403

3404-
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L123)</sup>
3404+
Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L112)</sup>
34053405

34063406
NetworkAttachedVolumes
34073407
If set to `true`, a ResignLeadership operation will be triggered when a DB-Server pod is evicted (rather than a CleanOutServer operation).
@@ -3448,15 +3448,15 @@ Type: `boolean` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.
34483448

34493449
### .spec.restoreEncryptionSecret
34503450

3451-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L160)</sup>
3451+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L149)</sup>
34523452

34533453
RestoreEncryptionSecret specifies optional name of secret which contains encryption key used for restore
34543454

34553455
***
34563456

34573457
### .spec.restoreFrom
34583458

3459-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L157)</sup>
3459+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L146)</sup>
34603460

34613461
RestoreFrom setting specifies a `ArangoBackup` resource name the cluster should be restored from.
34623462
After a restore or failure to do so, the status of the deployment contains information about the restore operation in the restore key.
@@ -4390,7 +4390,7 @@ Links:
43904390

43914391
### .spec.storageEngine
43924392

4393-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L72)</sup>
4393+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L61)</sup>
43944394

43954395
StorageEngine specifies the type of storage engine used for all servers in the cluster.
43964396

@@ -6437,7 +6437,7 @@ MaintenanceGracePeriod action timeout
64376437

64386438
### .spec.timezone
64396439

6440-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L269)</sup>
6440+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/deployment/v1/deployment_spec.go#L258)</sup>
64416441

64426442
Timezone if specified, will set a timezone for deployment.
64436443
Must be in format accepted by "tzdata", e.g. `America/New_York` or `Europe/London`

docs/api/ArangoMLExtension.V1Alpha1.md

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@
22

33
## Spec
44

5+
### .spec.image
6+
7+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/image.go#L31)</sup>
8+
9+
Image define image details
10+
11+
***
12+
13+
### .spec.init.image
14+
15+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/image.go#L31)</sup>
16+
17+
Image define image details
18+
19+
***
20+
21+
### .spec.init.pullPolicy
22+
23+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/image.go#L35)</sup>
24+
25+
PullPolicy define Image pull policy
26+
27+
Default Value: `IfNotPresent`
28+
29+
***
30+
31+
### .spec.init.pullSecrets
32+
33+
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/image.go#L38)</sup>
34+
35+
PullSecrets define Secrets used to pull Image from registry
36+
37+
***
38+
539
### .spec.metadataService.local.arangoMLFeatureStore
640

741
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/ml/v1alpha1/extension_spec_metadata_service.go#L65)</sup>
@@ -22,11 +56,45 @@ Default Value: `arangopipe`
2256

2357
***
2458

25-
### .spec.storage
59+
### .spec.pullPolicy
60+
61+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/image.go#L35)</sup>
62+
63+
PullPolicy define Image pull policy
64+
65+
Default Value: `IfNotPresent`
66+
67+
***
68+
69+
### .spec.pullSecrets
70+
71+
Type: `array` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/image.go#L38)</sup>
72+
73+
PullSecrets define Secrets used to pull Image from registry
74+
75+
***
76+
77+
### .spec.storage.name
78+
79+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/object.go#L32)</sup>
80+
81+
Name of the object
82+
83+
***
84+
85+
### .spec.storage.namespace
86+
87+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/object.go#L35)</sup>
88+
89+
Namespace of the object. Should default to the namespace of the parent object
90+
91+
***
92+
93+
### .spec.storage.uid
2694

27-
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/ml/v1alpha1/extension_spec.go#L31)</sup>
95+
Type: `string` <sup>[\[ref\]](https://github.com/arangodb/kube-arangodb/blob/1.2.35/pkg/apis/shared/v1/object.go#L38)</sup>
2896

29-
Storage specify the ArangoMLStorage used within Extension
97+
UID keeps the information about object UID
3098

3199
## Status
32100

pkg/apis/deployment/v1/deployment_spec.go

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,6 @@ var (
3838
DefaultImage = "arangodb/arangodb:latest"
3939
)
4040

41-
// validatePullPolicy the image pull policy.
42-
// Return errors when validation fails, nil on success.
43-
func validatePullPolicy(v core.PullPolicy) error {
44-
switch v {
45-
case "", core.PullAlways, core.PullNever, core.PullIfNotPresent:
46-
return nil
47-
default:
48-
return errors.WithStack(errors.Wrapf(ValidationError, "Unknown pull policy: '%s'", string(v)))
49-
}
50-
}
51-
5241
// DeploymentSpec contains the spec part of a ArangoDeployment resource.
5342
type DeploymentSpec struct {
5443

@@ -509,11 +498,13 @@ func (s *DeploymentSpec) Validate() error {
509498
if err := s.GetStorageEngine().Validate(); err != nil {
510499
return errors.WithStack(errors.Wrap(err, "spec.storageEngine"))
511500
}
512-
if err := validatePullPolicy(s.GetImagePullPolicy()); err != nil {
513-
return errors.WithStack(errors.Wrap(err, "spec.imagePullPolicy"))
514-
}
515-
if s.GetImage() == "" {
516-
return errors.WithStack(errors.Wrapf(ValidationError, "spec.image must be set"))
501+
if s != nil {
502+
if err := shared.ValidateOptional(s.ImagePullPolicy, shared.ValidatePullPolicy); err != nil {
503+
return errors.WithStack(errors.Wrap(err, "spec.imagePullPolicy"))
504+
}
505+
if err := shared.ValidateOptional(s.Image, shared.ValidateImage); err != nil {
506+
return errors.WithStack(errors.Wrapf(err, "spec.image must be set"))
507+
}
517508
}
518509
if err := s.ExternalAccess.Validate(); err != nil {
519510
return errors.WithStack(errors.Wrap(err, "spec.externalAccess"))

pkg/apis/deployment/v2alpha1/deployment_spec.go

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,6 @@ var (
3838
DefaultImage = "arangodb/arangodb:latest"
3939
)
4040

41-
// validatePullPolicy the image pull policy.
42-
// Return errors when validation fails, nil on success.
43-
func validatePullPolicy(v core.PullPolicy) error {
44-
switch v {
45-
case "", core.PullAlways, core.PullNever, core.PullIfNotPresent:
46-
return nil
47-
default:
48-
return errors.WithStack(errors.Wrapf(ValidationError, "Unknown pull policy: '%s'", string(v)))
49-
}
50-
}
51-
5241
// DeploymentSpec contains the spec part of a ArangoDeployment resource.
5342
type DeploymentSpec struct {
5443

@@ -509,11 +498,13 @@ func (s *DeploymentSpec) Validate() error {
509498
if err := s.GetStorageEngine().Validate(); err != nil {
510499
return errors.WithStack(errors.Wrap(err, "spec.storageEngine"))
511500
}
512-
if err := validatePullPolicy(s.GetImagePullPolicy()); err != nil {
513-
return errors.WithStack(errors.Wrap(err, "spec.imagePullPolicy"))
514-
}
515-
if s.GetImage() == "" {
516-
return errors.WithStack(errors.Wrapf(ValidationError, "spec.image must be set"))
501+
if s != nil {
502+
if err := shared.ValidateOptional(s.ImagePullPolicy, shared.ValidatePullPolicy); err != nil {
503+
return errors.WithStack(errors.Wrap(err, "spec.imagePullPolicy"))
504+
}
505+
if err := shared.ValidateOptional(s.Image, shared.ValidateImage); err != nil {
506+
return errors.WithStack(errors.Wrapf(err, "spec.image must be set"))
507+
}
517508
}
518509
if err := s.ExternalAccess.Validate(); err != nil {
519510
return errors.WithStack(errors.Wrap(err, "spec.externalAccess"))

pkg/apis/ml/v1alpha1/extension_conditions.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
2525
const (
2626
ExtensionStorageFoundCondition api.ConditionType = "StorageFound"
2727
ExtensionDeploymentFoundCondition api.ConditionType = "DeploymentFound"
28+
ExtensionBootstrapCompletedCondition api.ConditionType = "BootstrapCompleted"
2829
ExtensionMetadataServiceValidCondition api.ConditionType = "MetadataServiceValid"
2930
LicenseValidCondition api.ConditionType = "LicenseValid"
3031
)

0 commit comments

Comments
 (0)
0