runner

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Count = 5000
	Time  = 12
	Unit  = "hour"
)

Variables

View Source
var (
	GlancerUnitMap = map[string]time.Duration{
		"second": time.Second,
		"minute": time.Minute,
		"hour":   time.Hour,
	}
)
View Source
var (
	TaskerUnitMap = map[string]time.Duration{
		"second": time.Second,
		"minute": time.Minute,
		"hour":   time.Hour,
	}
)

Functions

This section is empty.

Types

type Glance added in v1.28.0

type Glance struct {
	Dir     GlanceDirReq  `json:"dir"`
	File    GlanceFileReq `json:"file"`
	Sys     GlanceSysReq  `json:"sys"`
	Timeout GlanceTimeout `json:"timeout"`
}

type GlanceAllocatable added in v1.28.0

type GlanceAllocatable struct {
	MilliCPU int64 `json:"milliCPU"`
	Memory   int64 `json:"memory"`
	Storage  int64 `json:"storage"`
}

type GlanceCPU added in v1.28.0

type GlanceCPU struct {
	Total string `json:"total"`
	Used  string `json:"used"`
}

type GlanceDirRep added in v1.28.0

type GlanceDirRep struct {
	Entries []GlanceEntry `json:"entries"`
}

type GlanceDirReq added in v1.28.0

type GlanceDirReq struct {
	Path string `json:"path"`
}

type GlanceEntry added in v1.28.0

type GlanceEntry struct {
	Name  string `json:"name"`
	IsDir bool   `json:"isDir"`
	Size  int64  `json:"size"`
	Time  string `json:"time"`
	User  string `json:"user"`
	Group string `json:"group"`
	Mode  string `json:"mode"`
}

type GlanceFileRep added in v1.28.0

type GlanceFileRep struct {
	Content  string `json:"content"`
	Readable bool   `json:"readable"`
}

type GlanceFileReq added in v1.28.0

type GlanceFileReq struct {
	Path    string `json:"path"`
	MaxSize int64  `json:"maxSize"`
}

type GlanceMemory added in v1.28.0

type GlanceMemory struct {
	Total string `json:"total"`
	Used  string `json:"used"`
}

type GlanceReply added in v1.28.0

type GlanceReply struct {
	Dir   GlanceDirRep  `json:"dir"`
	File  GlanceFileRep `json:"file"`
	Sys   GlanceSysRep  `json:"sys"`
	Error string        `json:"error"`
}

type GlanceRequested added in v1.28.0

type GlanceRequested struct {
	MilliCPU int64 `json:"milliCPU"`
	Memory   int64 `json:"memory"`
	Storage  int64 `json:"storage"`
}

type GlanceResource added in v1.28.0

type GlanceResource struct {
	Allocatable GlanceAllocatable `json:"allocatable"`
	Requested   GlanceRequested   `json:"requested"`
}

type GlanceStats added in v1.28.0

type GlanceStats struct {
	CPU     GlanceCPU     `json:"cpu"`
	Host    string        `json:"host"`
	Memory  GlanceMemory  `json:"memory"`
	OS      string        `json:"os"`
	Storage GlanceStorage `json:"storage"`
}

type GlanceStorage added in v1.28.0

type GlanceStorage struct {
	Total string `json:"total"`
	Used  string `json:"used"`
}

type GlanceSysRep added in v1.28.0

type GlanceSysRep struct {
	Resource GlanceResource `json:"resource"`
	Stats    GlanceStats    `json:"stats"`
}

type GlanceSysReq added in v1.28.0

type GlanceSysReq struct {
	Enable bool `json:"enable"`
}

type GlanceTimeout added in v1.28.0

type GlanceTimeout struct {
	Time int64  `json:"time"`
	Unit string `json:"unit"`
}

type Glancer added in v1.28.0

type Glancer interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context) (GlanceReply, error)
}

func GlancerNew added in v1.28.0

func GlancerNew(_ context.Context, cfg *GlancerConfig) Glancer

type GlancerConfig added in v1.28.0

type GlancerConfig struct {
	Config config.Config
	Data   Proto
}

func GlancerDefaultConfig added in v1.28.0

func GlancerDefaultConfig() *GlancerConfig

type Metadata

type Metadata struct {
	Name string `json:"name"`
}

type Proto

type Proto struct {
	ApiVersion string   `json:"apiVersion"`
	Kind       string   `json:"kind"`
	Metadata   Metadata `json:"metadata"`
	Spec       Spec     `json:"spec"`
}

type Spec

type Spec struct {
	Tasks  []Task `json:"tasks"`
	Glance Glance `json:"glance"`
}

type Task

type Task struct {
	Name     string      `json:"name"`
	File     TaskFile    `json:"file"`
	Params   []TaskParam `json:"params"`
	Commands []string    `json:"commands"`
	Log      TaskLog     `json:"log"`
	Timeout  TaskTimeout `json:"timeout"`
	Depends  []string    `json:"depends"`
}

type TaskFile added in v1.28.0

type TaskFile struct {
	Content string `json:"content"`
	Gzip    bool   `json:"gzip"`
}

type TaskLog added in v1.30.0

type TaskLog struct {
	Width int64 `json:"width"`
}

type TaskOutput added in v1.28.0

type TaskOutput struct {
	Pos     int64  `json:"pos"`
	Time    int64  `json:"time"`
	Message string `json:"message"`
}

type TaskParam added in v1.28.0

type TaskParam struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type TaskResult added in v1.28.0

type TaskResult struct {
	Output TaskOutput `json:"output"`
	Error  string     `json:"error"`
}

type TaskTimeout added in v1.28.0

type TaskTimeout struct {
	Time int64  `json:"time"`
	Unit string `json:"unit"`
}

type Tasker added in v1.28.0

type Tasker interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context) error
	Tail(ctx context.Context) _runner.Log
	Tasks(ctx context.Context) []Task
}

func TaskerNew added in v1.28.0

func TaskerNew(_ context.Context, cfg *TaskerConfig) Tasker

type TaskerConfig added in v1.28.0

type TaskerConfig struct {
	Config config.Config
	Dag    dag.DAG
	Data   Proto
}

func TaskerDefaultConfig added in v1.28.0

func TaskerDefaultConfig() *TaskerConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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