Documentation
¶
Overview ¶
* Tencent is pleased to support the open source community by making Blueking Container Service available. * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * http://opensource.org/licenses/MIT * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language governing permissions and * limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // NewByTaskBuilder alias task.NewByTaskBuilder NewByTaskBuilder = task.NewByTaskBuilder // TaskStatusSlice ... TaskStatusSlice = []string{ itypes.TaskStatusInit, itypes.TaskStatusRunning, itypes.TaskStatusSuccess, itypes.TaskStatusFailure, itypes.TaskStatusTimeout, itypes.TaskStatusRevoked, itypes.TaskStatusNotStarted, } )
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
BaseModel
TaskID string `gorm:"type:varchar(191);uniqueIndex:idx_task_id"`
TaskType string `gorm:"type:varchar(191);index:idx_task_type"`
TaskIndex string `gorm:"type:varchar(191);index:idx_task_index"`
TaskIndexType string `gorm:"type:varchar(191);index:idx_task_index"`
TaskName string `gorm:"type:varchar(255)"`
GroupID string `gorm:"type:varchar(191);index:idx_group_stage"`
StageSeq int `gorm:"index:idx_group_stage"`
GroupCounted bool
CurrentStep string `gorm:"type:varchar(255)"`
StepSequence []string `gorm:"type:text;serializer:json"`
CallbackName string `gorm:"type:varchar(255)"`
CallbackResult string `gorm:"type:varchar(191)"`
CallbackMessage string `gorm:"type:text"`
CommonParams map[string]string `gorm:"type:text;serializer:json"`
CommonPayload string `gorm:"type:mediumtext"`
Status string `gorm:"type:varchar(191);index:idx_status"`
Message string `gorm:"type:text"`
ExecutionTime uint32
MaxExecutionSeconds uint32
Start time.Time
End time.Time
Creator string `gorm:"type:varchar(255)"`
Updater string `gorm:"type:varchar(255)"`
}
Record 任务记录,对应表 task_records 对应框架的 TaskRecord,此处不带 Task 前缀是因为会与包名重复(revive stutter)
type StepRecord ¶
type StepRecord struct {
gorm.Model
TaskID string `gorm:"type:varchar(191);uniqueIndex:idx_task_id_step_name"`
Name string `gorm:"type:varchar(191);uniqueIndex:idx_task_id_step_name"`
Alias string `gorm:"type:varchar(255)"`
Executor string `gorm:"type:varchar(255)"`
Params map[string]string `gorm:"type:text;serializer:json"`
Payload string `gorm:"type:mediumtext"`
Status string `gorm:"type:varchar(255)"`
Message string `gorm:"type:text"`
ETA *time.Time
SkipOnFailed bool
RetryCount uint32
MaxRetries uint32
ExecutionTime uint32
MaxExecutionSeconds uint32
Start time.Time
End time.Time
}
StepRecord 步骤记录,对应表 task_step_records
type TaskManager ¶
type TaskManager struct {
*task.TaskManager
}
TaskManager task manager nolint: revive
func NewTaskMgr ¶
func NewTaskMgr(ctx context.Context, etcdConfig cc.Etcd, dbConfig cc.Database) (*TaskManager, error)
NewTaskMgr new task manager
func (*TaskManager) Dispatch ¶
func (taskMgr *TaskManager) Dispatch(t *itypes.Task)
Dispatch same task.Dispatch but log when error
func (*TaskManager) EnsureTable ¶
func (taskMgr *TaskManager) EnsureTable(ctx context.Context) error
EnsureTable auto migration 传入 bk-bscp 侧的表结构,避免框架默认结构把负载字段建成 text 导致超长负载被静默截断
Directories
¶
| Path | Synopsis |
|---|---|
|
builder
|
|
|
executor
|
|
|
Package priority 把进程操作的启动优先级映射成任务框架的阶段编排。
|
Package priority 把进程操作的启动优先级映射成任务框架的阶段编排。 |
|
step
|
|
|
hello
* Tencent is pleased to support the open source community by making Blueking Container Service available.
|
* Tencent is pleased to support the open source community by making Blueking Container Service available. |