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: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VersionV1 = "v1"

	PathV1 = prefix + VersionV1
)

define vars

View Source
const (
	OSWindows                        = "windows"
	CheckShaderJSONFileTickMillisecs = 10
	TryRunJobsTickMillisecs          = 10
	MaxJobExecuteWaitSecs            = 259200 // 3600*24*3
	CheckJobsExecuteTickSecs         = 60
	DefaultMaxParallelJobs           = 240 // ok for most machines
	MaxApplyResourceWaitSecs         = 120 // default stage_timeout is 60
	CheckOutputEnvJSONTickMillisecs  = 100
	CheckApplyCmdTickSecs            = 5
	CheckOldFilesTickSecs            = 600
	CheckCommitSuicideSecs           = 20
	CheckQuitTicksecs                = 1

	DevOPSProcessTreeKillKey = "DEVOPS_DONT_KILL_PROCESS_TREE"
)

const vars

Variables

View Source
var (
	ErrorNoActionsToRun           = fmt.Errorf("not found any action to execute")
	ErrorOverMaxTime              = fmt.Errorf("execute over max wait seconds")
	ErrorInvalidWorkID            = fmt.Errorf("not found valid work id")
	ErrorInvalidJSON              = fmt.Errorf("json invalid")
	ErrorFailedApplyResource      = fmt.Errorf("failed to apply resource after wait seconds")
	ErrorApplyCmdExitUnexpedted   = fmt.Errorf("apply resource cmd exit unexpected")
	ErrorFailedLaunchController   = fmt.Errorf("failed to launch controller")
	ErrorSignalInt                = fmt.Errorf("signal of SIGINT")
	ErrorSignalTerm               = fmt.Errorf("signal of SIGTERM")
	ErrorSignalOthers             = fmt.Errorf("signal of others")
	ErrorUnknown                  = fmt.Errorf("unknown error")
	ErrorProjectSettingNotExisted = fmt.Errorf("not found project setting file")
	ErrorContorllerNil            = fmt.Errorf("controller sdk is nil")
	ErrorBoosterNil               = fmt.Errorf("booster is nil")
	ErrContextCanceled            = fmt.Errorf("context canceled")
	ErrInitHTTPHandle             = fmt.Errorf("failed to init http handle")
)

define errors

View Source
var (
	IdleKeepSecs = 100 //
)

vars

Functions

func GetErrorCode

func GetErrorCode(err error) int

GetErrorCode return error code by error

func ReturnRest

func ReturnRest(resp *RestResponse)

ReturnRest : return http response

Types

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor define dist executor

func NewExecutor

func NewExecutor() *Executor

NewExecutor return new Executor

func (*Executor) Run

func (d *Executor) Run(fullargs []string, workdir string) (int, string, error)

Run main function entry

func (*Executor) Update

func (d *Executor) Update()

Update update with env

func (*Executor) Valid

func (d *Executor) Valid() bool

Valid to check executor valid

type HTTPHandle

type HTTPHandle struct {
	// contains filtered or unexported fields
}

HTTPHandle : http handle

func NewHTTPHandle

func NewHTTPHandle(mgr *ShaderTool) (*HTTPHandle, error)

NewHTTPHandle : return new http handle func NewHTTPHandle(conf *config.ServerConfig, mgr *ShaderTool) (*HTTPHandle, error) {

func (*HTTPHandle) GetActions

func (a *HTTPHandle) GetActions() []*httpserver.Action

GetActions : Get V1 actions

type RestResponse

type RestResponse struct {
	Resp     *restful.Response
	HTTPCode int

	Data    interface{}
	ErrCode commonTypes.ServerErrCode
	Message string
	Extra   map[string]interface{}

	WrapFunc func([]byte) []byte
}

RestResponse : data struct for http response

type ShaderTool

type ShaderTool struct {
	// contains filtered or unexported fields
}

ShaderTool describe the shader tool handler

func NewShaderTool

func NewShaderTool(flagsparam *common.Flags) *ShaderTool

NewShaderTool get a new ShaderTool

func (*ShaderTool) ListenAndServeWithDynamicPort

func (h *ShaderTool) ListenAndServeWithDynamicPort() error

func (*ShaderTool) ReleaseResource

func (h *ShaderTool) ReleaseResource()

ReleaseResource release resource after some idle duration

func (*ShaderTool) Run

func (h *ShaderTool) Run(ctx context.Context) (int, error)

Run run the tool

Jump to

Keyboard shortcuts

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