-
Notifications
You must be signed in to change notification settings - Fork 0
feat: update ModelArtifact CRD to include registry field and improve … #27
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 privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,9 @@ spec: | |||||
| - jsonPath: .status.conditions[?(@.type=="Ready")].status | ||||||
| name: Ready | ||||||
| type: string | ||||||
| - jsonPath: .spec.target.registry | ||||||
| name: Registry | ||||||
| type: string | ||||||
| - jsonPath: .spec.target.repository | ||||||
| name: Repository | ||||||
| type: string | ||||||
|
|
@@ -75,9 +78,9 @@ spec: | |||||
| description: HuggingFace specifies a HuggingFace Hub repository | ||||||
| as the model source. | ||||||
| properties: | ||||||
| repository: | ||||||
| model: | ||||||
| description: |- | ||||||
| Repository is the HuggingFace model repository identifier (e.g. "microsoft/phi-4"). | ||||||
| Model is the HuggingFace model identifier (e.g. "microsoft/phi-4", "facebook/opt-125m"). | ||||||
| Must contain only alphanumerics, dots, underscores, hyphens, and slashes. | ||||||
| maxLength: 253 | ||||||
|
Comment on lines
+81
to
85
|
||||||
| minLength: 1 | ||||||
|
|
@@ -109,7 +112,7 @@ spec: | |||||
| - name | ||||||
| type: object | ||||||
| required: | ||||||
| - repository | ||||||
| - model | ||||||
| type: object | ||||||
| type: object | ||||||
| x-kubernetes-validations: | ||||||
|
|
@@ -160,10 +163,17 @@ spec: | |||||
| Insecure uses an unencrypted connection to the registry instead of TLS. | ||||||
| Only use for development or air-gapped environments. | ||||||
| type: boolean | ||||||
| registry: | ||||||
| description: Registry is the OCI registry host, optionally with | ||||||
| port (e.g. "ghcr.io", "registry.local:5001"). | ||||||
| maxLength: 253 | ||||||
| minLength: 1 | ||||||
| pattern: ^[a-zA-Z0-9][a-zA-Z0-9._/:-]*$ | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The validation pattern for pattern: ^[a-zA-Z0-9][a-zA-Z0-9._:-]*$
|
||||||
| pattern: ^[a-zA-Z0-9][a-zA-Z0-9._/:-]*$ | |
| pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]*(?::[0-9]{1,5})?$ |
Copilot
AI
Feb 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making .spec.target.registry required is an API-breaking change for any existing ModelArtifacts that only set repository (as a full ref previously). If cluster upgrades must be smooth, consider temporarily allowing registry to be optional with defaulting/derivation from repository, or supporting both forms during a deprecation window.
| - registry |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,10 +40,13 @@ type ArtifactPhase string | |||||||||
| const ( | ||||||||||
| // PhasePending indicates the pipeline has not yet started. | ||||||||||
| PhasePending ArtifactPhase = "Pending" | ||||||||||
|
|
||||||||||
| // PhaseRunning indicates the import/pack/push Job is in progress. | ||||||||||
| PhaseRunning ArtifactPhase = "Running" | ||||||||||
|
|
||||||||||
| // PhaseSucceeded indicates the artifact was successfully pushed to the registry. | ||||||||||
| PhaseSucceeded ArtifactPhase = "Succeeded" | ||||||||||
|
|
||||||||||
| // PhaseFailed indicates the pipeline encountered an error. | ||||||||||
| PhaseFailed ArtifactPhase = "Failed" | ||||||||||
| ) | ||||||||||
|
|
@@ -83,16 +86,16 @@ type ModelSource struct { | |||||||||
|
|
||||||||||
| // HuggingFaceSource configures model retrieval from HuggingFace Hub. | ||||||||||
| // | ||||||||||
| // SECURITY: Repository and Revision are passed to shell scripts. Only users who can | ||||||||||
| // SECURITY: Model and Revision are passed to shell scripts. Only users who can | ||||||||||
| // create ModelArtifacts should have access; they already have equivalent privileges. | ||||||||||
| type HuggingFaceSource struct { | ||||||||||
| // Repository is the HuggingFace model repository identifier (e.g. "microsoft/phi-4"). | ||||||||||
| // Model is the HuggingFace model identifier (e.g. "microsoft/phi-4", "facebook/opt-125m"). | ||||||||||
| // Must contain only alphanumerics, dots, underscores, hyphens, and slashes. | ||||||||||
| // +kubebuilder:validation:MinLength=1 | ||||||||||
| // +kubebuilder:validation:MaxLength=253 | ||||||||||
| // +kubebuilder:validation:Pattern="^[a-zA-Z0-9][a-zA-Z0-9._/-]*$" | ||||||||||
| // +required | ||||||||||
| Repository string `json:"repository"` | ||||||||||
| Model string `json:"model"` | ||||||||||
|
|
||||||||||
| // Revision pins a specific branch, tag, or commit hash. | ||||||||||
| // If not specified, the default branch is used. | ||||||||||
|
|
@@ -110,11 +113,18 @@ type HuggingFaceSource struct { | |||||||||
|
|
||||||||||
| // OCITarget defines the destination OCI registry for the packaged artifact. | ||||||||||
| // | ||||||||||
| // SECURITY: Repository and Tag are passed to shell scripts. Only users who can | ||||||||||
| // SECURITY: Registry, Repository, and Tag are passed to shell scripts. Only users who can | ||||||||||
| // create ModelArtifacts should have access; they already have equivalent privileges. | ||||||||||
| type OCITarget struct { | ||||||||||
| // Repository is the full OCI registry path (e.g. "ghcr.io/myorg/models/phi-4"). | ||||||||||
| // Must contain only alphanumerics, dots, underscores, hyphens, and slashes. | ||||||||||
| // Registry is the OCI registry host, optionally with port (e.g. "ghcr.io", "registry.local:5001"). | ||||||||||
| // +kubebuilder:validation:MinLength=1 | ||||||||||
| // +kubebuilder:validation:MaxLength=253 | ||||||||||
| // +kubebuilder:validation:Pattern="^[a-zA-Z0-9][a-zA-Z0-9._/:-]*$" | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The validation pattern for
Suggested change
|
||||||||||
| // +kubebuilder:validation:Pattern="^[a-zA-Z0-9][a-zA-Z0-9._/:-]*$" | |
| // +kubebuilder:validation:Pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]*(?::[0-9]{1,5})?$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
huggingFacesource description still says it specifies a HuggingFace Hub "repository", but the field has been renamed tomodel. Update this text to avoid confusion for CRD users reading the generated schema.