Documentation ¶
Index ¶
- Variables
- func GetManager() types.Mgr
- func InitStorage() (err error)
- func NewSDK(config dcSDK.ControllerConfig) dcSDK.ControllerSDK
- func SaveControllerInfo(pid, port int, success bool, message string, d, f string) error
- type AvailableResp
- type CommonConfigParam
- type JobStatsParam
- type LocalSlotsFreeParam
- type LocalSlotsOccupyParam
- type LocalTaskExecuteParam
- type LocalTaskExecuteResp
- type Message
- type MessageLevel
- type PBHttpResult
- func (*PBHttpResult) Descriptor() ([]byte, []int)deprecated
- func (x *PBHttpResult) GetCode() int32
- func (x *PBHttpResult) GetMessage() []byte
- func (x *PBHttpResult) GetResult() bool
- func (*PBHttpResult) ProtoMessage()
- func (x *PBHttpResult) ProtoReflect() protoreflect.Message
- func (x *PBHttpResult) Reset()
- func (x *PBHttpResult) String() string
- type PBLocalExecuteResult
- func (*PBLocalExecuteResult) Descriptor() ([]byte, []int)deprecated
- func (x *PBLocalExecuteResult) GetBasic() *PBHttpResult
- func (x *PBLocalExecuteResult) GetExitCode() int32
- func (x *PBLocalExecuteResult) GetMessage() []byte
- func (x *PBLocalExecuteResult) GetStderr() []byte
- func (x *PBLocalExecuteResult) GetStdout() []byte
- func (*PBLocalExecuteResult) ProtoMessage()
- func (x *PBLocalExecuteResult) ProtoReflect() protoreflect.Message
- func (x *PBLocalExecuteResult) Reset()
- func (x *PBLocalExecuteResult) String() string
- type RemoteTaskExecuteParam
- type RemoteTaskExecuteResp
- type RemoteTaskSendFileParam
- type RemoteTaskSendFileResp
- type ToolChainParam
- type WorkRegisterParam
- type WorkRegisterResp
- type WorkSettingsParam
- type WorkSettingsResp
- type WorkSlotsFreeParam
- type WorkSlotsOccupyParam
- type WorkSlotsOccupyResp
- type WorkStatsParam
- type WorkStatusResp
- type WorkUnregisterParam
- type WorkerChanged
- type WorkerKeyConfigParam
Constants ¶
This section is empty.
Variables ¶
var ( ControllerProcessfile = "bk-dist-controller-process.json" ShaderProcessfile = "bk-shader-tool-process.json" // 文件名不能改,和ue源码中保持一致 )
var File_types_proto protoreflect.FileDescriptor
Functions ¶
func InitStorage ¶
func InitStorage() (err error)
InitStorage After server init, the instances of manager, store ... etc. should be given into api handler.
func NewSDK ¶
func NewSDK(config dcSDK.ControllerConfig) dcSDK.ControllerSDK
NewSDK get a new controller SDK with config
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 ¶
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 ¶
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 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