v1alpha1

package
v0.8.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 1

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

View Source
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 ArtifactPhase

type ArtifactPhase string

ArtifactPhase represents the current lifecycle phase of a ModelArtifact. +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 HuggingFaceSource

type HuggingFaceSource struct {
	// Repo is the HuggingFace model repository identifier (e.g. "microsoft/phi-4").
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +required
	Repo string `json:"repo"`

	// Revision pins a specific branch, tag, or commit hash.
	// If not specified, the default branch is used.
	// +kubebuilder:validation:MaxLength=253
	// +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.

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 ModelArtifact

type ModelArtifact struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// Spec defines the desired model artifact.
	// +required
	Spec ModelArtifactSpec `json:"spec"`

	// Status represents the current state of the model artifact pipeline.
	// +optional
	Status ModelArtifactStatus `json:"status,omitzero"`
}

ModelArtifact is the Schema for the modelartifacts API. A ModelArtifact 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 (*ModelArtifact) DeepCopy

func (in *ModelArtifact) DeepCopy() *ModelArtifact

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModelArtifact.

func (*ModelArtifact) DeepCopyInto

func (in *ModelArtifact) DeepCopyInto(out *ModelArtifact)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ModelArtifact) DeepCopyObject

func (in *ModelArtifact) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ModelArtifactList

type ModelArtifactList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []ModelArtifact `json:"items"`
}

ModelArtifactList contains a list of ModelArtifact resources.

func (*ModelArtifactList) DeepCopy

func (in *ModelArtifactList) DeepCopy() *ModelArtifactList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModelArtifactList.

func (*ModelArtifactList) DeepCopyInto

func (in *ModelArtifactList) DeepCopyInto(out *ModelArtifactList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ModelArtifactList) DeepCopyObject

func (in *ModelArtifactList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ModelArtifactSpec

type ModelArtifactSpec 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"`
}

ModelArtifactSpec defines the desired state of a ModelArtifact. It declares the model source, target OCI registry, packaging format, and temporary storage for the import/pack/push pipeline.

func (*ModelArtifactSpec) DeepCopy

func (in *ModelArtifactSpec) DeepCopy() *ModelArtifactSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModelArtifactSpec.

func (*ModelArtifactSpec) DeepCopyInto

func (in *ModelArtifactSpec) DeepCopyInto(out *ModelArtifactSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ModelArtifactStatus

type ModelArtifactStatus 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"`

	// RepositoryURL is the full OCI reference of the pushed artifact including tag.
	// +optional
	RepositoryURL string `json:"repositoryURL,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 ModelArtifact.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

ModelArtifactStatus defines the observed state of a ModelArtifact.

func (*ModelArtifactStatus) DeepCopy

func (in *ModelArtifactStatus) DeepCopy() *ModelArtifactStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModelArtifactStatus.

func (*ModelArtifactStatus) DeepCopyInto

func (in *ModelArtifactStatus) DeepCopyInto(out *ModelArtifactStatus)

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)",message="at least 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 {
	// Repository is the full OCI registry path (e.g. "ghcr.io/myorg/models/phi-4").
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +required
	Repository string `json:"repository"`

	// Tag is the image tag to push. Defaults to "latest" if not specified.
	// +kubebuilder:validation:MaxLength=128
	// +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"`

	// PlainHTTP uses HTTP instead of HTTPS for the registry connection.
	// Only use for development or air-gapped environments.
	// +optional
	PlainHTTP bool `json:"plainHTTP,omitempty"`
}

OCITarget defines the destination OCI registry for the packaged artifact.

func (*OCITarget) DeepCopy

func (in *OCITarget) DeepCopy() *OCITarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OCITarget.

func (*OCITarget) DeepCopyInto

func (in *OCITarget) DeepCopyInto(out *OCITarget)

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 ModelArtifact.
	// +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 ModelArtifact.
	// +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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL