v1

package
v0.0.0-...-32b710e Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ControllerProcessfile = "bk-dist-controller-process.json"
	ShaderProcessfile     = "bk-shader-tool-process.json" // 文件名不能改,和ue源码中保持一致
)
View Source
var File_types_proto protoreflect.FileDescriptor

Functions

func GetManager

func GetManager() types.Mgr

GetManager return the singleton manager

func InitStorage

func InitStorage() (err error)

InitStorage After server init, the instances of manager, store ... etc. should be given into api handler.

func NewSDK

NewSDK get a new controller SDK with config

func SaveControllerInfo

func SaveControllerInfo(pid, port int, success bool, message string, d, f string) error

Types

type AvailableResp

type AvailableResp struct {
	Pid int `json:"pid"`
}

AvailableResp describe the response of controller available check

type CommonConfigParam

type CommonConfigParam struct {
	Configkey dcSDK.CommonConfigKey `json:"config_key"`
	WorkerKey WorkerKeyConfigParam  `json:"worker_key"`
	//Config    interface{}           `json:"config"`
	Data []byte `json:"data"`
}

CommonConfigParam describe the param to update common controller config

type JobStatsParam

type JobStatsParam struct {
	dcSDK.ControllerJobStats
}

JobStatsParam describe the param to update job stats

type LocalSlotsFreeParam

type LocalSlotsFreeParam struct {
	Usage  dcSDK.JobUsage `json:"usage"`
	Weight int32          `json:"weight"`
}

LocalSlotsFreeParam describe the param to unlock local slots

type LocalSlotsOccupyParam

type LocalSlotsOccupyParam struct {
	Usage  dcSDK.JobUsage `json:"usage"`
	Weight int32          `json:"weight"`
}

LocalSlotsOccupyParam describe the param to lock local slots

type LocalTaskExecuteParam

type LocalTaskExecuteParam struct {
	Pid          int                       `json:"pid"`
	Dir          string                    `json:"dir"`
	Commands     []string                  `json:"commands"`
	Environments []string                  `json:"environment"`
	Stats        *dcSDK.ControllerJobStats `json:"stats"`
	User         user.User                 `json:"user"`
}

LocalTaskExecuteParam describe the param to do local task execute to controller

type LocalTaskExecuteResp

type LocalTaskExecuteResp struct {
	Result *dcSDK.LocalTaskResult `json:"result"`
}

LocalTaskExecuteResp describe the response of doing local task execute to controller

func (*LocalTaskExecuteResp) EncResp

func (l *LocalTaskExecuteResp) EncResp(resp *api.RestResponse) ([]byte, error)

EncResp encode http response body to []byte

func (*LocalTaskExecuteResp) Read

func (l *LocalTaskExecuteResp) Read(data []byte) (int, string, error)

Read parse LocalTaskExecuteResp from http response body

func (*LocalTaskExecuteResp) Write2Resp

func (l *LocalTaskExecuteResp) Write2Resp(resp *api.RestResponse)

Write2Resp write the http response body from LocalTaskExecuteResp

type Message

type Message struct {
	Pid     int          `json:"pid"`
	Level   MessageLevel `json:"level"`
	WorkID  string       `json:"work_id"`
	Message string       `json:"message"`
}

Message describe the message sent to controller

type MessageLevel

type MessageLevel string

MessageLevel describe the message level

const (
	MessageInfo  MessageLevel = "INFO"
	MessageWarn  MessageLevel = "WARN"
	MessageError MessageLevel = "ERROR"
)

type PBHttpResult

type PBHttpResult struct {
	Result  *bool  `protobuf:"varint,1,req,name=result" json:"result,omitempty"`
	Code    *int32 `protobuf:"varint,2,req,name=code" json:"code,omitempty"`
	Message []byte `protobuf:"bytes,3,req,name=message" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*PBHttpResult) Descriptor deprecated

func (*PBHttpResult) Descriptor() ([]byte, []int)

Deprecated: Use PBHttpResult.ProtoReflect.Descriptor instead.

func (*PBHttpResult) GetCode

func (x *PBHttpResult) GetCode() int32

func (*PBHttpResult) GetMessage

func (x *PBHttpResult) GetMessage() []byte

func (*PBHttpResult) GetResult

func (x *PBHttpResult) GetResult() bool

func (*PBHttpResult) ProtoMessage

func (*PBHttpResult) ProtoMessage()

func (*PBHttpResult) ProtoReflect

func (x *PBHttpResult) ProtoReflect() protoreflect.Message

func (*PBHttpResult) Reset

func (x *PBHttpResult) Reset()

func (*PBHttpResult) String

func (x *PBHttpResult) String() string

type PBLocalExecuteResult

type PBLocalExecuteResult struct {
	Basic    *PBHttpResult `protobuf:"bytes,1,req,name=basic" json:"basic,omitempty"`
	ExitCode *int32        `protobuf:"varint,2,opt,name=exitCode" json:"exitCode,omitempty"`
	Stdout   []byte        `protobuf:"bytes,3,opt,name=stdout" json:"stdout,omitempty"`
	Stderr   []byte        `protobuf:"bytes,4,opt,name=stderr" json:"stderr,omitempty"`
	Message  []byte        `protobuf:"bytes,5,opt,name=message" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*PBLocalExecuteResult) Descriptor deprecated

func (*PBLocalExecuteResult) Descriptor() ([]byte, []int)

Deprecated: Use PBLocalExecuteResult.ProtoReflect.Descriptor instead.

func (*PBLocalExecuteResult) GetBasic

func (x *PBLocalExecuteResult) GetBasic() *PBHttpResult

func (*PBLocalExecuteResult) GetExitCode

func (x *PBLocalExecuteResult) GetExitCode() int32

func (*PBLocalExecuteResult) GetMessage

func (x *PBLocalExecuteResult) GetMessage() []byte

func (*PBLocalExecuteResult) GetStderr

func (x *PBLocalExecuteResult) GetStderr() []byte

func (*PBLocalExecuteResult) GetStdout

func (x *PBLocalExecuteResult) GetStdout() []byte

func (*PBLocalExecuteResult) ProtoMessage

func (*PBLocalExecuteResult) ProtoMessage()

func (*PBLocalExecuteResult) ProtoReflect

func (x *PBLocalExecuteResult) ProtoReflect() protoreflect.Message

func (*PBLocalExecuteResult) Reset

func (x *PBLocalExecuteResult) Reset()

func (*PBLocalExecuteResult) String

func (x *PBLocalExecuteResult) String() string

type RemoteTaskExecuteParam

type RemoteTaskExecuteParam struct {
	Pid   int                       `json:"pid"`
	Req   *dcSDK.BKDistCommand      `json:"req"`
	Stats *dcSDK.ControllerJobStats `json:"stats"`
}

RemoteTaskExecuteParam describe the param to do remote task execute directly

type RemoteTaskExecuteResp

type RemoteTaskExecuteResp struct {
	Result *dcSDK.BKDistResult `json:"result"`
}

RemoteTaskExecuteResp describe the response of doing remote task execute directly

type RemoteTaskSendFileParam

type RemoteTaskSendFileParam struct {
	Pid   int                       `json:"pid"`
	Dir   string                    `json:"dir"`
	Req   []dcSDK.FileDesc          `json:"req"`
	Stats *dcSDK.ControllerJobStats `json:"stats"`
}

RemoteTaskSendFileParam describe the param to send files to remote

type RemoteTaskSendFileResp

type RemoteTaskSendFileResp struct {
	Result *dcSDK.BKSendFileResult `json:"result"`
}

RemoteTaskSendFileResp describe the response of sending files to remote

type ToolChainParam

type ToolChainParam struct {
	ToolKey                string           `json:"tool_key"`
	ToolName               string           `json:"tool_name"`
	ToolLocalFullPath      string           `json:"tool_local_full_path"`
	ToolRemoteRelativePath string           `json:"tool_remote_relative_path"`
	Files                  []dcSDK.ToolFile `json:"files"`
}

ToolChainParam describe the param to set toolchain

type WorkRegisterParam

type WorkRegisterParam struct {
	BatchMode        bool           `json:"batch_mode"`
	ServerHost       string         `json:"server_host"`
	SpecificHostList []string       `json:"specific_host_list"`
	NeedApply        bool           `json:"need_apply"`
	Apply            *v2.ParamApply `json:"apply"`
}

WorkRegisterParam describe the param to register work

type WorkRegisterResp

type WorkRegisterResp struct {
	WorkID      string `json:"work_id"`
	BatchLeader bool   `json:"bath"`
}

WorkRegisterResp describe the response of registering work

type WorkSettingsParam

type WorkSettingsParam struct {
	TaskID          string                 `json:"task_id"`
	ProjectID       string                 `json:"project_id"`
	Scene           string                 `json:"scene"`
	UsageLimit      map[dcSDK.JobUsage]int `json:"usage_limit"`
	LocalTotalLimit int                    `json:"local_total_limit"`
	Preload         *dcSDK.PreloadConfig   `json:"preload"`
	FilterRules     []dcSDK.FilterRuleItem `json:"filter_rules"`
	Degraded        bool                   `json:"degraded"`
	GlobalSlots     bool                   `json:"global_slots"`
}

WorkSettingsParam describe the param to update work settings to controller

type WorkSettingsResp

type WorkSettingsResp struct {
	TaskID          string                 `json:"task_id"`
	ProjectID       string                 `json:"project_id"`
	Scene           string                 `json:"scene"`
	UsageLimit      map[dcSDK.JobUsage]int `json:"usage_limit"`
	LocalTotalLimit int                    `json:"local_total_limit"`
	Preload         *dcSDK.PreloadConfig   `json:"preload"`
	FilterRules     []dcSDK.FilterRuleItem `json:"filter_rules"`
}

WorkSettingsResp describe the response of updating work settings to controller

type WorkSlotsFreeParam

type WorkSlotsFreeParam struct {
	Host  *dcProtocol.Host `json:"host_slots"`
	Usage dcSDK.JobUsage   `json:"usage"`
}

WorkSlotsFreeParam describe the param to unlock remote slots

type WorkSlotsOccupyParam

type WorkSlotsOccupyParam struct {
	Usage dcSDK.JobUsage `json:"usage"`
}

WorkSlotsOccupyParam describe the param to lock remote slots

type WorkSlotsOccupyResp

type WorkSlotsOccupyResp struct {
	Host *dcProtocol.Host `json:"host_slots"`
}

WorkSlotsOccupyResp describe the response of locking remote slots

type WorkStatsParam

type WorkStatsParam struct {
	Success bool `json:"success"`
}

WorkStatsParam describe the param to update work stats

type WorkStatusResp

type WorkStatusResp struct {
	Status *dcSDK.WorkStatusDetail `json:"status"`
}

WorkStatusResp describe the response of getting work status

type WorkUnregisterParam

type WorkUnregisterParam struct {
	Force   bool             `json:"force"`
	Release *v2.ParamRelease `json:"release"`
}

WorkUnregisterParam describe the param to unregister work

type WorkerChanged

type WorkerChanged struct {
	OldWorkID string `json:"old_work_id"`
	NewWorkID string `json:"new_work_id"`
}

type WorkerKeyConfigParam

type WorkerKeyConfigParam struct {
	BatchMode bool   `json:"batch_mode"`
	ProjectID string `json:"project_id"`
	Scene     string `json:"scene"`
}

WorkerKeyConfigParam describe the param of work unique key

Jump to

Keyboard shortcuts

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