From f7104f5f78f7550e7273c52b6dc9a8fafd3d56ec Mon Sep 17 00:00:00 2001 From: googs1025 Date: Wed, 18 Jun 2025 11:56:44 +0800 Subject: [PATCH] add some field for OpenModel Playground Service Signed-off-by: googs1025 --- api/core/v1alpha1/model_types.go | 5 +++ api/inference/v1alpha1/playground_types.go | 4 ++ api/inference/v1alpha1/service_types.go | 4 ++ chart/crds/backendruntime-crd.yaml | 1 - chart/crds/openmodel-crd.yaml | 38 ++++++++++++++++++- chart/crds/playground-crd.yaml | 20 +++++++++- chart/crds/service-crd.yaml | 29 +++++++++++++- chart/templates/deployment.yaml | 2 +- chart/templates/global-config.yaml | 2 +- chart/templates/leader-election-rbac.yaml | 2 +- chart/templates/manager-rbac.yaml | 2 +- chart/templates/metrics-reader-rbac.yaml | 2 +- chart/templates/metrics-service.yaml | 2 +- .../mutating-webhook-configuration.yaml | 2 +- chart/templates/proxy-rbac.yaml | 2 +- chart/templates/serviceaccount.yaml | 2 +- .../validating-webhook-configuration.yaml | 2 +- chart/templates/webhook-server-cert.yaml | 2 +- chart/templates/webhook-service.yaml | 2 +- .../bases/inference.llmaz.io_playgrounds.yaml | 19 +++++++++- .../bases/inference.llmaz.io_services.yaml | 19 +++++++++- config/crd/bases/llmaz.io_openmodels.yaml | 23 ++++++++++- 22 files changed, 164 insertions(+), 22 deletions(-) diff --git a/api/core/v1alpha1/model_types.go b/api/core/v1alpha1/model_types.go index 92451457..7f4a997f 100644 --- a/api/core/v1alpha1/model_types.go +++ b/api/core/v1alpha1/model_types.go @@ -228,6 +228,11 @@ type ModelStatus struct { //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:resource:shortName=om,scope=Cluster +//+kubebuilder:printcolumn:name="OWNEDBY",type=string,JSONPath=`.spec.ownedBy`,description="Owner of the model" +//+kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp`,description="Time since creation" +//+kubebuilder:printcolumn:name="MODELHUB",type=string,JSONPath=`.spec.source.modelHub.name`,description="Model hub name" +//+kubebuilder:printcolumn:name="MODELID",type=string,JSONPath=`.spec.source.modelHub.modelID`,description="Model ID on the model hub" +//+kubebuilder:printcolumn:name="URI",type=string,JSONPath=`.spec.source.uri`,description="URI of the model when using a custom source (e.g., s3://, ollama://)" // OpenModel is the Schema for the open models API type OpenModel struct { diff --git a/api/inference/v1alpha1/playground_types.go b/api/inference/v1alpha1/playground_types.go index 11ebcc81..8951213b 100644 --- a/api/inference/v1alpha1/playground_types.go +++ b/api/inference/v1alpha1/playground_types.go @@ -93,6 +93,10 @@ type PlaygroundStatus struct { //+kubebuilder:subresource:status //+kubebuilder:resource:shortName={pl} //+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector +//+kubebuilder:printcolumn:name="MODEL",type=string,JSONPath=`.spec.modelClaim.modelName`,description="Model used in the Playground" +//+kubebuilder:printcolumn:name="REPLICAS",type=integer,JSONPath=`.status.replicas`,description="Current number of replicas" +//+kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.conditions[?(@.type=='Available')].reason`,description="Current status (Available/Progressing)" +//+kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp`,description="Time since creation" // Playground is the Schema for the playgrounds API type Playground struct { diff --git a/api/inference/v1alpha1/service_types.go b/api/inference/v1alpha1/service_types.go index b29cce3c..8781e967 100644 --- a/api/inference/v1alpha1/service_types.go +++ b/api/inference/v1alpha1/service_types.go @@ -73,6 +73,10 @@ type ServiceStatus struct { //+kubebuilder:subresource:status //+kubebuilder:resource:shortName={isvc} //+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector +//+kubebuilder:printcolumn:name="NAME",type=string,JSONPath=`.metadata.name`,description="Name of the Inference Service" +//+kubebuilder:printcolumn:name="REPLICAS",type=integer,JSONPath=`.status.replicas`,description="Current number of replicas" +//+kubebuilder:printcolumn:name="STATUS",type=string,JSONPath=`.status.conditions[?(@.type=='Available')].reason`,description="Current status (Available/Progressing)" +//+kubebuilder:printcolumn:name="AGE",type=date,JSONPath=`.metadata.creationTimestamp`,description="Time since creation" // Service is the Schema for the services API type Service struct { diff --git a/chart/crds/backendruntime-crd.yaml b/chart/crds/backendruntime-crd.yaml index 79e420e5..29222c6c 100644 --- a/chart/crds/backendruntime-crd.yaml +++ b/chart/crds/backendruntime-crd.yaml @@ -1601,4 +1601,3 @@ spec: storage: true subresources: status: {} - diff --git a/chart/crds/openmodel-crd.yaml b/chart/crds/openmodel-crd.yaml index 001f8100..2d21c8c8 100644 --- a/chart/crds/openmodel-crd.yaml +++ b/chart/crds/openmodel-crd.yaml @@ -25,7 +25,28 @@ spec: singular: openmodel scope: Cluster versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: Owner of the model + jsonPath: .spec.ownedBy + name: OWNEDBY + type: string + - description: Time since creation + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - description: Model hub name + jsonPath: .spec.source.modelHub.name + name: MODELHUB + type: string + - description: Model ID on the model hub + jsonPath: .spec.source.modelHub.modelID + name: MODELID + type: string + - description: URI of the model when using a custom source (e.g., s3://, ollama://) + jsonPath: .spec.source.uri + name: URI + type: string + name: v1alpha1 schema: openAPIV3Schema: description: OpenModel is the Schema for the open models API @@ -50,6 +71,13 @@ spec: spec: description: ModelSpec defines the desired state of Model properties: + createdAt: + description: |- + CreatedAt represents the creation timestamp of the running models serving by the backends, + which will be exported as the field of "Created" in openai-compatible API "/models". + It follows the format of RFC 3339, for example "2024-05-21T10:00:00Z". + format: date-time + type: string familyName: description: |- FamilyName represents the model type, like llama2, which will be auto injected @@ -115,6 +143,13 @@ spec: maxItems: 8 type: array type: object + ownedBy: + default: llmaz + description: |- + OwnedBy represents the owner of the running models serving by the backends, + which will be exported as the field of "OwnedBy" in openai-compatible API "/models". + Default to "llmaz" if not set. + type: string source: description: |- Source represents the source of the model, there're several ways to load @@ -240,4 +275,3 @@ spec: storage: true subresources: status: {} - diff --git a/chart/crds/playground-crd.yaml b/chart/crds/playground-crd.yaml index 5a061bc1..7f559b6c 100644 --- a/chart/crds/playground-crd.yaml +++ b/chart/crds/playground-crd.yaml @@ -15,7 +15,24 @@ spec: singular: playground scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: Model used in the Playground + jsonPath: .spec.modelClaim.modelName + name: MODEL + type: string + - description: Current number of replicas + jsonPath: .status.replicas + name: REPLICAS + type: integer + - description: Current status (Available/Progressing) + jsonPath: .status.conditions[?(@.type=='Available')].reason + name: STATUS + type: string + - description: Time since creation + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: Playground is the Schema for the playgrounds API @@ -1017,4 +1034,3 @@ spec: specReplicasPath: .spec.replicas statusReplicasPath: .status.replicas status: {} - diff --git a/chart/crds/service-crd.yaml b/chart/crds/service-crd.yaml index 740d8e12..13c12c2c 100644 --- a/chart/crds/service-crd.yaml +++ b/chart/crds/service-crd.yaml @@ -15,7 +15,24 @@ spec: singular: service scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: Name of the Inference Service + jsonPath: .metadata.name + name: NAME + type: string + - description: Current number of replicas + jsonPath: .status.replicas + name: REPLICAS + type: integer + - description: Current status (Available/Progressing) + jsonPath: .status.conditions[?(@.type=='Available')].reason + name: STATUS + type: string + - description: Time since creation + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: Service is the Schema for the services API @@ -8300,6 +8317,15 @@ spec: SubGroupPolicy describes the policy that will be applied when creating subgroups in each replica. properties: + subGroupPolicyType: + default: LeaderWorker + description: |- + Defines what type of Subgroups to create. Defaults to + LeaderWorker + enum: + - LeaderWorker + - LeaderExcluded + type: string subGroupSize: description: |- The number of pods per subgroup. This value is immutable, @@ -16520,4 +16546,3 @@ spec: specReplicasPath: .spec.replicas statusReplicasPath: .status.replicas status: {} - diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index d8245391..0be4fea7 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -67,4 +67,4 @@ spec: - name: cert secret: defaultMode: 420 - secretName: {{ include "chart.fullname" . }}-webhook-server-cert + secretName: {{ include "chart.fullname" . }}-webhook-server-cert \ No newline at end of file diff --git a/chart/templates/global-config.yaml b/chart/templates/global-config.yaml index 5072b63b..d79517ef 100644 --- a/chart/templates/global-config.yaml +++ b/chart/templates/global-config.yaml @@ -5,4 +5,4 @@ metadata: labels: {{- include "chart.labels" . | nindent 4 }} data: - config.data: {{ .Values.globalConfig.configData | toYaml | indent 1 }} + config.data: {{ .Values.globalConfig.configData | toYaml | indent 1 }} \ No newline at end of file diff --git a/chart/templates/leader-election-rbac.yaml b/chart/templates/leader-election-rbac.yaml index f8785b54..ccccf69e 100644 --- a/chart/templates/leader-election-rbac.yaml +++ b/chart/templates/leader-election-rbac.yaml @@ -56,4 +56,4 @@ roleRef: subjects: - kind: ServiceAccount name: '{{ include "chart.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' + namespace: '{{ .Release.Namespace }}' \ No newline at end of file diff --git a/chart/templates/manager-rbac.yaml b/chart/templates/manager-rbac.yaml index a9939068..298f0ca3 100644 --- a/chart/templates/manager-rbac.yaml +++ b/chart/templates/manager-rbac.yaml @@ -162,4 +162,4 @@ roleRef: subjects: - kind: ServiceAccount name: '{{ include "chart.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' + namespace: '{{ .Release.Namespace }}' \ No newline at end of file diff --git a/chart/templates/metrics-reader-rbac.yaml b/chart/templates/metrics-reader-rbac.yaml index b50d8023..71eb639b 100644 --- a/chart/templates/metrics-reader-rbac.yaml +++ b/chart/templates/metrics-reader-rbac.yaml @@ -25,4 +25,4 @@ roleRef: subjects: - kind: ServiceAccount name: '{{ include "chart.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' + namespace: '{{ .Release.Namespace }}' \ No newline at end of file diff --git a/chart/templates/metrics-service.yaml b/chart/templates/metrics-service.yaml index ff44acce..e3bf1bf8 100644 --- a/chart/templates/metrics-service.yaml +++ b/chart/templates/metrics-service.yaml @@ -12,4 +12,4 @@ spec: control-plane: controller-manager {{- include "chart.selectorLabels" . | nindent 4 }} ports: - {{- .Values.metricsService.ports | toYaml | nindent 2 }} + {{- .Values.metricsService.ports | toYaml | nindent 2 }} \ No newline at end of file diff --git a/chart/templates/mutating-webhook-configuration.yaml b/chart/templates/mutating-webhook-configuration.yaml index d4dbfdc6..db2f8f71 100644 --- a/chart/templates/mutating-webhook-configuration.yaml +++ b/chart/templates/mutating-webhook-configuration.yaml @@ -86,4 +86,4 @@ webhooks: - UPDATE resources: - services - sideEffects: None + sideEffects: None \ No newline at end of file diff --git a/chart/templates/proxy-rbac.yaml b/chart/templates/proxy-rbac.yaml index c4cd6f09..e66021c7 100644 --- a/chart/templates/proxy-rbac.yaml +++ b/chart/templates/proxy-rbac.yaml @@ -35,4 +35,4 @@ roleRef: subjects: - kind: ServiceAccount name: '{{ include "chart.fullname" . }}-controller-manager' - namespace: '{{ .Release.Namespace }}' + namespace: '{{ .Release.Namespace }}' \ No newline at end of file diff --git a/chart/templates/serviceaccount.yaml b/chart/templates/serviceaccount.yaml index 2a615a55..f2ca8070 100644 --- a/chart/templates/serviceaccount.yaml +++ b/chart/templates/serviceaccount.yaml @@ -8,4 +8,4 @@ metadata: app.kubernetes.io/part-of: llmaz {{- include "chart.labels" . | nindent 4 }} annotations: - {{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }} + {{- toYaml .Values.controllerManager.serviceAccount.annotations | nindent 4 }} \ No newline at end of file diff --git a/chart/templates/validating-webhook-configuration.yaml b/chart/templates/validating-webhook-configuration.yaml index 62eb6296..48021bb0 100644 --- a/chart/templates/validating-webhook-configuration.yaml +++ b/chart/templates/validating-webhook-configuration.yaml @@ -86,4 +86,4 @@ webhooks: - UPDATE resources: - services - sideEffects: None + sideEffects: None \ No newline at end of file diff --git a/chart/templates/webhook-server-cert.yaml b/chart/templates/webhook-server-cert.yaml index 0b43bfc5..0f06118c 100644 --- a/chart/templates/webhook-server-cert.yaml +++ b/chart/templates/webhook-server-cert.yaml @@ -3,4 +3,4 @@ kind: Secret metadata: name: {{ include "chart.fullname" . }}-webhook-server-cert labels: - {{- include "chart.labels" . | nindent 4 }} + {{- include "chart.labels" . | nindent 4 }} \ No newline at end of file diff --git a/chart/templates/webhook-service.yaml b/chart/templates/webhook-service.yaml index 9a296051..9303b0f3 100644 --- a/chart/templates/webhook-service.yaml +++ b/chart/templates/webhook-service.yaml @@ -13,4 +13,4 @@ spec: control-plane: controller-manager {{- include "chart.selectorLabels" . | nindent 4 }} ports: - {{- .Values.webhookService.ports | toYaml | nindent 2 }} + {{- .Values.webhookService.ports | toYaml | nindent 2 }} \ No newline at end of file diff --git a/config/crd/bases/inference.llmaz.io_playgrounds.yaml b/config/crd/bases/inference.llmaz.io_playgrounds.yaml index e4e887f4..d64ae9d9 100644 --- a/config/crd/bases/inference.llmaz.io_playgrounds.yaml +++ b/config/crd/bases/inference.llmaz.io_playgrounds.yaml @@ -16,7 +16,24 @@ spec: singular: playground scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: Model used in the Playground + jsonPath: .spec.modelClaim.modelName + name: MODEL + type: string + - description: Current number of replicas + jsonPath: .status.replicas + name: REPLICAS + type: integer + - description: Current status (Available/Progressing) + jsonPath: .status.conditions[?(@.type=='Available')].reason + name: STATUS + type: string + - description: Time since creation + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: Playground is the Schema for the playgrounds API diff --git a/config/crd/bases/inference.llmaz.io_services.yaml b/config/crd/bases/inference.llmaz.io_services.yaml index 1f0c53e2..61fb763a 100644 --- a/config/crd/bases/inference.llmaz.io_services.yaml +++ b/config/crd/bases/inference.llmaz.io_services.yaml @@ -16,7 +16,24 @@ spec: singular: service scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: Name of the Inference Service + jsonPath: .metadata.name + name: NAME + type: string + - description: Current number of replicas + jsonPath: .status.replicas + name: REPLICAS + type: integer + - description: Current status (Available/Progressing) + jsonPath: .status.conditions[?(@.type=='Available')].reason + name: STATUS + type: string + - description: Time since creation + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 schema: openAPIV3Schema: description: Service is the Schema for the services API diff --git a/config/crd/bases/llmaz.io_openmodels.yaml b/config/crd/bases/llmaz.io_openmodels.yaml index e332e144..5edf4cc0 100644 --- a/config/crd/bases/llmaz.io_openmodels.yaml +++ b/config/crd/bases/llmaz.io_openmodels.yaml @@ -16,7 +16,28 @@ spec: singular: openmodel scope: Cluster versions: - - name: v1alpha1 + - additionalPrinterColumns: + - description: Owner of the model + jsonPath: .spec.ownedBy + name: OWNEDBY + type: string + - description: Time since creation + jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - description: Model hub name + jsonPath: .spec.source.modelHub.name + name: MODELHUB + type: string + - description: Model ID on the model hub + jsonPath: .spec.source.modelHub.modelID + name: MODELID + type: string + - description: URI of the model when using a custom source (e.g., s3://, ollama://) + jsonPath: .spec.source.uri + name: URI + type: string + name: v1alpha1 schema: openAPIV3Schema: description: OpenModel is the Schema for the open models API