util

package
v2.1.62 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManagerServerName    = "manager"
	SchedulerServerName  = "scheduler"
	SeedClientServerName = "seed-client"
	ClientServerName     = "client"
)
View Source
const (
	DragonflyNamespace = "dragonfly-system"
)

Variables

View Source
var Servers = map[string]server{
	ManagerServerName: {
		Name:       ManagerServerName,
		Namespace:  DragonflyNamespace,
		LogDirName: ManagerServerName,
		Replicas:   1,
	},
	SchedulerServerName: {
		Name:       SchedulerServerName,
		Namespace:  DragonflyNamespace,
		LogDirName: SchedulerServerName,
		Replicas:   3,
	},
	SeedClientServerName: {
		Name:       SeedClientServerName,
		Namespace:  DragonflyNamespace,
		LogDirName: "dfdaemon",
		Replicas:   3,
	},
	ClientServerName: {
		Name:       ClientServerName,
		Namespace:  DragonflyNamespace,
		LogDirName: "dfdaemon",
		Replicas:   2,
	},
}

Functions

func CalculateSha256ByOutput

func CalculateSha256ByOutput(pods []*PodExec, output string) (string, error)

func CalculateSha256ByTaskID

func CalculateSha256ByTaskID(pods []*PodExec, taskID string) (string, error)

func CheckFilesExist added in v2.1.58

func CheckFilesExist(pods []*PodExec, taskID string) bool

Check files is exist or not.

func CriCtlCommand

func CriCtlCommand(arg ...string) *exec.Cmd

func DockerCommand

func DockerCommand(arg ...string) *exec.Cmd

func DockerCopy

func DockerCopy(dst, src string) *exec.Cmd

func GetClientPodNameInMaster added in v2.1.62

func GetClientPodNameInMaster() (string, error)

func GetClientPodNameInWorker added in v2.1.62

func GetClientPodNameInWorker() (string, error)

func GetFileURL

func GetFileURL(filePath string) string

func GetManagerPodName added in v2.1.62

func GetManagerPodName(n int) (string, error)

func GetOutputPath

func GetOutputPath(fileName string) string

func GetSeedClientPodName added in v2.1.62

func GetSeedClientPodName(n int) (string, error)

func GitCommand

func GitCommand(arg ...string) *exec.Cmd

func KubeCtlCommand

func KubeCtlCommand(arg ...string) *exec.Cmd

func KubeCtlCopyCommand

func KubeCtlCopyCommand(ns, pod, source, target string) *exec.Cmd

func UploadArtifactPrevStdout

func UploadArtifactPrevStdout(namespace, podName, logDirName, logPrefix string) error

func UploadArtifactStdout

func UploadArtifactStdout(namespace, podName, logDirName, logPrefix string) error

Types

type FileMetadata

type FileMetadata struct {
	ID     string
	Sha256 string
}

type PodExec

type PodExec struct {
	// contains filtered or unexported fields
}

func ClientExec

func ClientExec() (*PodExec, error)

func ManagerExec

func ManagerExec(n int) (*PodExec, error)

func NewPodExec

func NewPodExec(namespace string, name string, container string) *PodExec

func SeedClientExec

func SeedClientExec(n int) (*PodExec, error)

func (*PodExec) Command

func (p *PodExec) Command(arg ...string) *exec.Cmd

func (*PodExec) CurlCommand

func (p *PodExec) CurlCommand(method string, header map[string]string, data map[string]any, target string) *exec.Cmd

type TaskMetadata

type TaskMetadata struct {
	ID     string
	Sha256 string
}

Jump to

Keyboard shortcuts

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