Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the model v1alpha1 API group. +kubebuilder:object:generate=true +groupName=model.otterscale.io
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // GroupVersion is group version used to register these objects. GroupVersion = schema.GroupVersion{Group: "model.otterscale.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
Functions ¶
This section is empty.
Types ¶
type Artifact ¶ added in v0.8.15
type Artifact struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
// +optional
metav1.ObjectMeta `json:"metadata,omitzero"`
// Spec defines the desired artifact.
// +required
Spec ArtifactSpec `json:"spec"`
// Status represents the current state of the artifact pipeline.
// +optional
Status ArtifactStatus `json:"status,omitzero"`
}
Artifact is the Schema for the artifacts API. An Artifact declares intent to import a model from a source (e.g. HuggingFace), package it as an OCI artifact (ModelPack or ModelKit format), and push it to an OCI-compliant registry. The controller creates a Kubernetes Job to execute the import/pack/push pipeline and reports the resulting digest back to the status.
func (*Artifact) DeepCopy ¶ added in v0.8.15
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Artifact.
func (*Artifact) DeepCopyInto ¶ added in v0.8.15
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Artifact) DeepCopyObject ¶ added in v0.8.15
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ArtifactList ¶ added in v0.8.15
type ArtifactList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitzero"`
Items []Artifact `json:"items"`
}
ArtifactList contains a list of Artifact resources.
func (*ArtifactList) DeepCopy ¶ added in v0.8.15
func (in *ArtifactList) DeepCopy() *ArtifactList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactList.
func (*ArtifactList) DeepCopyInto ¶ added in v0.8.15
func (in *ArtifactList) DeepCopyInto(out *ArtifactList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ArtifactList) DeepCopyObject ¶ added in v0.8.15
func (in *ArtifactList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ArtifactPhase ¶
type ArtifactPhase string
ArtifactPhase represents the current lifecycle phase of an Artifact. +enum
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" )
type ArtifactSpec ¶ added in v0.8.15
type ArtifactSpec struct {
// Source defines where to fetch the model from.
// +required
Source ModelSource `json:"source"`
// Target defines the OCI registry destination for the packaged artifact.
// +required
Target OCITarget `json:"target"`
// Format specifies the OCI artifact packaging format.
// +kubebuilder:validation:Enum=ModelPack;ModelKit
// +kubebuilder:default=ModelPack
// +optional
Format PackFormat `json:"format,omitempty"`
// Storage configures the temporary PVC used during the import/pack/push pipeline.
// The PVC is automatically cleaned up after the job completes.
// +required
Storage StorageSpec `json:"storage"`
}
ArtifactSpec defines the desired state of an Artifact. It declares the model source, target OCI registry, packaging format, and temporary storage for the import/pack/push pipeline.
func (*ArtifactSpec) DeepCopy ¶ added in v0.8.15
func (in *ArtifactSpec) DeepCopy() *ArtifactSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactSpec.
func (*ArtifactSpec) DeepCopyInto ¶ added in v0.8.15
func (in *ArtifactSpec) DeepCopyInto(out *ArtifactSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ArtifactStatus ¶ added in v0.8.15
type ArtifactStatus struct {
// ObservedGeneration is the most recent generation observed by the controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Phase is the high-level summary of the artifact lifecycle.
// +optional
Phase ArtifactPhase `json:"phase,omitempty"`
// Digest is the OCI manifest digest of the pushed artifact (e.g. "sha256:abc123...").
// Only populated when Phase is Succeeded.
// +optional
Digest string `json:"digest,omitempty"`
// Reference is the full OCI reference of the pushed artifact including tag.
// +optional
Reference string `json:"reference,omitempty"`
// JobRef references the most recently created Job for this artifact.
// +optional
JobRef *ResourceReference `json:"jobRef,omitempty"`
// StartTime is the timestamp when the most recent job was created.
// +optional
StartTime *metav1.Time `json:"startTime,omitempty"`
// CompletionTime is the timestamp when the most recent job completed (succeeded or failed).
// +optional
CompletionTime *metav1.Time `json:"completionTime,omitempty"`
// Conditions store the status conditions of the Artifact.
// +listType=map
// +listMapKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
ArtifactStatus defines the observed state of an Artifact.
func (*ArtifactStatus) DeepCopy ¶ added in v0.8.15
func (in *ArtifactStatus) DeepCopy() *ArtifactStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ArtifactStatus.
func (*ArtifactStatus) DeepCopyInto ¶ added in v0.8.15
func (in *ArtifactStatus) DeepCopyInto(out *ArtifactStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HuggingFaceSource ¶
type HuggingFaceSource struct {
// 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
Model string `json:"model"`
// Revision pins a specific branch, tag, or commit hash.
// If not specified, the default branch is used.
// Must contain only alphanumerics, dots, underscores, hyphens, and slashes.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern="^[a-zA-Z0-9._/-]*$"
// +optional
Revision string `json:"revision,omitempty"`
// TokenSecretRef references a Secret containing the HuggingFace access token.
// Required for private or gated repositories.
// +optional
TokenSecretRef *SecretKeySelector `json:"tokenSecretRef,omitempty"`
}
HuggingFaceSource configures model retrieval from HuggingFace Hub.
SECURITY: Model and Revision are passed to shell scripts. Only users who can create Artifacts should have access; they already have equivalent privileges.
func (*HuggingFaceSource) DeepCopy ¶
func (in *HuggingFaceSource) DeepCopy() *HuggingFaceSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HuggingFaceSource.
func (*HuggingFaceSource) DeepCopyInto ¶
func (in *HuggingFaceSource) DeepCopyInto(out *HuggingFaceSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ModelSource ¶
type ModelSource struct {
// HuggingFace specifies a HuggingFace Hub repository as the model source.
// +optional
HuggingFace *HuggingFaceSource `json:"huggingFace,omitempty"`
}
ModelSource defines the origin of the model to be packaged. Exactly one source type must be specified. +kubebuilder:validation:XValidation:rule="[has(self.huggingFace)].filter(x, x).size() == 1",message="exactly one source must be specified"
func (*ModelSource) DeepCopy ¶
func (in *ModelSource) DeepCopy() *ModelSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModelSource.
func (*ModelSource) DeepCopyInto ¶
func (in *ModelSource) DeepCopyInto(out *ModelSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type OCITarget ¶
type OCITarget struct {
// Registry is the OCI registry host, optionally with port (e.g. "ghcr.io", "registry.local:5001").
// Must not contain slashes — the path component belongs in Repository.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern="^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"
// +required
Registry string `json:"registry"`
// Repository is the OCI repository path within the registry (e.g. "myorg/models/phi-4", "facebook/opt-125m").
// Must not include the registry host. 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"`
// Tag is the image tag to push. Defaults to "latest" if not specified.
// Must contain only alphanumerics, dots, underscores, and hyphens.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=128
// +kubebuilder:validation:Pattern="^[a-zA-Z0-9][a-zA-Z0-9._-]*$"
// +optional
Tag string `json:"tag,omitempty"`
// CredentialsSecretRef references a Secret containing OCI registry credentials.
// The Secret must contain "username" and "password" keys.
// +optional
CredentialsSecretRef *SecretReference `json:"credentialsSecretRef,omitempty"`
// Insecure uses an unencrypted connection to the registry instead of TLS.
// Only use for development or air-gapped environments.
// +optional
Insecure bool `json:"insecure,omitempty"`
}
OCITarget defines the destination OCI registry for the packaged artifact.
SECURITY: Registry, Repository, and Tag are passed to shell scripts. Only users who can create Artifacts should have access; they already have equivalent privileges.
func (*OCITarget) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OCITarget.
func (*OCITarget) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PackFormat ¶
type PackFormat string
PackFormat specifies the OCI artifact packaging format. +enum
const ( // PackFormatModelPack produces a CNCF ModelPack compliant OCI artifact. PackFormatModelPack PackFormat = "ModelPack" // PackFormatModelKit produces a KitOps native ModelKit OCI artifact. PackFormatModelKit PackFormat = "ModelKit" )
type ResourceReference ¶
type ResourceReference struct {
// Name is the name of the referenced resource.
// +required
Name string `json:"name"`
// Namespace is the namespace of the referenced resource.
// +optional
Namespace string `json:"namespace,omitempty"`
}
ResourceReference is a lightweight reference to a namespaced Kubernetes resource.
func (*ResourceReference) DeepCopy ¶
func (in *ResourceReference) DeepCopy() *ResourceReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReference.
func (*ResourceReference) DeepCopyInto ¶
func (in *ResourceReference) DeepCopyInto(out *ResourceReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecretKeySelector ¶
type SecretKeySelector struct {
// Name is the name of the Secret in the same namespace as the Artifact.
// +kubebuilder:validation:MinLength=1
// +required
Name string `json:"name"`
// Key is the key within the Secret data. If omitted, defaults to "token".
// +optional
Key string `json:"key,omitempty"`
}
SecretKeySelector references a specific key within a Secret.
func (*SecretKeySelector) DeepCopy ¶
func (in *SecretKeySelector) DeepCopy() *SecretKeySelector
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeySelector.
func (*SecretKeySelector) DeepCopyInto ¶
func (in *SecretKeySelector) DeepCopyInto(out *SecretKeySelector)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecretReference ¶
type SecretReference struct {
// Name is the name of the Secret in the same namespace as the Artifact.
// +kubebuilder:validation:MinLength=1
// +required
Name string `json:"name"`
}
SecretReference references a Secret by name. Used when the Secret structure is fixed by convention (e.g. "username" and "password" keys for OCI credentials).
func (*SecretReference) DeepCopy ¶
func (in *SecretReference) DeepCopy() *SecretReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretReference.
func (*SecretReference) DeepCopyInto ¶
func (in *SecretReference) DeepCopyInto(out *SecretReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StorageSpec ¶
type StorageSpec struct {
// Size is the requested PVC storage capacity (e.g. "100Gi").
// Should be at least 2x the expected model size to accommodate both
// the downloaded files and the packed artifact.
// +required
Size resource.Quantity `json:"size"`
// StorageClassName overrides the cluster default StorageClass.
// If not specified, the cluster default StorageClass is used.
// +optional
StorageClassName *string `json:"storageClassName,omitempty"`
}
StorageSpec configures the temporary PVC for the import/pack/push pipeline.
func (*StorageSpec) DeepCopy ¶
func (in *StorageSpec) DeepCopy() *StorageSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec.
func (*StorageSpec) DeepCopyInto ¶
func (in *StorageSpec) DeepCopyInto(out *StorageSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.