cliutils

package
v0.1.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KaiwoCliConfigPathEnv = "KAIWOCONFIG"
)

Variables

View Source
var DefaultMonitorCommand = "watch -n 1 rocm-smi"

Functions

func DefaultKaiwoCliConfigFileExists

func DefaultKaiwoCliConfigFileExists() (bool, error)

func ExecInContainer

func ExecInContainer(
	ctx context.Context,
	clientset *kubernetes.Clientset,
	config *rest.Config,
	podName string,
	containerName string,
	namespace string,
	command []string,
	interactive bool,
	tty bool,
) error

func GetDefaultKaiwoCliConfigPath

func GetDefaultKaiwoCliConfigPath() (string, error)

func GetKaiwoCliConfigPath

func GetKaiwoCliConfigPath(cliFlagsPath string) (string, error)

func GetWorkload

func GetWorkload(ctx context.Context, k8sClient client.Client, workloadSelector string, namespace string) (common.KaiwoWorkload, error)

func IsGPUPod

func IsGPUPod(pod corev1.Pod) bool

func OutputLogs

func OutputLogs(
	ctx context.Context,
	clientset *kubernetes.Clientset,
	podName string,
	containerName string,
	tailLines int64,
	namespace string,
	follow bool,
) error

OutputLogs outputs logs for a given pod container to the standard output

func ParseCommand

func ParseCommand(command string) []string

func ValidateCommand

func ValidateCommand(command string) error

Types

type KaiwoCliConfig

type KaiwoCliConfig struct {
	User         string `yaml:"user"`
	ClusterQueue string `yaml:"clusterQueue"`
}

type PodSelectionPredicate

type PodSelectionPredicate func(pod corev1.Pod) bool

Jump to

Keyboard shortcuts

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