v1alpha1

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the dataset v1alpha1 API group +kubebuilder:object:generate=true +groupName=dataset.baizeai.io

Index

Constants

View Source
const (
	DatasetTypeGit         DatasetType = "GIT"
	DatasetTypeS3          DatasetType = "S3"
	DatasetTypePVC         DatasetType = "PVC"
	DatasetTypeNFS         DatasetType = "NFS"
	DatasetTypeHTTP        DatasetType = "HTTP"
	DatasetTypeConda       DatasetType = "CONDA"
	DatasetTypeReference   DatasetType = "REFERENCE"
	DatasetTypeHuggingFace DatasetType = "HUGGING_FACE"
	DatasetTypeModelScope  DatasetType = "MODEL_SCOPE"

	// must be same as apis/management-api/dataset/v1alpha1/dataset.proto
	DatasetStatusPhasePending    DatasetStatusPhase = "PENDING"
	DatasetStatusPhaseReady      DatasetStatusPhase = "READY"
	DatasetStatusPhaseProcessing DatasetStatusPhase = "PROCESSING"
	DatasetStatusPhaseFailed     DatasetStatusPhase = "FAILED"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion       = schema.GroupVersion{Group: "dataset.baizeai.io", Version: "v1alpha1"}
	SchemeGroupVersion = GroupVersion // for client-go

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type DataLoadStatus

type DataLoadStatus struct {
	// +kubebuilder:validation:Optional
	Round int32 `json:"round,omitempty"`
	// +kubebuilder:validation:Optional
	JobName string `json:"jobName,omitempty"`
	// +kubebuilder:validation:Optional
	StartTime metav1.Time `json:"startTime,omitempty"`
	// +kubebuilder:validation:Optional
	EndTime metav1.Time `json:"endTime,omitempty"`
	// +kubebuilder:validation:Optional
	Succeed bool `json:"succeed,omitempty"`
}

func (*DataLoadStatus) DeepCopy

func (in *DataLoadStatus) DeepCopy() *DataLoadStatus

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

func (*DataLoadStatus) DeepCopyInto

func (in *DataLoadStatus) DeepCopyInto(out *DataLoadStatus)

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

type Dataset

type Dataset struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   DatasetSpec   `json:"spec,omitempty"`
	Status DatasetStatus `json:"status,omitempty"`
}

Dataset is the Schema for the datasets API +genclient +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:resource:shortName=data +kubebuilder:printcolumn:name="type",type=string,JSONPath=`.spec.source.type` +kubebuilder:printcolumn:name="uri",type=string,JSONPath=`.spec.source.uri` +kubebuilder:printcolumn:name="phase",type=string,JSONPath=`.status.phase`

func (*Dataset) DeepCopy

func (in *Dataset) DeepCopy() *Dataset

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

func (*Dataset) DeepCopyInto

func (in *Dataset) DeepCopyInto(out *Dataset)

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

func (*Dataset) DeepCopyObject

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

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

type DatasetList

type DatasetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Dataset `json:"items"`
}

DatasetList contains a list of Dataset

func (*DatasetList) DeepCopy

func (in *DatasetList) DeepCopy() *DatasetList

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

func (*DatasetList) DeepCopyInto

func (in *DatasetList) DeepCopyInto(out *DatasetList)

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

func (*DatasetList) DeepCopyObject

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

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

type DatasetSource

type DatasetSource struct {
	// +kubebuilder:validation:Enum=GIT;S3;HTTP;PVC;NFS;CONDA;REFERENCE;HUGGING_FACE;MODEL_SCOPE
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
	Type DatasetType `json:"type"`
	// +kubebuilder:validation:Required
	// uri is the location of the dataset.
	// each type of dataset source has its own format of uri:
	// - GIT: http[s]://<host>/<owner>/<repo>[.git] or git://<host>/<owner>/<repo>[.git]
	// - S3: s3://<bucket>/<path/to/directory>
	// - HTTP: http[s]://<host>/<path/to/directory>?<query>
	// - PVC: pvc://<name>/<path/to/directory>
	// - NFS: nfs://<host>/<path/to/directory>
	// - CONDA: conda://<name>?[python=<python_version>]
	// - REFERENCE: dataset://<namespace>/<dataset>
	// - HUGGING_FACE: huggingface://<repoName>?[repoType=<repoType>]
	// - MODEL_SCOPE: modelscope://<namespace>/<model>
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
	URI string `json:"uri"`
	// +kubebuilder:validation:Optional
	// +kubebuilder:pruning:PreserveUnknownFields
	// options is a map of key-value pairs that can be used to specify additional options for the dataset source, e.g. {"branch": "master"}
	// supported keys for each type of dataset source are:
	// - GIT: branch, commit, depth, submodules
	// - S3: region, endpoint, provider, syncMode
	// - HTTP: any key-value pair will be passed to the underlying http client as http headers
	// - PVC:
	// - NFS:
	// - CONDA: requirements.txt, environment.yaml
	// - REFERENCE:
	// - HUGGING_FACE: repo, repoType, endpoint, include, exclude, revision
	// - MODEL_SCOPE: repo, repoType, include, exclude, revision
	// * Note: syncMode can be "sync" (default) or "copy". "sync" removes files in destination that don't exist in source, "copy" only adds/updates files without removing existing ones.
	Options map[string]string `json:"options,omitempty"`
}

func (*DatasetSource) DeepCopy

func (in *DatasetSource) DeepCopy() *DatasetSource

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

func (*DatasetSource) DeepCopyInto

func (in *DatasetSource) DeepCopyInto(out *DatasetSource)

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

type DatasetSpec

type DatasetSpec struct {
	// Share indicates whether the model is shareable with others.
	// When set to true, the model can be shared according to the specified selector.
	// +kubebuilder:validation:Optional
	Share bool `json:"share,omitempty"`
	// ShareToNamespaceSelector defines a label selector to specify the namespaces
	// to which the model can be shared. Only namespaces that match the selector will have access to the model.
	// If Share is true and ShareToNamespaceSelector is empty, that means all namespaces can access this.
	// +kubebuilder:validation:Optional
	ShareToNamespaceSelector *metav1.LabelSelector `json:"shareToNamespaceSelector,omitempty"`
	// +kubebuilder:validation:Required
	// source is the source of the dataset.
	Source DatasetSource `json:"source"`
	// +kubebuilder:validation:Optional
	// secretRef is the name of the secret that contains credentials for accessing the dataset source.
	SecretRef string `json:"secretRef,omitempty"`
	// +kubebuilder:validation:Optional
	// mountOptions is the options for mounting the dataset.
	MountOptions MountOptions `json:"mountOptions,omitempty"`
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:XValidation:rule="self > 0 && self - oldSelf <= 1",message="dataSyncRound can only be incremented by 1"
	// +kubebuilder:default=1
	// dataSyncRound is the number of data sync rounds to be performed."
	DataSyncRound int32 `json:"dataSyncRound,omitempty"`
	// +kubebuilder:validation:Optional
	VolumeClaimTemplate v1.PersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"`
}

DatasetSpec defines the desired state of Dataset

func (*DatasetSpec) DeepCopy

func (in *DatasetSpec) DeepCopy() *DatasetSpec

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

func (*DatasetSpec) DeepCopyInto

func (in *DatasetSpec) DeepCopyInto(out *DatasetSpec)

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

type DatasetStatus

type DatasetStatus struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=PENDING
	Phase DatasetStatusPhase `json:"phase,omitempty"`
	// +kubebuilder:validation:Optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// +kubebuilder:validation:Optional
	InProcessing bool `json:"inProcessing,omitempty"`
	// +kubebuilder:validation:Optional
	InProcessingRound int32 `json:"inProcessingRound,omitempty"`
	// +kubebuilder:validation:Optional
	// lastSucceedRound is the number of the last data sync round.
	LastSucceedRound int32 `json:"lastSucceedRound,omitempty"`
	// +kubebuilder:validation:Optional
	// syncRoundStatuses is a list of data sync round statuses.
	// each data sync round status contains the information of the data sync round.
	// we only keep the data sync round statuses of the last 5 data sync rounds.
	SyncRoundStatuses []DataLoadStatus `json:"syncRoundStatuses,omitempty"`
	// +kubebuilder:validation:Optional
	// pvcName is the name of the pvc that contains the dataset.
	PVCName string `json:"pvcName,omitempty"`
	// +kubebuilder:validation:Optional
	// readOnly indicates whether the dataset is mounted as read-only.
	ReadOnly     bool        `json:"readOnly,omitempty"`
	LastSyncTime metav1.Time `json:"lastSyncTime,omitempty"`
}

DatasetStatus defines the observed state of Dataset

func (*DatasetStatus) DeepCopy

func (in *DatasetStatus) DeepCopy() *DatasetStatus

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

func (*DatasetStatus) DeepCopyInto

func (in *DatasetStatus) DeepCopyInto(out *DatasetStatus)

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

type DatasetStatusPhase

type DatasetStatusPhase string

type DatasetType

type DatasetType string

type MountOptions

type MountOptions struct {
	// +kubebuilder:validation:Optional
	// +kubebuilder:default="/"
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
	// path is the path to the directory to be mounted.
	// if set to "/", the dataset will be mounted to the root of the dest volume.
	// if set to a non-empty string, the dataset will be mounted to a subdirectory of the dest volume.
	Path string `json:"path,omitempty"`
	// +kubebuilder:validation:Optional
	// +kubebuilder:default="0774"
	// +kubebuilder:validation:Pattern="^[0-7]{3,4}$"
	// mode is the permission mode of the mounted directory.
	Mode string `json:"mode,omitempty"`
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=1000
	// uid is the user id of the mounted directory.
	UID int64 `json:"uid,omitempty"`
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=1000
	// gid is the group id of the mounted directory.
	GID int64 `json:"gid,omitempty"`
}

func (*MountOptions) DeepCopy

func (in *MountOptions) DeepCopy() *MountOptions

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

func (*MountOptions) DeepCopyInto

func (in *MountOptions) DeepCopyInto(out *MountOptions)

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