Documentation
¶
Index ¶
- Constants
- Variables
- func CalculateSha256ByOutput(pods []*PodExec, output string) (string, error)
- func CalculateSha256ByPersistentCacheTaskID(pods []*PodExec, taskID string) (string, error)
- func CalculateSha256ByTaskID(pods []*PodExec, taskID string) (string, error)
- func CheckFilesExist(pods []*PodExec, taskID string) bool
- func CriCtlCommand(arg ...string) *exec.Cmd
- func DockerCommand(arg ...string) *exec.Cmd
- func DockerCopy(dst, src string) *exec.Cmd
- func GetClientPodNameInMaster() (string, error)
- func GetClientPodNameInWorker() (string, error)
- func GetManagerPodName(n int) (string, error)
- func GetPersonalAccessToken() string
- func GetSeedClientPodName(n int) (string, error)
- func GitCommand(arg ...string) *exec.Cmd
- func KubeCtlCommand(arg ...string) *exec.Cmd
- func KubeCtlCopyCommand(ns, pod, source, target string) *exec.Cmd
- func UploadArtifactPrevStdout(namespace, podName, logDirName, logPrefix string) error
- func UploadArtifactStdout(namespace, podName, logDirName, logPrefix string) error
- type File
- type FileServer
- type FileServerOption
- type FileSize
- type PodExec
- type TaskIDOption
- type TaskMetadata
Constants ¶
const ( ManagerServerName = "manager" SchedulerServerName = "scheduler" SeedClientServerName = "seed-client" ClientServerName = "client" )
const (
DragonflyNamespace = "dragonfly-system"
)
Variables ¶
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 ¶ added in v2.2.4
func CalculateSha256ByPersistentCacheTaskID ¶ added in v2.2.4
func CalculateSha256ByTaskID ¶ added in v2.2.4
func CheckFilesExist ¶ added in v2.2.4
Check files is exist or not.
func CriCtlCommand ¶
func DockerCommand ¶
func DockerCopy ¶
func GetClientPodNameInMaster ¶ added in v2.2.4
func GetClientPodNameInWorker ¶ added in v2.2.4
func GetManagerPodName ¶ added in v2.2.4
func GetPersonalAccessToken ¶ added in v2.4.1
func GetPersonalAccessToken() string
GetPersonalAccessToken gets the personal access token from the environment variable.
func GetSeedClientPodName ¶ added in v2.2.4
func GitCommand ¶
func KubeCtlCommand ¶
func KubeCtlCopyCommand ¶
func UploadArtifactStdout ¶
Types ¶
type File ¶ added in v2.2.4
type File struct {
// contains filtered or unexported fields
}
File represents a file.
func (*File) GetDownloadURL ¶ added in v2.2.4
GetDownloadURL returns the download URL of the file from remote file server.
func (*File) GetOutputPath ¶ added in v2.2.4
GetOutputPath returns the output path of the file.
func (*File) GetRangeSha256 ¶ added in v2.2.4
GetRangeSha256 returns the sha256 of the range part of the file content.
func (*File) GetTaskID ¶ added in v2.2.4
func (f *File) GetTaskID(opts ...TaskIDOption) string
GetTaskID returns the task id of the file.
type FileServer ¶ added in v2.2.4
type FileServer interface {
// GenerateFile generates a file by random data with the specified size.
GenerateFile(size FileSize) (*File, error)
// DeleteFile deletes the file by the file info.
DeleteFile(info os.FileInfo) error
// Purge deletes all files generated by the file server, it should be called after all tests.
Purge() error
}
FileServer is the interface of file server for testing.
func GetFileServer ¶ added in v2.2.4
func GetFileServer() FileServer
GetFileServer returns the global file server instance.
func NewFileServer ¶ added in v2.2.4
func NewFileServer() (FileServer, error)
NewFileServer creates a new file server which using the singleton pattern.
type FileServerOption ¶ added in v2.2.4
type FileServerOption func(*fileServer)
FileServerOption is the type of the options of the file server.
func WithFileServerEndpoint ¶ added in v2.2.4
func WithFileServerEndpoint(endpoint string) FileServerOption
WithFileServerEndpoint sets the endpoint of the file server.
func WithFileServerLocalDir ¶ added in v2.2.4
func WithFileServerLocalDir(localDir string) FileServerOption
WithFileServerLocalDir sets the local temporary directory of the file server.
type FileSize ¶ added in v2.2.4
type FileSize = uint64
const ( // FileSize1MiB represents the size of 1MiB. FileSize1MiB FileSize = 1024 * 1024 // FileSize10MiB represents the size of 10MiB. FileSize10MiB FileSize = 10 * FileSize1MiB // FileSize100MiB represents the size of 100MiB. FileSize100MiB FileSize = 100 * FileSize1MiB // FileSize500MiB represents the size of 500MiB. FileSize500MiB FileSize = 500 * FileSize1MiB // FileSize1GiB represents the size of 1GiB. FileSize1GiB FileSize = 1024 * FileSize1MiB )
type PodExec ¶
type PodExec struct {
// contains filtered or unexported fields
}
func ClientExec ¶ added in v2.2.4
func ManagerExec ¶ added in v2.2.4
func SeedClientExec ¶ added in v2.2.4
type TaskIDOption ¶ added in v2.2.4
type TaskIDOption func(*taskID)
TaskIDOption is the type of the options of the task id.
func WithTaskIDApplication ¶ added in v2.2.4
func WithTaskIDApplication(application string) TaskIDOption
WithTaskIDApplication sets the application of the download task.
func WithTaskIDFilteredQueryParams ¶ added in v2.2.4
func WithTaskIDFilteredQueryParams(filteredQueryParams []string) TaskIDOption
WithTaskIDFilteredQueryParams sets the filtered query params of the download task.
func WithTaskIDPieceLength ¶ added in v2.2.4
func WithTaskIDPieceLength(pieceLength uint64) TaskIDOption
WithTaskIDPieceLength sets the piece length of the download task.
func WithTaskIDTag ¶ added in v2.2.4
func WithTaskIDTag(tag string) TaskIDOption
WithTaskIDTag sets the tag of the download task.
func WithTaskIDURL ¶ added in v2.2.4
func WithTaskIDURL(url string) TaskIDOption
WithTaskIDURL sets the url of the download task.