pkg

package
v0.0.0-...-6ac6f58 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoLocal = fmt.Errorf("task degraded to local compiling and " +
		"exit according to the --no_local flag set")
	ErrCompile                 = fmt.Errorf("compile error, build exit")
	ErrBoosterNoRegistered     = fmt.Errorf("booster no registered")
	ErrTaskPreparingTimeout    = fmt.Errorf("task prepareing timeout")
	ErrContextCanceled         = fmt.Errorf("context canceled")
	ErrWorkAlreadyRegistered   = fmt.Errorf("work already registered")
	ErrWorkAlreadyUnregistered = fmt.Errorf("work already unregistered")
	ErrTaskApplyingFailed      = fmt.Errorf("task applying failed")
)

Functions

func KillChildren

func KillChildren(p *process.Process)

KillChildren kill the children processes of given process

Types

type Booster

type Booster struct {
	ExitCode    int
	ExitMessage string
	// contains filtered or unexported fields
}

Booster describe the booster handler, which provides the methods and actions to build the params from flags and communicate with dist-controller

func NewBooster

func NewBooster(config dcType.BoosterConfig) (*Booster, error)

NewBooster get a new booster instance

func (*Booster) GetApplyParam

func (b *Booster) GetApplyParam() *v2.ParamApply

GetApplyParam return the apply param to controller

func (*Booster) GetTaskID

func (b *Booster) GetTaskID() string

GetTaskID get registered taskID

func (*Booster) GetWorkersEnv

func (b *Booster) GetWorkersEnv() map[string]string

GetWorkersEnv get current worker env

func (*Booster) ParseEvent

func (b *Booster) ParseEvent(event *TaskEvent) error

ParseEvent to parse task status event

func (*Booster) RegisterWork

func (b *Booster) RegisterWork() error

RegisterWork do the register

func (*Booster) Run

func (b *Booster) Run(ctx context.Context) (int, error)

Run do the whole work

func (*Booster) RunDegradeWorks

func (b *Booster) RunDegradeWorks(ctx context.Context) (int, error)

RunDegradeWorks run the commands in local

func (*Booster) RunWorks

func (b *Booster) RunWorks(ctx context.Context, event *TaskEvent) (int, error)

RunWorks run the commands

func (*Booster) SetSettings

func (b *Booster) SetSettings() error

SetSettings to set settings for this work

func (*Booster) SetToolChain

func (b *Booster) SetToolChain(f string) error

SetToolChain set tool chain to controller

func (*Booster) SetToolChainWithJSON

func (b *Booster) SetToolChainWithJSON(tools *dcSDK.Toolchain) error

SetToolChainWithJSON set tool chain wiht json to controller

func (*Booster) StartControllerWork

func (b *Booster) StartControllerWork() error

StartControllerWork to start the worker

func (*Booster) UnregisterWork

func (b *Booster) UnregisterWork() error

UnregisterWork do the unregister

func (*Booster) Wait4TaskReady

func (b *Booster) Wait4TaskReady(ctx context.Context) (<-chan *TaskEvent, error)

Wait4TaskReady get a event chan and it will receive a msg when task ready

type ByModTime

type ByModTime []os.FileInfo

func (ByModTime) Len

func (fis ByModTime) Len() int

func (ByModTime) Less

func (fis ByModTime) Less(i, j int) bool

func (ByModTime) Swap

func (fis ByModTime) Swap(i, j int)

type ExtraItems

type ExtraItems struct {
	IOTimeoutSecs int `json:"io_timeout_secs"`
}

ExtraItems describe the info from extra-project-data

type ExtraString

type ExtraString struct {
	ExtraProjectData string `json:"extra_project_data"`
}

ExtraString describe the info from task-extra

type TaskEvent

type TaskEvent struct {
	Info *dcSDK.WorkStatusDetail
	Err  error
}

TaskEvent describe the message of task info

Jump to

Keyboard shortcuts

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