8000 feat: rename operator CRDs by julienmancuso · Pull Request #795 · ai-dynamo/dynamo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: rename operator CRDs #795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and < 8000 a class="Link--inTextBlock" href="https://docs.github.com/privacy" target="_blank">privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

def sanitize_deployment_name(name: Optional[str], dynamo_nim: str) -> str:
"""
Resolve a name for the DynamoDeployment that will work safely in k8s
Resolve a name for the DynamoGraphDeployment that will work safely in k8s

Args:
name: Optional custom name
Expand Down
44 changes: 24 additions & 20 deletions deploy/dynamo/api-store/ai_dynamo_store/api/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def __init__(self, group: str, version: str, plural: str):
self.plural = plural


DynamoDeployment = K8sResource(
DynamoGraphDeployment = K8sResource(
group="nvidia.com",
version="v1alpha1",
plural="dynamodeployments",
plural="dynamographdeployments",
)


Expand Down Expand Up @@ -69,7 +69,7 @@ def create_dynamo_deployment(
envs: Optional[List[Dict[str, str]]] = None,
) -> Dict[str, Any]:
"""
Create a DynamoDeployment custom resource.
Create a DynamoGraphDeployment custom resource.

Args:
name: Deployment name
Expand All @@ -83,23 +83,27 @@ def create_dynamo_deployment(
"""
body = {
"apiVersion": "nvidia.com/v1alpha1",
"kind": "DynamoDeployment",
"kind": "DynamoGraphDeployment",
"metadata": {"name": name, "namespace": namespace, "labels": labels},
"spec": {"dynamoNim": dynamo_nim, "services": {}, "envs": envs if envs else []},
"spec": {
"dynamoGraph": dynamo_nim,
"services": {},
"envs": envs if envs else [],
},
}

return create_custom_resource(
group=DynamoDeployment.group,
version=DynamoDeployment.version,
group=DynamoGraphDeployment.group,
version=DynamoGraphDeployment.version,
namespace=namespace,
plural=DynamoDeployment.plural,
plural=DynamoGraphDeployment.plural,
body=body,
)


def get_dynamo_deployment(name: str, namespace: str) -> Dict[str, Any]:
"""
Get a DynamoDeployment custom resource.
Get a DynamoGraphDeployment custom resource.

Args:
name: Deployment name
Expand All @@ -119,10 +123,10 @@ def get_dynamo_deployment(name: str, namespace: str) -> Dict[str, Any]:
api = client.CustomObjectsApi()
try:
return api.get_namespaced_custom_object(
group=DynamoDeployment.group,
version=DynamoDeployment.version,
group=DynamoGraphDeployment.group,
version=DynamoGraphDeployment.version,
namespace=namespace,
plural=DynamoDeployment.plural,
plural=DynamoGraphDeployment.plural,
name=name,
)
except client.rest.ApiException as e:
Expand All @@ -141,7 +145,7 @@ def get_namespace() -> str:

def delete_dynamo_deployment(name: str, namespace: str) -> Dict[str, Any]:
"""
Delete a DynamoDeployment custom resource.
Delete a DynamoGraphDeployment custom resource.
"""
try:
config.load_incluster_config()
Expand All @@ -151,10 +155,10 @@ def delete_dynamo_deployment(name: str, namespace: str) -> Dict[str, Any]:
api = client.CustomObjectsApi()
try:
return api.delete_namespaced_custom_object(
group=DynamoDeployment.group,
version=DynamoDeployment.version,
group=DynamoGraphDeployment.group,
version=DynamoGraphDeployment.version,
namespace=namespace,
plural=DynamoDeployment.plural,
plural=DynamoGraphDeployment.plural,
name=name,
)
except client.rest.ApiException as e:
Expand All @@ -169,7 +173,7 @@ def list_dynamo_deployments(
label_selector: Optional[str] = None,
) -> List[Dict[str, Any]]:
"""
List DynamoDeployment custom resources.
List DynamoGraphDeployment custom resources.

Args:
namespace: Target namespace
Expand All @@ -189,10 +193,10 @@ def list_dynamo_deployments(
api = client.CustomObjectsApi()
try:
response = api.list_namespaced_custom_object(
group=DynamoDeployment.group,
version=DynamoDeployment.version,
group=DynamoGraphDeployment.group,
version=DynamoGraphDeployment.version,
namespace=namespace,
plural=DynamoDeployment.plural,
plural=DynamoGraphDeployment.plural,
label_selector=label_selector,
)
return response["items"]
Expand Down
2 changes: 1 addition & 1 deletion deploy/dynamo/helm/platform/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ version: 25.2.0-rc3
home: https://nvidia.com
dependencies:
- name: dynamo-operator
version: 0.1.4
version: 0.1.5
repository: file://components/operator
condition: dynamo-operator.enabled
- name: dynamo-api-store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ rules:
- apiGroups:
- nvidia.com
resources:
- dynamodeployments
- dynamographdeployments
verbs:
- create
- delete
Expand Down
4 changes: 2 additions & 2 deletions deploy/dynamo/helm/platform/components/operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.4
version: 0.1.5
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.0"
dependencies:
- name: dynamo-crds
version: 0.1.3
version: 0.1.4
repository: file://charts/dynamo-crds
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ apiVersion: v2
name: dynamo-crds
description: A Helm chart for CRDs of dynamo operator
type: application
version: 0.1.3
version: 0.1.4
dependencies: []
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
name: dynamonimdeployments.nvidia.com
name: dynamocomponentdeployments.nvidia.com
spec:
group: nvidia.com
names:
kind: DynamoNimDeployment
listKind: DynamoNimDeploymentList
plural: dynamonimdeployments
singular: dynamonimdeployment
kind: DynamoComponentDeployment
listKind: DynamoComponentDeploymentList
plural: dynamocomponentdeployments
singular: dynamocomponentdeployment
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Bento
jsonPath: .spec.bento
name: Bento
- description: Dynamo component
jsonPath: .spec.dynamoComponent
name: DynamoComponent
type: string
- description: Available
jsonPath: .status.conditions[?(@.type=='Available')].status
Expand Down Expand Up @@ -389,9 +389,9 @@ spec:
minReplicas:
type: integer
type: object
dynamoNamespace:
dynamoComponent:
type: string
dynamoNim:
dynamoNamespace:
type: string
dynamoTag:
type: string
Expand Down Expand Up @@ -2798,7 +2798,7 @@ spec:
serviceName:
type: string
required:
- dynamoNim
- dynamoComponent
- dynamoTag
type: object
status:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,32 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
name: dynamonimrequests.nvidia.com
name: dynamocomponentrequests.nvidia.com
spec:
group: nvidia.com
names:
kind: DynamoNimRequest
listKind: DynamoNimRequestList
plural: dynamonimrequests
singular: dynamonimrequest
kind: DynamoComponentRequest
listKind: DynamoComponentRequestList
plural: dynamocomponentrequests
singular: dynamocomponentrequest
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Bento Tag
jsonPath: .spec.bentoTag
name: Bento-Tag
- description: Dynamo component
jsonPath: .spec.dynamoComponent
name: DynamoComponent
type: string
- description: Download URL
jsonPath: .spec.downloadUrl
name: Download-Url
type: string
- description: Image
jsonPath: .spec.image
name: Image
type: string
- description: Image Exists
jsonPath: .status.conditions[?(@.type=='ImageExists')].status
name: Image-Exists
type: string
- description: Bento Available
jsonPath: .status.conditions[?(@.type=='BentoAvailable')].status
name: Bento-Available
- description: Dynamo Component Available
jsonPath: .status.conditions[?(@.type=='DynamoComponentAvailable')].status
name: DynamoComponent-Available
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
Expand All @@ -65,17 +61,10 @@ spec:
type: object
spec:
properties:
bentoTag:
type: string
buildArgs:
items:
type: string
type: array
context:
properties:
bentomlVersion:
type: string
type: object
dockerConfigJsonSecretName:
type: string
downloadUrl:
Expand Down Expand Up @@ -105,6 +94,8 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: array
dynamoComponent:
type: string
image:
type: string
imageBuildTimeout:
Expand Down Expand Up @@ -1422,29 +1413,12 @@ spec:
type: object
type: array
type: object
models:
items:
properties:
downloadUrl:
type: string
size:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
tag:
type: string
required:
- tag
type: object
type: array
ociRegistryInsecure:
type: boolean
serviceName:
type: string
required:
- bentoTag
- dynamoComponent
type: object
status:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.4
name: dynamonims.nvidia.com
name: dynamocomponents.nvidia.com
spec:
group: nvidia.com
names:
kind: DynamoNim
listKind: DynamoNimList
plural: dynamonims
singular: dynamonim
kind: DynamoComponent
listKind: DynamoComponentList
plural: dynamocomponents
singular: dynamocomponent
scope: Namespaced
versions:
- name: v1alpha1
Expand All @@ -41,11 +41,8 @@ spec:
type: object
spec:
properties:
context:
properties:
bentomlVersion:
type: string
type: object
dynamoComponent:
type: string
image:
type: string
imagePullSecrets:
Expand All @@ -57,30 +54,11 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
models:
items:
properties:
downloadUrl:
type: string
size:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
tag:
type: string
required:
- tag
type: object
type: array
serviceName:
type: string
tag:
type: string
required:
- dynamoComponent
- image
- tag
type: object
status:
properties:
Expand Down
Loading
Loading
0