Skip to content

Commit 20fc66d

Browse files
authored
add some field for OpenModel Playground Service (#464)
Signed-off-by: googs1025 <googs1025@gmail.com>
1 parent 93bb8e7 commit 20fc66d

22 files changed

Lines changed: 164 additions & 22 deletions

api/core/v1alpha1/model_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ type ModelStatus struct {
228228
//+kubebuilder:object:root=true
229229
//+kubebuilder:subresource:status
230230
//+kubebuilder:resource:shortName=om,scope=Cluster
231+
//+kubebuilder:printcolumn:name="OWNEDBY",type=string,JSONPath=`.spec.ownedBy`,description="Owner of the model"
232+
//+kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp`,description="Time since creation"
233+
//+kubebuilder:printcolumn:name="MODELHUB",type=string,JSONPath=`.spec.source.modelHub.name`,description="Model hub name"
234+
//+kubebuilder:printcolumn:name="MODELID",type=string,JSONPath=`.spec.source.modelHub.modelID`,description="Model ID on the model hub"
235+
//+kubebuilder:printcolumn:name="URI",type=string,JSONPath=`.spec.source.uri`,description="URI of the model when using a custom source (e.g., s3://, ollama://)"
231236

232237
// OpenModel is the Schema for the open models API
233238
type OpenModel struct {

api/inference/v1alpha1/playground_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ type PlaygroundStatus struct {
9393
//+kubebuilder:subresource:status
9494
//+kubebuilder:resource:shortName={pl}
9595
//+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
96+
//+kubebuilder:printcolumn:name="MODEL",type=string,JSONPath=`.spec.modelClaim.modelName`,description="Model used in the Playground"
97+
//+kubebuilder:printcolumn:name="REPLICAS",type=integer,JSONPath=`.status.replicas`,description="Current number of replicas"
98+
//+kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.conditions[?(@.type=='Available')].reason`,description="Current status (Available/Progressing)"
99+
//+kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp`,description="Time since creation"
96100

97101
// Playground is the Schema for the playgrounds API
98102
type Playground struct {

api/inference/v1alpha1/service_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ type ServiceStatus struct {
7373
//+kubebuilder:subresource:status
7474
//+kubebuilder:resource:shortName={isvc}
7575
//+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
76+
//+kubebuilder:printcolumn:name="NAME",type=string,JSONPath=`.metadata.name`,description="Name of the Inference Service"
77+
//+kubebuilder:printcolumn:name="REPLICAS",type=integer,JSONPath=`.status.replicas`,description="Current number of replicas"
78+
//+kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.conditions[?(@.type=='Available')].reason`,description="Current status (Available/Progressing)"
79+
//+kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp`,description="Time since creation"
7680

7781
// Service is the Schema for the services API
7882
type Service struct {

chart/crds/backendruntime-crd.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,4 +1601,3 @@ spec:
16011601
storage: true
16021602
subresources:
16031603
status: {}
1604-

chart/crds/openmodel-crd.yaml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,28 @@ spec:
2525
singular: openmodel
2626
scope: Cluster
2727
versions:
28-
- name: v1alpha1
28+
- additionalPrinterColumns:
29+
- description: Owner of the model
30+
jsonPath: .spec.ownedBy
31+
name: OWNEDBY
32+
type: string
33+
- description: Time since creation
34+
jsonPath: .metadata.creationTimestamp
35+
name: AGE
36+
type: date
37+
- description: Model hub name
38+
jsonPath: .spec.source.modelHub.name
39+
name: MODELHUB
40+
type: string
41+
- description: Model ID on the model hub
42+
jsonPath: .spec.source.modelHub.modelID
43+
name: MODELID
44+
type: string
45+
- description: URI of the model when using a custom source (e.g., s3://, ollama://)
46+
jsonPath: .spec.source.uri
47+
name: URI
48+
type: string
49+
name: v1alpha1
2950
schema:
3051
openAPIV3Schema:
3152
description: OpenModel is the Schema for the open models API
@@ -50,6 +71,13 @@ spec:
5071
spec:
5172
description: ModelSpec defines the desired state of Model
5273
properties:
74+
createdAt:
75+
description: |-
76+
CreatedAt represents the creation timestamp of the running models serving by the backends,
77+
which will be exported as the field of "Created" in openai-compatible API "/models".
78+
It follows the format of RFC 3339, for example "2024-05-21T10:00:00Z".
79+
format: date-time
80+
type: string
5381
familyName:
5482
description: |-
5583
FamilyName represents the model type, like llama2, which will be auto injected
@@ -115,6 +143,13 @@ spec:
115143
maxItems: 8
116144
type: array
117145
type: object
146+
ownedBy:
147+
default: llmaz
148+
description: |-
149+
OwnedBy represents the owner of the running models serving by the backends,
150+
which will be exported as the field of "OwnedBy" in openai-compatible API "/models".
151+
Default to "llmaz" if not set.
152+
type: string
118153
source:
119154
description: |-
120155
Source represents the source of the model, there're several ways to load
@@ -240,4 +275,3 @@ spec:
240275
storage: true
241276
subresources:
242277
status: {}
243-

chart/crds/playground-crd.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,24 @@ spec:
1515
singular: playground
1616
scope: Namespaced
1717
versions:
18-
- name: v1alpha1
18+
- additionalPrinterColumns:
19+
- description: Model used in the Playground
20+
jsonPath: .spec.modelClaim.modelName
21+
name: MODEL
22+
type: string
23+
- description: Current number of replicas
24+
jsonPath: .status.replicas
25+
name: REPLICAS
26+
type: integer
27+
- description: Current status (Available/Progressing)
28+
jsonPath: .status.conditions[?(@.type=='Available')].reason
29+
name: STATUS
30+
type: string
31+
- description: Time since creation
32+
jsonPath: .metadata.creationTimestamp
33+
name: AGE
34+
type: date
35+
name: v1alpha1
1936
schema:
2037
openAPIV3Schema:
2138
description: Playground is the Schema for the playgrounds API
@@ -1017,4 +1034,3 @@ spec:
10171034
specReplicasPath: .spec.replicas
10181035
statusReplicasPath: .status.replicas
10191036
status: {}
1020-

chart/crds/service-crd.yaml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,24 @@ spec:
1515
singular: service
1616
scope: Namespaced
1717
versions:
18-
- name: v1alpha1
18+
- additionalPrinterColumns:
19+
- description: Name of the Inference Service
20+
jsonPath: .metadata.name
21+
name: NAME
22+
type: string
23+
- description: Current number of replicas
24+
jsonPath: .status.replicas
25+
name: REPLICAS
26+
type: integer
27+
- description: Current status (Available/Progressing)
28+
jsonPath: .status.conditions[?(@.type=='Available')].reason
29+
name: STATUS
30+
type: string
31+
- description: Time since creation
32+
jsonPath: .metadata.creationTimestamp
33+
name: AGE
34+
type: date
35+
name: v1alpha1
1936
schema:
2037
openAPIV3Schema:
2138
description: Service is the Schema for the services API
@@ -8300,6 +8317,15 @@ spec:
83008317
SubGroupPolicy describes the policy that will be applied when creating subgroups
83018318
in each replica.
83028319
properties:
8320+
subGroupPolicyType:
8321+
default: LeaderWorker
8322+
description: |-
8323+
Defines what type of Subgroups to create. Defaults to
8324+
LeaderWorker
8325+
enum:
8326+
- LeaderWorker
8327+
- LeaderExcluded
8328+
type: string
83038329
subGroupSize:
83048330
description: |-
83058331
The number of pods per subgroup. This value is immutable,
@@ -16520,4 +16546,3 @@ spec:
1652016546
specReplicasPath: .spec.replicas
1652116547
statusReplicasPath: .status.replicas
1652216548
status: {}
16523-

chart/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ spec:
6767
- name: cert
6868
secret:
6969
defaultMode: 420
70-
secretName: {{ include "chart.fullname" . }}-webhook-server-cert
70+
secretName: {{ include "chart.fullname" . }}-webhook-server-cert

chart/templates/global-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ metadata:
55
labels:
66
{{- include "chart.labels" . | nindent 4 }}
77
data:
8-
config.data: {{ .Values.globalConfig.configData | toYaml | indent 1 }}
8+
config.data: {{ .Values.globalConfig.configData | toYaml | indent 1 }}

chart/templates/leader-election-rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ roleRef:
5656
subjects:
5757
- kind: ServiceAccount
5858
name: '{{ include "chart.fullname" . }}-controller-manager'
59-
namespace: '{{ .Release.Namespace }}'
59+
namespace: '{{ .Release.Namespace }}'

0 commit comments

Comments
 (0)