util

package
v2.1.56 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 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:   1,
	},
}

Functions

func CalculateSha256ByOutput

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

func CalculateSha256ByTaskID

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

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 GetFileURL

func GetFileURL(filePath string) string

func GetOutputPath

func GetOutputPath(fileName string) string

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