Skip to content

Commit

Permalink
New CRDs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajanikow committed Nov 2, 2023
1 parent 0c94481 commit 3bd982e
Show file tree
Hide file tree
Showing 36 changed files with 1,742 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ CRDS:=apps-job \
backups-backup backups-backuppolicy \
database-clustersynchronization database-deployment database-member database-task \
replication-deploymentreplication \
ml-storage ml-integration
ml-storage ml-extension ml-job-batch ml-job-cron

.PHONY: sync-crds
sync-crds:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangomlintegrations.ml.arangodb.com
name: arangomlextensions.ml.arangodb.com
spec:
group: ml.arangodb.com
names:
kind: ArangoMLIntegration
listKind: ArangoMLIntegrationList
plural: arangomlintegrations
singular: arangomlintegration
kind: ArangoMLExtension
listKind: ArangoMLExtensionList
plural: arangomlextensions
singular: arangomlextension
scope: Namespaced
versions:
- name: v1alpha1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangomlintegrations.ml.arangodb.com
name: arangomlbatchjobs.ml.arangodb.com
spec:
group: ml.arangodb.com
names:
kind: ArangoMLIntegration
listKind: ArangoMLIntegrationList
plural: arangomlintegrations
singular: arangomlintegration
kind: ArangoMLBatchJob
listKind: ArangoMLBatchJobList
plural: arangomlbatchjobs
singular: arangomlbatchjob
scope: Namespaced
versions:
- name: v1alpha1
Expand Down
22 changes: 22 additions & 0 deletions chart/kube-arangodb/crds/ml-job-cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: arangomlcronjobs.ml.arangodb.com
spec:
group: ml.arangodb.com
names:
kind: ArangoMLCronJob
listKind: ArangoMLCronJobList
plural: arangomlcronjobs
singular: arangomlcronjob
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
served: true
storage: true
subresources:
status: {}
14 changes: 11 additions & 3 deletions pkg/apis/ml/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ const (
ArangoMLStorageResourceKind = "ArangoMLStorage"
ArangoMLStorageResourcePlural = "arangomlstorages"

ArangoMLIntegrationCRDName = ArangoMLIntegrationResourcePlural + "." + ArangoMLGroupName
ArangoMLIntegrationResourceKind = "ArangoMLIntegration"
ArangoMLIntegrationResourcePlural = "arangomlintegrations"
ArangoMLExtensionCRDName = ArangoMLExtensionResourcePlural + "." + ArangoMLGroupName
ArangoMLExtensionResourceKind = "ArangoMLExtension"
ArangoMLExtensionResourcePlural = "arangomlextensions"

ArangoMLBatchJobCRDName = ArangoMLBatchJobResourcePlural + "." + ArangoMLGroupName
ArangoMLBatchJobResourceKind = "ArangoMLBatchJob"
ArangoMLBatchJobResourcePlural = "arangomlbatchjobs"

ArangoMLCronJobCRDName = ArangoMLCronJobResourcePlural + "." + ArangoMLGroupName
ArangoMLCronJobResourceKind = "ArangoMLCronJob"
ArangoMLCronJobResourcePlural = "arangomlcronjobs"

ArangoMLGroupName = "ml.arangodb.com"
)
47 changes: 47 additions & 0 deletions pkg/apis/ml/v1alpha1/batchjob.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package v1alpha1

import (
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ArangoMLBatchJobList is a list of ArangoML BatchJobs.
type ArangoMLBatchJobList struct {
meta.TypeMeta `json:",inline"`
meta.ListMeta `json:"metadata,omitempty"`

Items []ArangoMLBatchJob `json:"items"`
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ArangoMLBatchJob contains definition and status of the ArangoML BatchJob.
type ArangoMLBatchJob struct {
meta.TypeMeta `json:",inline"`
meta.ObjectMeta `json:"metadata,omitempty"`

Spec ArangoMLBatchJobSpec `json:"spec"`
Status ArangoMLBatchJobStatus `json:"status"`
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,12 +18,7 @@
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package crd
package v1alpha1

import (
"github.com/arangodb/kube-arangodb/pkg/crd/crds"
)

func init() {
registerCRDWithPanic(crds.MLIntegrationDefinition())
type ArangoMLBatchJobSpec struct {
}
24 changes: 24 additions & 0 deletions pkg/apis/ml/v1alpha1/batchjob_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package v1alpha1

type ArangoMLBatchJobStatus struct {
}
47 changes: 47 additions & 0 deletions pkg/apis/ml/v1alpha1/cronjob.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package v1alpha1

import (
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ArangoMLCronJobList is a list of ArangoML CronJobs.
type ArangoMLCronJobList struct {
meta.TypeMeta `json:",inline"`
meta.ListMeta `json:"metadata,omitempty"`

Items []ArangoMLCronJob `json:"items"`
}

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ArangoMLCronJob contains definition and status of the ArangoML CronJob.
type ArangoMLCronJob struct {
meta.TypeMeta `json:",inline"`
meta.ObjectMeta `json:"metadata,omitempty"`

Spec ArangoMLCronJobSpec `json:"spec"`
Status ArangoMLCronJobStatus `json:"status"`
}
24 changes: 24 additions & 0 deletions pkg/apis/ml/v1alpha1/cronjob_spec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package v1alpha1

type ArangoMLCronJobSpec struct {
}
24 changes: 24 additions & 0 deletions pkg/apis/ml/v1alpha1/cronjob_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// DISCLAIMER
//
// Copyright 2023 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//

package v1alpha1

type ArangoMLCronJobStatus struct {
}
6 changes: 5 additions & 1 deletion pkg/apis/ml/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ func addKnownTypes(s *runtime.Scheme) error {
&ArangoMLStorage{},
&ArangoMLStorageList{},
&ArangoMLExtension{},
&ArangoMLExtensionList{})
&ArangoMLExtensionList{},
&ArangoMLBatchJob{},
&ArangoMLBatchJobList{},
&ArangoMLCronJob{},
&ArangoMLCronJobList{})
meta.AddToGroupVersion(s, SchemeGroupVersion)
return nil
}
Loading

0 comments on commit 3bd982e

Please sign in to comment.