utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InferenceModeCustomTemplate kaitov1alpha1.ModelImageAccessMode = "customTemplate"
	ExampleDatasetURL                                              = "" /* 140-byte string literal not displayed */
)

Variables

View Source
var (
	// PollInterval defines the interval time for a poll operation.
	PollInterval = 250 * time.Millisecond
	// PollTimeout defines the time after which the poll operation times out.
	PollTimeout = 60 * time.Second
)

Functions

func CopySecret added in v0.3.0

func CopySecret(original *corev1.Secret, targetNamespace string) *corev1.Secret

func ExtractModelVersion added in v0.2.0

func ExtractModelVersion(configs map[string]interface{}) (map[string]string, error)

func GenerateE2ETuningConfigMapManifest added in v0.3.0

func GenerateE2ETuningConfigMapManifest(namespace string) *corev1.ConfigMap

GenerateE2ETuningConfigMapManifest generates a ConfigMap manifest for E2E tuning.

func GenerateE2ETuningWorkspaceManifest added in v0.3.0

func GenerateE2ETuningWorkspaceManifest(name, namespace, imageName, outputRegistry string,
	resourceCount int, instanceType string, labelSelector *metav1.LabelSelector,
	preferredNodes []string, presetName kaitov1alpha1.ModelName, accessMode kaitov1alpha1.ModelImageAccessMode,
	imagePullSecret []string, customConfigMapName string) *kaitov1alpha1.Workspace

func GenerateInferenceWorkspaceManifest added in v0.3.0

func GenerateInferenceWorkspaceManifest(name, namespace, imageName string, resourceCount int, instanceType string,
	labelSelector *metav1.LabelSelector, preferredNodes []string, presetName kaitov1alpha1.ModelName,
	accessMode kaitov1alpha1.ModelImageAccessMode, imagePullSecret []string,
	podTemplate *corev1.PodTemplateSpec, adapters []kaitov1alpha1.AdapterSpec) *kaitov1alpha1.Workspace

func GeneratePodTemplate

func GeneratePodTemplate(name, namespace, image string, labels map[string]string) *corev1.PodTemplateSpec

func GenerateRandomString added in v0.3.0

func GenerateRandomString() string

GenerateRandomString generates a random number between 0 and 1000 and returns it as a string.

func GenerateTuningWorkspaceManifest added in v0.3.0

func GenerateTuningWorkspaceManifest(name, namespace, imageName string, resourceCount int, instanceType string,
	labelSelector *metav1.LabelSelector, preferredNodes []string, input *kaitov1alpha1.DataSource,
	output *kaitov1alpha1.DataDestination, preset *kaitov1alpha1.PresetSpec, method kaitov1alpha1.TuningMethod) *kaitov1alpha1.Workspace

func GetEnv

func GetEnv(envVar string) string

func GetK8sConfig added in v0.3.0

func GetK8sConfig() (*kubernetes.Clientset, error)

func GetModelConfigInfo added in v0.2.0

func GetModelConfigInfo(configFilePath string) (map[string]interface{}, error)

func GetPodLogs added in v0.3.0

func GetPodLogs(coreClient *kubernetes.Clientset, namespace, podName, containerName string) (string, error)

func GetPodNameForJob added in v0.3.0

func GetPodNameForJob(coreClient *kubernetes.Clientset, namespace, jobName string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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