Documentation
¶
Index ¶
- Constants
- Variables
- func AddEntrypoint(entrypoint string, podTemplateSpec *corev1.PodTemplateSpec) error
- func CheckPodStatus(ctx context.Context, k8sClient client.Client, name string, namespace string, ...) (earliestRunningTime *metav1.Time, status v1alpha1.Status, err error)
- func FillPodResources(podSpec *corev1.PodSpec, resources *corev1.ResourceRequirements, override bool)
- func GetEarliestPodStartTime(ctx context.Context, k8sClient client.Client, name string, namespace string) *metav1.Time
- func GetPodTemplate(dshmSize resource.Quantity, dangerous bool, ...) corev1.PodTemplateSpec
- func GetRayClusterTemplate(dangerous bool, resourceRequirements v1.ResourceRequirements) *rayv1.RayClusterSpec
- func UpdatePodSpec(kaiwoCommonMetaSpec v1alpha1.CommonMetaSpec, ...) error
- func ValidateKaiwoResourceBeforeCreateOrUpdate(ctx context.Context, actual client.Object, kaiwoObjectMeta metav1.ObjectMeta) (*ctrl.Result, error)
- type DownloadJobConfigMapReconciler
- type DownloadJobReconciler
Constants ¶
View Source
const (
KaiwoDownloadTypeLabelValue = "downloader"
)
Variables ¶
View Source
var ( DefaultDataMountPath = baseutils.GetEnv("DEFAULT_DATA_MOUNT_PATH", "/workload") DefaultHfMountPath = baseutils.GetEnv("DEFAULT_HF_MOUNT_PATH", "/hf_cache") )
View Source
var ( DefaultMemory = resource.MustParse("16Gi") DefaultCPU = resource.MustParse("2") )
View Source
var DefaultGpuResourceKey = baseutils.GetEnv("DEFAULT_GPU_RESOURCE_KEY", "amd.com/gpu")
Functions ¶
func AddEntrypoint ¶
func AddEntrypoint(entrypoint string, podTemplateSpec *corev1.PodTemplateSpec) error
AddEntrypoint updates the entrypoint command in the PodTemplateSpec.
func CheckPodStatus ¶
func FillPodResources ¶
func FillPodResources(podSpec *corev1.PodSpec, resources *corev1.ResourceRequirements, override bool)
FillPodResources fills pod resources with a given template if they are not already set
func GetEarliestPodStartTime ¶
func GetPodTemplate ¶
func GetPodTemplate(dshmSize resource.Quantity, dangerous bool, resources corev1.ResourceRequirements, workloadContainerName string) corev1.PodTemplateSpec
func GetRayClusterTemplate ¶
func GetRayClusterTemplate(dangerous bool, resourceRequirements v1.ResourceRequirements) *rayv1.RayClusterSpec
func UpdatePodSpec ¶
func UpdatePodSpec(kaiwoCommonMetaSpec v1alpha1.CommonMetaSpec, labelContext common.KaiwoLabelContext, template *corev1.PodTemplateSpec, name string, replicas int, gpusPerReplica int, override bool) error
Types ¶
type DownloadJobConfigMapReconciler ¶
type DownloadJobConfigMapReconciler struct {
common.ResourceReconcilerBase[*corev1.ConfigMap]
StorageSpec *v1alpha1.StorageSpec
}
func NewDownloadJobConfigMapReconciler ¶
func NewDownloadJobConfigMapReconciler(objectKey client.ObjectKey, storageSpec *v1alpha1.StorageSpec) *DownloadJobConfigMapReconciler
func (*DownloadJobConfigMapReconciler) GetEmptyObject ¶
func (r *DownloadJobConfigMapReconciler) GetEmptyObject() *corev1.ConfigMap
type DownloadJobReconciler ¶
type DownloadJobReconciler struct {
common.ResourceReconcilerBase[*batchv1.Job]
StorageSpec *v1alpha1.StorageSpec
PvcBaseName string
UserEnvVars []corev1.EnvVar
}
func NewDownloadJobReconciler ¶
func NewDownloadJobReconciler(objectKey client.ObjectKey, storageSpec *v1alpha1.StorageSpec, pvcBaseName string, userEnvVars []corev1.EnvVar) *DownloadJobReconciler
func (*DownloadJobReconciler) GetEmptyObject ¶
func (r *DownloadJobReconciler) GetEmptyObject() *batchv1.Job
func (*DownloadJobReconciler) ShouldContinue ¶
Click to show internal directories.
Click to hide internal directories.