Skip to content

Commit ade38f8

Browse files
committed
feat: rename from 'GPUNode' to 'GPU'
1 parent 2935d3d commit ade38f8

22 files changed

+206
-220
lines changed

PROJECT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ resources:
2020
crdVersion: v1
2121
controller: true
2222
domain: tensor-fusion.ai
23-
kind: GPUNode
23+
kind: GPU
2424
path: github.com/NexusGPU/tensor-fusion-operator/api/v1
2525
version: v1
2626
- core: true

api/v1/gpunode_types.go renamed to api/v1/gpu_types.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,32 @@ import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
)
2222

23-
// GPUNodeStatus defines the observed state of GPUNode.
24-
type GPUNodeStatus struct {
23+
// GPUStatus defines the observed state of GPU.
24+
type GPUStatus struct {
2525
Capacity Resource `json:"capacity"`
2626
Available Resource `json:"available"`
27-
Devices []string `json:"devices"`
2827
}
2928

3029
// +kubebuilder:object:root=true
3130
// +kubebuilder:subresource:status
3231
// +kubebuilder:resource:scope=Cluster
33-
// GPUNode is the Schema for the gpunodes API.
34-
type GPUNode struct {
32+
// GPU is the Schema for the gpus API.
33+
type GPU struct {
3534
metav1.TypeMeta `json:",inline"`
3635
metav1.ObjectMeta `json:"metadata,omitempty"`
3736

38-
Status GPUNodeStatus `json:"status,omitempty"`
37+
Status GPUStatus `json:"status,omitempty"`
3938
}
4039

4140
// +kubebuilder:object:root=true
4241

43-
// GPUNodeList contains a list of GPUNode.
44-
type GPUNodeList struct {
42+
// GPUList contains a list of GPU.
43+
type GPUList struct {
4544
metav1.TypeMeta `json:",inline"`
4645
metav1.ListMeta `json:"metadata,omitempty"`
47-
Items []GPUNode `json:"items"`
46+
Items []GPU `json:"items"`
4847
}
4948

5049
func init() {
51-
SchemeBuilder.Register(&GPUNode{}, &GPUNodeList{})
50+
SchemeBuilder.Register(&GPU{}, &GPUList{})
5251
}

api/v1/tensorfusionconnection_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type TensorFusionConnectionStatus struct {
4949
Phase TensorFusionConnectionPhase `json:"phase"`
5050
ConnectionURL string `json:"connectionURL"`
5151
QosClass string `json:"qosClass,omitempty"`
52-
Node string `json:"node,omitempty"`
52+
GPU string `json:"gpu,omitempty"`
5353
}
5454

5555
// +kubebuilder:object:root=true

api/v1/zz_generated.deepcopy.go

Lines changed: 15 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ func main() {
162162
os.Exit(1)
163163
}
164164

165-
if err = (&controller.GPUNodeReconciler{
165+
if err = (&controller.GPUReconciler{
166166
Client: mgr.GetClient(),
167167
Scheme: mgr.GetScheme(),
168168
Scheduler: scheduler,
169169
}).SetupWithManager(ctx, mgr); err != nil {
170-
setupLog.Error(err, "unable to create controller", "controller", "GPUNode")
170+
setupLog.Error(err, "unable to create controller", "controller", "GPU")
171171
os.Exit(1)
172172
}
173173

config/crd/bases/tensor-fusion.ai_gpunodes.yaml renamed to config/crd/bases/tensor-fusion.ai_gpus.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.16.4
7-
name: gpunodes.tensor-fusion.ai
7+
name: gpus.tensor-fusion.ai
88
spec:
99
group: tensor-fusion.ai
1010
names:
11-
kind: GPUNode
12-
listKind: GPUNodeList
13-
plural: gpunodes
14-
singular: gpunode
11+
kind: GPU
12+
listKind: GPUList
13+
plural: gpus
14+
singular: gpu
1515
scope: Cluster
1616
versions:
1717
- name: v1
1818
schema:
1919
openAPIV3Schema:
20-
description: GPUNode is the Schema for the gpunodes API.
20+
description: GPU is the Schema for the gpus API.
2121
properties:
2222
apiVersion:
2323
description: |-
@@ -37,7 +37,7 @@ spec:
3737
metadata:
3838
type: object
3939
status:
40-
description: GPUNodeStatus defines the observed state of GPUNode.
40+
description: GPUStatus defines the observed state of GPU.
4141
properties:
4242
available:
4343
properties:
@@ -75,14 +75,9 @@ spec:
7575
- tflops
7676
- vram
7777
type: object
78-
devices:
79-
items:
80-
type: string
81-
type: array
8278
required:
8379
- available
8480
- capacity
85-
- devices
8681
type: object
8782
type: object
8883
served: true

config/crd/bases/tensor-fusion.ai_tensorfusionconnections.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
properties:
4343
resources:
4444
properties:
45-
limit:
45+
limits:
4646
properties:
4747
tflops:
4848
anyOf:
@@ -60,7 +60,7 @@ spec:
6060
- tflops
6161
- vram
6262
type: object
63-
request:
63+
requests:
6464
properties:
6565
tflops:
6666
anyOf:
@@ -79,8 +79,8 @@ spec:
7979
- vram
8080
type: object
8181
required:
82-
- limit
83-
- request
82+
- limits
83+
- requests
8484
type: object
8585
required:
8686
- resources

config/crd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# It should be run by config/default
44
resources:
55
- bases/tensor-fusion.ai_tensorfusionconnections.yaml
6-
- bases/tensor-fusion.ai_gpunodes.yaml
6+
- bases/tensor-fusion.ai_gpus.yaml
77
# +kubebuilder:scaffold:crdkustomizeresource
88

99
patches:
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# permissions for end users to edit gpunodes.
1+
# permissions for end users to edit gpus.
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
55
labels:
66
app.kubernetes.io/name: tensor-fusion-operator
77
app.kubernetes.io/managed-by: kustomize
8-
name: gpunode-editor-role
8+
name: gpu-editor-role
99
rules:
1010
- apiGroups:
1111
- tensor-fusion.ai
1212
resources:
13-
- gpunodes
13+
- gpus
1414
verbs:
1515
- create
1616
- delete
@@ -22,6 +22,6 @@ rules:
2222
- apiGroups:
2323
- tensor-fusion.ai
2424
resources:
25-
- gpunodes/status
25+
- gpus/status
2626
verbs:
2727
- get
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
# permissions for end users to view gpunodes.
1+
# permissions for end users to view gpus.
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
55
labels:
66
app.kubernetes.io/name: tensor-fusion-operator
77
app.kubernetes.io/managed-by: kustomize
8-
name: gpunode-viewer-role
8+
name: gpu-viewer-role
99
rules:
1010
- apiGroups:
1111
- tensor-fusion.ai
1212
resources:
13-
- gpunodes
13+
- gpus
1414
verbs:
1515
- get
1616
- list
1717
- watch
1818
- apiGroups:
1919
- tensor-fusion.ai
2020
resources:
21-
- gpunodes/status
21+
- gpus/status
2222
verbs:
2323
- get

0 commit comments

Comments
 (0)