runner

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

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 string        `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 GlanceProcess added in v1.31.0

type GlanceProcess struct {
	Process GlanceThread   `json:"process"`
	Threads []GlanceThread `json:"threads"`
}

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"`
	Processes []GlanceProcess `json:"processes"`
}

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 GlanceThread added in v1.32.0

type GlanceThread struct {
	Name    string  `json:"name"`
	Cmdline string  `json:"cmdline"`
	Memory  int64   `json:"memory"`
	Time    float64 `json:"time"`
	Pid     int64   `json:"pid"`
}

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 Maint added in v1.33.0

type Maint struct {
	Clock   MaintClockReq `json:"clock"`
	Timeout string        `json:"timeout"`
}

type MaintClockDiff added in v1.33.0

type MaintClockDiff struct {
	Time      int64 `json:"time"`
	Dangerous bool  `json:"dangerous"`
}

type MaintClockRep added in v1.33.0

type MaintClockRep struct {
	Sync MaintClockSync `json:"sync"`
	Diff MaintClockDiff `json:"diff"`
}

type MaintClockReq added in v1.33.0

type MaintClockReq struct {
	Sync bool  `json:"sync"`
	Time int64 `json:"time"`
}

type MaintClockSync added in v1.33.0

type MaintClockSync struct {
	Status int64 `json:"status"`
}

type MaintReply added in v1.33.0

type MaintReply struct {
	Clock MaintClockRep `json:"clock"`
	Error string        `json:"error"`
}

type Mainter added in v1.33.0

type Mainter interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context) (MaintReply, error)
}

func MainterNew added in v1.33.0

func MainterNew(_ context.Context, cfg *MainterConfig) Mainter

type MainterConfig added in v1.33.0

type MainterConfig struct {
	Config config.Config
	Data   Proto
}

func MainterDefaultConfig added in v1.33.0

func MainterDefaultConfig() *MainterConfig

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"`
	Maint  Maint  `json:"maint"`
}

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  string      `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 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