Skip to content

Commit 11dbcdf

Browse files
committed
feat: init cluster & pool & node & nodeClass custom resources
1 parent b9746bf commit 11dbcdf

30 files changed

+1512
-0
lines changed

PROJECT

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,36 @@ resources:
3030
version: v1
3131
webhooks:
3232
webhookVersion: v1
33+
- api:
34+
crdVersion: v1
35+
namespaced: true
36+
controller: true
37+
domain: tensor-fusion.ai
38+
kind: TensorFusionCluster
39+
path: github.com/NexusGPU/tensor-fusion-operator/api/v1
40+
version: v1
41+
- api:
42+
crdVersion: v1
43+
namespaced: true
44+
controller: true
45+
domain: tensor-fusion.ai
46+
kind: GPUPool
47+
path: github.com/NexusGPU/tensor-fusion-operator/api/v1
48+
version: v1
49+
- api:
50+
crdVersion: v1
51+
namespaced: true
52+
controller: true
53+
domain: tensor-fusion.ai
54+
kind: GPUNode
55+
path: github.com/NexusGPU/tensor-fusion-operator/api/v1
56+
version: v1
57+
- api:
58+
crdVersion: v1
59+
namespaced: true
60+
controller: true
61+
domain: tensor-fusion.ai
62+
kind: GPUNodeClass
63+
path: github.com/NexusGPU/tensor-fusion-operator/api/v1
64+
version: v1
3365
version: "3"

api/v1/gpunode_types.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
Copyright 2024.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25+
26+
// GPUNodeSpec defines the desired state of GPUNode.
27+
type GPUNodeSpec struct {
28+
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
29+
// Important: Run "make" to regenerate code after modifying this file
30+
31+
// Foo is an example field of GPUNode. Edit gpunode_types.go to remove/update
32+
Foo string `json:"foo,omitempty"`
33+
}
34+
35+
// GPUNodeStatus defines the observed state of GPUNode.
36+
type GPUNodeStatus struct {
37+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
38+
// Important: Run "make" to regenerate code after modifying this file
39+
}
40+
41+
// +kubebuilder:object:root=true
42+
// +kubebuilder:subresource:status
43+
44+
// GPUNode is the Schema for the gpunodes API.
45+
type GPUNode struct {
46+
metav1.TypeMeta `json:",inline"`
47+
metav1.ObjectMeta `json:"metadata,omitempty"`
48+
49+
Spec GPUNodeSpec `json:"spec,omitempty"`
50+
Status GPUNodeStatus `json:"status,omitempty"`
51+
}
52+
53+
// +kubebuilder:object:root=true
54+
55+
// GPUNodeList contains a list of GPUNode.
56+
type GPUNodeList struct {
57+
metav1.TypeMeta `json:",inline"`
58+
metav1.ListMeta `json:"metadata,omitempty"`
59+
Items []GPUNode `json:"items"`
60+
}
61+
62+
func init() {
63+
SchemeBuilder.Register(&GPUNode{}, &GPUNodeList{})
64+
}

api/v1/gpunodeclass_types.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
Copyright 2024.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25+
26+
// GPUNodeClassSpec defines the desired state of GPUNodeClass.
27+
type GPUNodeClassSpec struct {
28+
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
29+
// Important: Run "make" to regenerate code after modifying this file
30+
31+
// Foo is an example field of GPUNodeClass. Edit gpunodeclass_types.go to remove/update
32+
Foo string `json:"foo,omitempty"`
33+
}
34+
35+
// GPUNodeClassStatus defines the observed state of GPUNodeClass.
36+
type GPUNodeClassStatus struct {
37+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
38+
// Important: Run "make" to regenerate code after modifying this file
39+
}
40+
41+
// +kubebuilder:object:root=true
42+
// +kubebuilder:subresource:status
43+
44+
// GPUNodeClass is the Schema for the gpunodeclasses API.
45+
type GPUNodeClass struct {
46+
metav1.TypeMeta `json:",inline"`
47+
metav1.ObjectMeta `json:"metadata,omitempty"`
48+
49+
Spec GPUNodeClassSpec `json:"spec,omitempty"`
50+
Status GPUNodeClassStatus `json:"status,omitempty"`
51+
}
52+
53+
// +kubebuilder:object:root=true
54+
55+
// GPUNodeClassList contains a list of GPUNodeClass.
56+
type GPUNodeClassList struct {
57+
metav1.TypeMeta `json:",inline"`
58+
metav1.ListMeta `json:"metadata,omitempty"`
59+
Items []GPUNodeClass `json:"items"`
60+
}
61+
62+
func init() {
63+
SchemeBuilder.Register(&GPUNodeClass{}, &GPUNodeClassList{})
64+
}

api/v1/gpupool_types.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
Copyright 2024.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25+
26+
// GPUPoolSpec defines the desired state of GPUPool.
27+
type GPUPoolSpec struct {
28+
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
29+
// Important: Run "make" to regenerate code after modifying this file
30+
31+
// Foo is an example field of GPUPool. Edit gpupool_types.go to remove/update
32+
Foo string `json:"foo,omitempty"`
33+
}
34+
35+
// GPUPoolStatus defines the observed state of GPUPool.
36+
type GPUPoolStatus struct {
37+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
38+
// Important: Run "make" to regenerate code after modifying this file
39+
}
40+
41+
// +kubebuilder:object:root=true
42+
// +kubebuilder:subresource:status
43+
44+
// GPUPool is the Schema for the gpupools API.
45+
type GPUPool struct {
46+
metav1.TypeMeta `json:",inline"`
47+
metav1.ObjectMeta `json:"metadata,omitempty"`
48+
49+
Spec GPUPoolSpec `json:"spec,omitempty"`
50+
Status GPUPoolStatus `json:"status,omitempty"`
51+
}
52+
53+
// +kubebuilder:object:root=true
54+
55+
// GPUPoolList contains a list of GPUPool.
56+
type GPUPoolList struct {
57+
metav1.TypeMeta `json:",inline"`
58+
metav1.ListMeta `json:"metadata,omitempty"`
59+
Items []GPUPool `json:"items"`
60+
}
61+
62+
func init() {
63+
SchemeBuilder.Register(&GPUPool{}, &GPUPoolList{})
64+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
Copyright 2024.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1
18+
19+
import (
20+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21+
)
22+
23+
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
24+
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
25+
26+
// TensorFusionClusterSpec defines the desired state of TensorFusionCluster.
27+
type TensorFusionClusterSpec struct {
28+
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
29+
// Important: Run "make" to regenerate code after modifying this file
30+
31+
// Foo is an example field of TensorFusionCluster. Edit tensorfusioncluster_types.go to remove/update
32+
Foo string `json:"foo,omitempty"`
33+
}
34+
35+
// TensorFusionClusterStatus defines the observed state of TensorFusionCluster.
36+
type TensorFusionClusterStatus struct {
37+
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
38+
// Important: Run "make" to regenerate code after modifying this file
39+
}
40+
41+
// +kubebuilder:object:root=true
42+
// +kubebuilder:subresource:status
43+
44+
// TensorFusionCluster is the Schema for the tensorfusionclusters API.
45+
type TensorFusionCluster struct {
46+
metav1.TypeMeta `json:",inline"`
47+
metav1.ObjectMeta `json:"metadata,omitempty"`
48+
49+
Spec TensorFusionClusterSpec `json:"spec,omitempty"`
50+
Status TensorFusionClusterStatus `json:"status,omitempty"`
51+
}
52+
53+
// +kubebuilder:object:root=true
54+
55+
// TensorFusionClusterList contains a list of TensorFusionCluster.
56+
type TensorFusionClusterList struct {
57+
metav1.TypeMeta `json:",inline"`
58+
metav1.ListMeta `json:"metadata,omitempty"`
59+
Items []TensorFusionCluster `json:"items"`
60+
}
61+
62+
func init() {
63+
SchemeBuilder.Register(&TensorFusionCluster{}, &TensorFusionClusterList{})
64+
}

0 commit comments

Comments
 (0)