Documentation ¶
Index ¶
- Constants
- Variables
- type BasicMgr
- type CB4ResChanged
- type CommonConfig
- type FileCollectionInfo
- type FileInfo
- type FileSendStatus
- type FilesByServer
- type FilesDetails
- type JobStats
- type LocalMgr
- type LocalSlotsFreeConfig
- type LocalSlotsOccupyConfig
- type LocalTaskExecuteRequest
- type LocalTaskExecuteResult
- type Mgr
- type MgrSet
- type RemoteMgr
- type RemoteTaskExecuteRequest
- type RemoteTaskExecuteResult
- type RemoteTaskSendFileRequest
- type RemoteTaskSendFileResult
- type ResourceMgr
- type ToolChain
- type Work
- func (w *Work) Basic() BasicMgr
- func (w *Work) Cancel()
- func (w *Work) Config() *config.ServerConfig
- func (w *Work) GetRecorder(key string) (*recorder.Recorder, error)
- func (w *Work) ID() string
- func (w *Work) Local() LocalMgr
- func (w *Work) Lock()
- func (w *Work) LockMgr() dcSDK.LockMgr
- func (w *Work) RLock()
- func (w *Work) RUnlock()
- func (w *Work) Remote() RemoteMgr
- func (w *Work) Resource() ResourceMgr
- func (w *Work) Unlock()
- type WorkAnalysisStatus
- func (was *WorkAnalysisStatus) BasicCount() (remoteOK, remoteError, localOK, localError int)
- func (was *WorkAnalysisStatus) DumpJobs() []byte
- func (was *WorkAnalysisStatus) GetJobsByIndex(index int) []*dcSDK.ControllerJobStats
- func (was *WorkAnalysisStatus) Reset() error
- func (was *WorkAnalysisStatus) Update(stats *dcSDK.ControllerJobStats)
- type WorkCommonStatus
- type WorkInfo
- func (wi WorkInfo) BazelNoLauncher() bool
- func (wi *WorkInfo) CanBeEnd() bool
- func (wi *WorkInfo) CanBeHeartbeat() bool
- func (wi *WorkInfo) CanBeRegister() bool
- func (wi *WorkInfo) CanBeRemoved() bool
- func (wi *WorkInfo) CanBeResourceApplied() bool
- func (wi *WorkInfo) CanBeResourceApplyFailed() bool
- func (wi *WorkInfo) CanBeResourceApplying() bool
- func (wi *WorkInfo) CanBeSetSettings() bool
- func (wi *WorkInfo) CanBeStart() bool
- func (wi *WorkInfo) CanBeUnregistered() bool
- func (wi *WorkInfo) CommonStatus() WorkCommonStatus
- func (wi *WorkInfo) DecPrepared()
- func (wi WorkInfo) Dump() []byte
- func (wi *WorkInfo) End(timeoutBefore time.Duration)
- func (wi *WorkInfo) EndTime(t time.Time)
- func (wi *WorkInfo) GetPrepared() int32
- func (wi *WorkInfo) IncPrepared()
- func (wi *WorkInfo) Init()
- func (wi *WorkInfo) IsBatchMode() bool
- func (wi *WorkInfo) IsUnregistered() bool
- func (wi *WorkInfo) IsWorking() bool
- func (wi *WorkInfo) LastHeartbeat() time.Time
- func (wi WorkInfo) ProjectID() string
- func (wi *WorkInfo) Register(batchMode bool)
- func (wi *WorkInfo) RegisterTime(t time.Time)
- func (wi *WorkInfo) ResourceApplied()
- func (wi *WorkInfo) ResourceApplyFailed()
- func (wi *WorkInfo) ResourceApplying()
- func (wi WorkInfo) Scene() string
- func (wi *WorkInfo) SetBazelNoLauncher(flag bool)
- func (wi *WorkInfo) SetProjectID(projectID string)
- func (wi *WorkInfo) SetRemovable()
- func (wi *WorkInfo) SetScene(scene string)
- func (wi *WorkInfo) SetSettings(settings *WorkSettings)
- func (wi *WorkInfo) SetStats(stats *WorkStats)
- func (wi *WorkInfo) SetStatusMessage(s string)
- func (wi *WorkInfo) Start()
- func (wi *WorkInfo) StartTime(t time.Time)
- func (wi *WorkInfo) Status() dcSDK.WorkStatus
- func (wi *WorkInfo) StatusMessage() string
- func (wi WorkInfo) Success() bool
- func (wi WorkInfo) TaskID() string
- func (wi *WorkInfo) Unregister()
- func (wi *WorkInfo) UpdateHeartbeat(t time.Time)
- func (wi WorkInfo) WorkID() string
- type WorkRegisterConfig
- type WorkSettings
- type WorkStats
- type WorkStatsDetail
- type WorkStatsDetailList
- type WorkUnregisterConfig
- type WorkerKeyConfig
Constants ¶
const ( WorkIDLength = 5 GlobalRecorderKey = "global_records" )
Variables ¶
var ( ErrWorkIDGenerateFailed = fmt.Errorf("work id generate failed") ErrNoAvailableWorkFound = fmt.Errorf("no available work found") ErrWorkCannotBeRegistered = fmt.Errorf("work can not be registered") ErrWorkCannotBeUnregistered = fmt.Errorf("work can not be unregistered") ErrHostSlotOverLimit = fmt.Errorf("host slot over limit") ErrHostNoFound = fmt.Errorf("host no found") ErrWorkNoFound = fmt.Errorf("work no found") ErrNoWork = fmt.Errorf("not any work") ErrNoAvailableHostSlotFound = fmt.Errorf("no available host slot found") ErrWorkResourceCannotBeSet = fmt.Errorf("work resource can not be set") ErrWorkSettingsCannotBeSet = fmt.Errorf("work settings can not be set") ErrWorkIsNotWorking = fmt.Errorf("work is not working") ErrWorkUnknownJobUsage = fmt.Errorf("unknown job usage") ErrWorkNoAvailableJobUsageFound = fmt.Errorf("no available job usage found") ErrWorkCannotBeStart = fmt.Errorf("work can not be start") ErrWorkCannotBeEnd = fmt.Errorf("work can not be end") ErrFileNotFound = fmt.Errorf("not found file info") ErrWorkCannotBeUpdatedHeartbeat = fmt.Errorf("work can not be updated heartbeat") ErrSendFileFailed = fmt.Errorf("send file failed") ErrTaskCannotBeReleased = fmt.Errorf("task can not be released") ErrTaskAlreadyReleased = fmt.Errorf("task already released") ErrSlotsLockFailed = fmt.Errorf("slots lock failed`") ErrNoWaitingTask = fmt.Errorf("no waitting task") ErrFileLock = fmt.Errorf("lock file failed") ErrWorkIDEmpty = fmt.Errorf("work id is empty") )
define exported error messages
Functions ¶
This section is empty.
Types ¶
type BasicMgr ¶
type BasicMgr interface { // if there a task running in work Alive() int64 // call it when a task enter EnterTask() // call it when a task leave LeaveTask() // get work settings Settings() *WorkSettings // update work settings SetSettings(settings *WorkSettings) // get work info Info() *WorkInfo // update single job stats UpdateJobStats(stats *dcSDK.ControllerJobStats) // update work stats UpdateWorkStats(stats *WorkStats) // update work heartbeat Heartbeat() error // do register work Register(config *WorkRegisterConfig) error // do apply resource ApplyResource(config *WorkRegisterConfig) error // do unregister work Unregister(config *WorkUnregisterConfig) error // start work Start() error // end work End(timeoutBefore time.Duration) error // hang until the work is working(by someone else) WaitUntilWorking(ctx context.Context) bool // get work details GetDetails(jobIndex int) *WorkStatsDetail // get analysis status AnalysisStatus() *WorkAnalysisStatus // reset stat ResetStat() error // update toolchain SetToolChain(toolchain *ToolChain) error // get toolchain files by key GetToolChainFiles(key string) ([]dcSDK.FileDesc, int64, error) // get toolchain relative files by key GetToolChainRelativeFiles(key string) ([]dcSDK.FileDesc, int64, error) // get toolchain remote path by key GetToolChainRemotePath(key string) (string, error) // get toolchain remote Relative path by key GetToolChainRelativeRemotePath(key string) (string, error) // get toolchain timestamp by key GetToolChainTimestamp(key string) (int64, error) // add registered count for batch mode IncRegistered() // minus registered count for batch mode DecRegistered() }
BasicMgr describe a manager for handling all actions with work basic issues
type CB4ResChanged ¶
type CB4ResChanged func() error
CB4ResChanged call back function when remote resource changed
type CommonConfig ¶
type CommonConfig struct { Configkey dcSDK.CommonConfigKey WorkerKey WorkerKeyConfig Data []byte Config interface{} }
CommonConfig common work config
func (*CommonConfig) KeyEqual ¶
func (ccf *CommonConfig) KeyEqual(other *CommonConfig) bool
Equal check if the two key are point to one work config
type FileCollectionInfo ¶
type FileCollectionInfo struct { UniqID string `json:"uniq_id"` SendStatus FileSendStatus `json:"send_status"` Files []dcSDK.FileDesc `json:"files"` Timestamp int64 `json:"timestamp"` }
FileCollectionInfo save file collection send status
type FileInfo ¶
type FileInfo struct { FullPath string `json:"full_path"` Size int64 `json:"size"` LastModifyTime int64 `json:"last_modify_time"` Md5 string `json:"md5"` TargetRelativePath string `json:"target_relative_path"` FileMode uint32 `json:"file_mode"` LinkTarget string `json:"link_target"` SendStatus FileSendStatus `json:"send_status"` }
FileInfo record file info
type FileSendStatus ¶
type FileSendStatus int
FileSendStatus save file send status
const ( FileSendInit FileSendStatus = iota FileSending FileSendSucceed FileSendFailed FileSendUnknown = 99 )
define file send status
func (FileSendStatus) String ¶
func (f FileSendStatus) String() string
String return the string of FileSendStatus
type FilesByServer ¶
FilesByServer record files info to send for one server
type FilesDetails ¶
type FilesDetails struct { Servers []*dcProtocol.Host File dcSDK.FileDesc }
FilesDetails describe the files details and the target server to send to.
type JobStats ¶
type JobStats struct { Pid int `json:"pid"` WorkID string `json:"work_id"` TaskID string `json:"task_id"` BoosterType string `json:"booster_type"` Success bool `json:"success"` PreWorkSuccess bool `json:"pre_work_success"` RemoteWorkSuccess bool `json:"remote_work_success"` PostWorkSuccess bool `json:"post_work_success"` FinalWorkSuccess bool `json:"final_work_success"` LocalWorkSuccess bool `json:"local_work_success"` OriginArgs []string `json:"origin_args"` EnterTime int64 `json:"enter_time"` LeaveTime int64 `json:"leave_time"` PreWorkEnterTime int64 `json:"pre_work_enter_time"` PreWorkLeaveTime int64 `json:"pre_work_leave_time"` PreWorkLockTime int64 `json:"pre_work_lock_time"` PreWorkUnlockTime int64 `json:"pre_work_unlock_time"` PreWorkStartTime int64 `json:"pre_work_start_time"` PreWorkEndTime int64 `json:"pre_work_end_time"` PostWorkEnterTime int64 `json:"post_work_enter_time"` PostWorkLeaveTime int64 `json:"post_work_leave_time"` PostWorkLockTime int64 `json:"post_work_lock_time"` PostWorkUnlockTime int64 `json:"post_work_unlock_time"` PostWorkStartTime int64 `json:"post_work_start_time"` PostWorkEndTime int64 `json:"post_work_end_time"` FinalWorkStartTime int64 `json:"final_work_start_time"` FinalWorkEndTime int64 `json:"final_work_end_time"` RemoteWorkEnterTime int64 `json:"remote_work_enter_time"` RemoteWorkLeaveTime int64 `json:"remote_work_leave_time"` RemoteWorkLockTime int64 `json:"remote_work_lock_time"` RemoteWorkUnlockTime int64 `json:"remote_work_unlock_time"` RemoteWorkStartTime int64 `json:"remote_work_start_time"` RemoteWorkEndTime int64 `json:"remote_work_end_time"` RemoteWorkPackStartTime int64 `json:"remote_work_pack_start_time"` RemoteWorkPackEndTime int64 `json:"remote_work_pack_end_time"` RemoteWorkSendStartTime int64 `json:"remote_work_send_start_time"` RemoteWorkSendEndTime int64 `json:"remote_work_send_end_time"` RemoteWorkPackCommonStartTime int64 `json:"remote_work_pack_common_start_time"` RemoteWorkPackCommonEndTime int64 `json:"remote_work_pack_common_end_time"` RemoteWorkSendCommonStartTime int64 `json:"remote_work_send_common_start_time"` RemoteWorkSendCommonEndTime int64 `json:"remote_work_send_common_end_time"` RemoteWorkProcessStartTime int64 `json:"remote_work_process_start_time"` RemoteWorkProcessEndTime int64 `json:"remote_work_process_end_time"` RemoteWorkReceiveStartTime int64 `json:"remote_work_receive_start_time"` RemoteWorkReceiveEndTime int64 `json:"remote_work_receive_end_time"` RemoteWorkUnpackStartTime int64 `json:"remote_work_unpack_start_time"` RemoteWorkUnpackEndTime int64 `json:"remote_work_unpack_end_time"` LocalWorkEnterTime int64 `json:"local_work_enter_time"` LocalWorkLeaveTime int64 `json:"local_work_leave_time"` LocalWorkLockTime int64 `json:"local_work_lock_time"` LocalWorkUnlockTime int64 `json:"local_work_unlock_time"` LocalWorkStartTime int64 `json:"local_work_start_time"` LocalWorkEndTime int64 `json:"local_work_end_time"` }
JobStats describe the single job stats
type LocalMgr ¶
type LocalMgr interface { // init handler Init() Start() // lock local slot LockSlots(usage dcSDK.JobUsage, weight int32) bool // unlock local slot UnlockSlots(usage dcSDK.JobUsage, weight int32) // do task execution ExecuteTask(req *LocalTaskExecuteRequest, globalWork *Work, withlocalresource bool) (*LocalTaskExecuteResult, error) // get caches in pump mode GetPumpCache() (*analyser.FileCache, *analyser.RootCache) // get local slots info Slots() (int, int) }
LocalMgr describe a manager for handling all actions with local execution for work
type LocalSlotsFreeConfig ¶
LocalSlotsFreeConfig describe the local slot unlock config
type LocalSlotsOccupyConfig ¶
LocalSlotsOccupyConfig describe the local slot lock config
type LocalTaskExecuteRequest ¶
type LocalTaskExecuteRequest struct { Pid int Dir string User user.User Commands []string Environments []string Stats *dcSDK.ControllerJobStats }
LocalTaskExecuteRequest describe the local task execution param
type LocalTaskExecuteResult ¶
type LocalTaskExecuteResult struct {
Result *dcSDK.LocalTaskResult
}
LocalTaskExecuteResult describe the local task execution result
type Mgr ¶
type Mgr interface { // brings up the handler Run() // register work with config, return the work information, // and tell the caller if he is a leader in batch mode(always true in normal mode) RegisterWork(config *WorkRegisterConfig) (*WorkInfo, bool, error) // unregister specific work UnregisterWork(workID string, config *WorkUnregisterConfig) error // update heartbeat to work Heartbeat(workID string) error // start the work StartWork(workID string) error // end the work EndWork(workID string) error // update work settings SetWorkSettings(workID string, settings *WorkSettings) error // get work settings GetWorkSettings(workID string) (*WorkSettings, error) // get work status GetWorkStatus(workID string) (*dcSDK.WorkStatusDetail, error) // lock a local slot LockLocalSlots(workID string, usage dcSDK.JobUsage, weight int32) error // unlock a local slot UnlockLocalSlots(workID string, usage dcSDK.JobUsage, weight int32) error // do task ExecuteLocalTask(workID string, req *LocalTaskExecuteRequest) (*LocalTaskExecuteResult, error) // do remote task directly ExecuteRemoteTask(workID string, req *RemoteTaskExecuteRequest) (*RemoteTaskExecuteResult, error) // send files to remote worker SendRemoteFile(workID string, req *RemoteTaskSendFileRequest) error // update single job stats UpdateJobStats(workID string, stats *dcSDK.ControllerJobStats) error // update work stats UpdateWorkStats(workID string, stats *WorkStats) error // get work list GetWorkDetailList() WorkStatsDetailList // get work detail GetWorkDetail(workID string, index int) (*WorkStatsDetail, error) // update common controller config SetCommonConfig(config *CommonConfig) error // get caches in pump mode GetPumpCache(workID string) (*analyser.FileCache, *analyser.RootCache, error) // Get first workid GetFirstWorkID() (string, error) // Get first bazelNoLauncher workid GetFirstBazelNoLauncherWorkID() (string, error) }
Mgr describe a manager for handling all actions in controller
type MgrSet ¶
type MgrSet struct { Basic func(context.Context, *Work) BasicMgr Local func(context.Context, *Work) LocalMgr Remote func(context.Context, *Work) RemoteMgr Resource func(context.Context, *Work) ResourceMgr }
MgrSet describe the newer functions for work
type RemoteMgr ¶
type RemoteMgr interface { // init handler Init() Start() // run task in remote worker ExecuteTask(req *RemoteTaskExecuteRequest) (*RemoteTaskExecuteResult, error) // send files to remote worker SendFiles(req *RemoteTaskSendFileRequest) ([]string, error) // get total remote worker slots TotalSlots() int // inc remote jobs IncRemoteJobs() // dec remote jobs DecRemoteJobs() }
RemoteMgr describe a manager for handling all actions with remote workers for work
type RemoteTaskExecuteRequest ¶
type RemoteTaskExecuteRequest struct { Pid int Server *dcProtocol.Host Req *dcSDK.BKDistCommand Stats *dcSDK.ControllerJobStats Sandbox *dcSyscall.Sandbox IOTimeout int BanWorkerList []*dcProtocol.Host }
RemoteTaskExecuteRequest describe the remote task execution param
type RemoteTaskExecuteResult ¶
type RemoteTaskExecuteResult struct {
Result *dcSDK.BKDistResult
}
RemoteTaskExecuteResult describe the remote task execution result
type RemoteTaskSendFileRequest ¶
type RemoteTaskSendFileRequest struct { Pid int Server *dcProtocol.Host Req []dcSDK.FileDesc Sandbox *dcSyscall.Sandbox Stats *dcSDK.ControllerJobStats }
RemoteTaskSendFileRequest describe the file sending param
type RemoteTaskSendFileResult ¶
type RemoteTaskSendFileResult struct {
Result *dcSDK.BKSendFileResult
}
RemoteTaskSendFileResult describe the file sending result
type ResourceMgr ¶
type ResourceMgr interface { // check if there are ready-to-work workers HasAvailableWorkers() bool // update tbs-server target SetServerHost(serverHost string) // update specific worker list SetSpecificHosts(hostList []string) // send stats, if brief true, then will not send the job stats SendStats(brief bool) error // send stats and reset after sent, if brief true, then will not send the job stats // !! this will call m.work.Lock() , to avoid dead lock SendAndResetStats(brief bool, resapplytimes []int64) error // get resource status GetStatus() *v2.RespTaskInfo // get worker list GetHosts() []*dcProtocol.Host // apply resource Apply(req *v2.ParamApply, force bool) (*v2.RespTaskInfo, error) // release resource Release(req *v2.ParamRelease) error // register call back function RegisterCallback(f CB4ResChanged) error // check whether apply finished IsApplyFinished() bool // TODO : check whether support abs path SupportAbsPath() bool }
ResourceMgr describe a manager for handling all actions with resource and server for work
type ToolChain ¶
type ToolChain struct { ToolKey string ToolName string ToolLocalFullPath string ToolRemoteRelativePath string Files []dcSDK.ToolFile Timestamp int64 }
ToolChain describe the toolchain info
type Work ¶
Work describe a set of complete actions one work, one resource
func NewWork ¶
func NewWork(id string, conf *config.ServerConfig, mgrSet MgrSet, rp *recorder.RecordersPool) *Work
NewWork get a new Work
func (*Work) GetRecorder ¶
GetRecorder return the Recorder instance for given key
type WorkAnalysisStatus ¶
type WorkAnalysisStatus struct {
// contains filtered or unexported fields
}
WorkAnalysisStatus describe the work analyasus status
func NewWorkAnalysisStatus ¶
func NewWorkAnalysisStatus() *WorkAnalysisStatus
NewWorkAnalysisStatus get a new WorkAnalysisStatus
func (*WorkAnalysisStatus) BasicCount ¶
func (was *WorkAnalysisStatus) BasicCount() (remoteOK, remoteError, localOK, localError int)
BasicCount return some counts for job data
func (*WorkAnalysisStatus) DumpJobs ¶
func (was *WorkAnalysisStatus) DumpJobs() []byte
DumpJobs encode WorkAnalysisStatus into json bytes
func (*WorkAnalysisStatus) GetJobsByIndex ¶
func (was *WorkAnalysisStatus) GetJobsByIndex(index int) []*dcSDK.ControllerJobStats
GetJobsByIndex get the jobs whose index is larger than the given index
func (*WorkAnalysisStatus) Reset ¶
func (was *WorkAnalysisStatus) Reset() error
Reset reset stat datas
func (*WorkAnalysisStatus) Update ¶
func (was *WorkAnalysisStatus) Update(stats *dcSDK.ControllerJobStats)
Update 管理所有的job stats信息, 根据pid和进入executor的时间作为key来存储, 默认同一个key的caller需要保证stats是按照时间顺序来update的, 后来的会直接覆盖前者
type WorkCommonStatus ¶
type WorkCommonStatus struct { Status dcSDK.WorkStatus Message string LastStatusChangeTime time.Time InitTime time.Time StartTime time.Time EndTime time.Time RegisteredTime time.Time UnregisteredTime time.Time ResourceApplyingTime time.Time ResourceAppliedTime time.Time ResourceApplyFailedTime time.Time RemovableTime time.Time }
WorkCommonStatus describe the work status and actions timestamp
type WorkInfo ¶
type WorkInfo struct {
// contains filtered or unexported fields
}
WorkInfo describe the information in a single work
func NewInitWorkInfo ¶
NewInitWorkInfo get a new work info by id
func (WorkInfo) BazelNoLauncher ¶
BazelNoLauncher return bazelNoLauncher
func (*WorkInfo) CanBeHeartbeat ¶
CanBeHeartbeat check if work can be updated heartbeat from booster now
func (*WorkInfo) CanBeRegister ¶
CanBeRegistered check if work can be registered now
func (*WorkInfo) CanBeRemoved ¶
CanBeRemoved check if work can be removed now
func (*WorkInfo) CanBeResourceApplied ¶
CanBeResourceApplied check if work can be set resource applied now
func (*WorkInfo) CanBeResourceApplyFailed ¶
CanBeResourceApplyFailed check if work can be set resource apply failed now
func (*WorkInfo) CanBeResourceApplying ¶
CanBeResourceApplying check if work can apply resource now
func (*WorkInfo) CanBeSetSettings ¶
CanBeSetSettings check if work can be set settings now
func (*WorkInfo) CanBeStart ¶
CanBeStart check if work can be started now
func (*WorkInfo) CanBeUnregistered ¶
CanBeUnregistered check if work can be unregistered now
func (*WorkInfo) CommonStatus ¶
func (wi *WorkInfo) CommonStatus() WorkCommonStatus
CommonStatus return work common status
func (*WorkInfo) DecPrepared ¶
func (wi *WorkInfo) DecPrepared()
DecPrepared to inc preared remote task number
func (*WorkInfo) GetPrepared ¶
GetPrepared to get preared remote task number
func (*WorkInfo) IncPrepared ¶
func (wi *WorkInfo) IncPrepared()
IncPrepared to inc preared remote task number
func (*WorkInfo) IsBatchMode ¶
IsBatchMode check if the work is in batch mode
func (*WorkInfo) IsUnregistered ¶
IsUnregistered check if work is unregistered
func (*WorkInfo) LastHeartbeat ¶
LastHeartbeat return the last heartbeat time
func (*WorkInfo) RegisterTime ¶
Start set work start time
func (*WorkInfo) ResourceApplied ¶
func (wi *WorkInfo) ResourceApplied()
ResourceApplied set work resource applied
func (*WorkInfo) ResourceApplyFailed ¶
func (wi *WorkInfo) ResourceApplyFailed()
ResourceApplyFailed set work resource apply failed
func (*WorkInfo) ResourceApplying ¶
func (wi *WorkInfo) ResourceApplying()
ResourceApplying set work resource apply
func (*WorkInfo) SetBazelNoLauncher ¶
SetBazelNoLauncher update bazelNoLauncher
func (*WorkInfo) SetProjectID ¶
SetProjectID update project id
func (*WorkInfo) SetSettings ¶
func (wi *WorkInfo) SetSettings(settings *WorkSettings)
SetSettings update work settings
func (*WorkInfo) SetStatusMessage ¶
SetStatusMessage update the status message
func (*WorkInfo) StatusMessage ¶
StatusMessage return the status message
func (*WorkInfo) UpdateHeartbeat ¶
UpdateHeartbeat update heartbeat time
type WorkRegisterConfig ¶
type WorkRegisterConfig 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"` }
WorkRegisterConfig describe the config of registering work
type WorkSettings ¶
type WorkSettings struct { TaskID string ProjectID string Scene string UsageLimit map[dcSDK.JobUsage]int LocalTotalLimit int Preload *dcSDK.PreloadConfig FilterRules dcSDK.FilterRules Degraded bool GlobalSlots bool }
WorkSettings describe the work settings
func (*WorkSettings) Dump ¶
func (ws *WorkSettings) Dump() []byte
Dump encode work settings to json bytes
type WorkStats ¶
type WorkStats struct {
Success bool `json:"success"`
}
WorkStats describe the work stats
type WorkStatsDetail ¶
type WorkStatsDetail struct { CurrentTime int64 `json:"current_time"` WorkID string `json:"work_id"` TaskID string `json:"task_id"` Scene string `json:"scene"` Status string `json:"status"` Success bool `json:"success"` RegisteredTime int64 `json:"registered_time"` UnregisteredTime int64 `json:"unregistered_time"` StartTime int64 `json:"start_time"` EndTime int64 `json:"end_time"` JobRemoteOK int `json:"job_remote_ok"` JobRemoteError int `json:"job_remote_error"` JobLocalOK int `json:"job_local_ok"` JobLocalError int `json:"job_local_error"` Jobs []*dcSDK.ControllerJobStats `json:"jobs"` }
WorkStatsDetail describe the work stats details
type WorkStatsDetailList ¶
type WorkStatsDetailList []*WorkStatsDetail
func (WorkStatsDetailList) Less ¶
func (wsl WorkStatsDetailList) Less(i, j int) bool
Less do the comparing
func (WorkStatsDetailList) Swap ¶
func (wsl WorkStatsDetailList) Swap(i, j int)
Swap do the data swap
type WorkUnregisterConfig ¶
type WorkUnregisterConfig struct { Force bool `json:"force"` TimeoutBefore time.Duration `json:"timeout_before"` Release *v2.ParamRelease `json:"release"` }
WorkUnregisterConfig describe the config of unregistering work
type WorkerKeyConfig ¶
WorkerKeyConfig describe the work unique key
func (*WorkerKeyConfig) Equal ¶
func (wkc *WorkerKeyConfig) Equal(other *WorkerKeyConfig) bool
Equal check if the two key are point to one work