Documentation
¶
Index ¶
- Constants
- Variables
- type AutoDelete
- type EachTask
- type Job
- type JobContext
- type JobDefaults
- type JobMetrics
- type JobSchedule
- type JobState
- type JobSummary
- type Metrics
- type Mount
- type Node
- type NodeMetrics
- type NodeStatus
- type ParallelTask
- type Permission
- type Probe
- type Registry
- type Role
- type ScheduledJob
- type ScheduledJobState
- type ScheduledJobSummary
- type SubJobTask
- type Task
- type TaskLimits
- type TaskLogPart
- type TaskMetrics
- type TaskRetry
- type TaskState
- type TaskSummary
- type User
- type UserRole
- type UsernameKey
- type Webhook
Constants ¶
View Source
const ( MountTypeVolume string = "volume" MountTypeBind string = "bind" MountTypeTmpfs string = "tmpfs" )
View Source
const ( USER_GUEST string = "guest" USERNAME UsernameKey = "username" )
View Source
const (
ROLE_PUBLIC string = "public"
)
View Source
const (
Version = "0.1.149"
)
Variables ¶
View Source
var (
GitCommit string = "develop"
)
View Source
var HEARTBEAT_RATE = time.Second * 30
View Source
var LAST_HEARTBEAT_TIMEOUT = time.Minute * 5
View Source
var TaskStateActive = []TaskState{ TaskStateCreated, TaskStatePending, TaskStateScheduled, TaskStateRunning, }
Functions ¶
This section is empty.
Types ¶
type AutoDelete ¶ added in v0.1.83
type AutoDelete struct {
After string `json:"after,omitempty"`
}
func (*AutoDelete) Clone ¶ added in v0.1.83
func (a *AutoDelete) Clone() *AutoDelete
type EachTask ¶
type Job ¶
type Job struct {
ID string `json:"id,omitempty"`
ParentID string `json:"parentId,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
State JobState `json:"state,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
CreatedBy *User `json:"createdBy,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
FailedAt *time.Time `json:"failedAt,omitempty"`
Tasks []*Task `json:"tasks"`
Execution []*Task `json:"execution"`
Position int `json:"position"`
Inputs map[string]string `json:"inputs,omitempty"`
Context JobContext `json:"context,omitempty"`
TaskCount int `json:"taskCount,omitempty"`
Output string `json:"output,omitempty"`
Result string `json:"result,omitempty"`
Error string `json:"error,omitempty"`
Defaults *JobDefaults `json:"defaults,omitempty"`
Webhooks []*Webhook `json:"webhooks,omitempty"`
Permissions []*Permission `json:"permissions,omitempty"`
AutoDelete *AutoDelete `json:"autoDelete,omitempty"`
DeleteAt *time.Time `json:"deleteAt,omitempty"`
Secrets map[string]string `json:"secrets,omitempty"`
Progress float64 `json:"progress,omitempty"`
Schedule *JobSchedule `json:"schedule,omitempty"`
}
type JobContext ¶
type JobContext struct {
Job map[string]string `json:"job,omitempty"`
Inputs map[string]string `json:"inputs,omitempty"`
Secrets map[string]string `json:"secrets,omitempty"`
Tasks map[string]string `json:"tasks,omitempty"`
}
func (JobContext) AsMap ¶
func (c JobContext) AsMap() map[string]any
func (JobContext) Clone ¶
func (c JobContext) Clone() JobContext
type JobDefaults ¶ added in v0.1.13
type JobDefaults struct {
Retry *TaskRetry `json:"retry,omitempty"`
Limits *TaskLimits `json:"limits,omitempty"`
Timeout string `json:"timeout,omitempty"`
Queue string `json:"queue,omitempty"`
Priority int `json:"priority,omitempty"`
}
func (*JobDefaults) Clone ¶ added in v0.1.13
func (d *JobDefaults) Clone() *JobDefaults
type JobMetrics ¶ added in v0.1.5
type JobMetrics struct {
Running int `json:"running"`
}
type JobSchedule ¶ added in v0.1.109
func (*JobSchedule) Clone ¶ added in v0.1.109
func (s *JobSchedule) Clone() *JobSchedule
type JobSummary ¶ added in v0.1.6
type JobSummary struct {
ID string `json:"id,omitempty"`
CreatedBy *User `json:"createdBy,omitempty"`
ParentID string `json:"parentId,omitempty"`
Inputs map[string]string `json:"inputs,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
State JobState `json:"state,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
FailedAt *time.Time `json:"failedAt,omitempty"`
Position int `json:"position"`
TaskCount int `json:"taskCount,omitempty"`
Result string `json:"result,omitempty"`
Error string `json:"error,omitempty"`
Progress float64 `json:"progress,omitempty"`
Schedule *JobSchedule `json:"schedule,omitempty"`
}
func NewJobSummary ¶ added in v0.1.6
func NewJobSummary(j *Job) *JobSummary
type Metrics ¶ added in v0.1.5
type Metrics struct {
Jobs JobMetrics `json:"jobs"`
Tasks TaskMetrics `json:"tasks"`
Nodes NodeMetrics `json:"nodes"`
}
type Mount ¶ added in v0.1.14
type Mount struct {
ID string `json:"-"`
Type string `json:"type,omitempty"`
Source string `json:"source,omitempty"`
Target string `json:"target,omitempty"`
Opts map[string]string `json:"opts,omitempty"`
}
func CloneMounts ¶ added in v0.1.145
type Node ¶
type Node struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
StartedAt time.Time `json:"startedAt,omitempty"`
CPUPercent float64 `json:"cpuPercent,omitempty"`
LastHeartbeatAt time.Time `json:"lastHeartbeatAt,omitempty"`
Queue string `json:"queue,omitempty"`
Status NodeStatus `json:"status,omitempty"`
Hostname string `json:"hostname,omitempty"`
Port int `json:"port,omitempty"`
TaskCount int `json:"taskCount,omitempty"`
Version string `json:"version"`
}
type NodeMetrics ¶ added in v0.1.5
type NodeStatus ¶
type NodeStatus string
const ( NodeStatusUP NodeStatus = "UP" NodeStatusDown NodeStatus = "DOWN" NodeStatusOffline NodeStatus = "OFFLINE" )
type ParallelTask ¶
type ParallelTask struct {
Tasks []*Task `json:"tasks,omitempty"`
Completions int `json:"completions,omitempty"`
}
func (*ParallelTask) Clone ¶
func (p *ParallelTask) Clone() *ParallelTask
type Permission ¶ added in v0.1.80
func ClonePermissions ¶ added in v0.1.80
func ClonePermissions(perms []*Permission) []*Permission
func (*Permission) Clone ¶ added in v0.1.80
func (p *Permission) Clone() *Permission
type Probe ¶ added in v0.1.131
type Registry ¶ added in v0.1.11
type Role ¶ added in v0.1.80
type ScheduledJob ¶ added in v0.1.109
type ScheduledJob struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Cron string `json:"cron,omitempty"`
State ScheduledJobState `json:"state,omitempty"`
Inputs map[string]string `json:"inputs,omitempty"`
Tasks []*Task `json:"tasks"`
CreatedBy *User `json:"createdBy,omitempty"`
Defaults *JobDefaults `json:"defaults,omitempty"`
AutoDelete *AutoDelete `json:"autoDelete,omitempty"`
Webhooks []*Webhook `json:"webhooks,omitempty"`
Permissions []*Permission `json:"permissions,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
Tags []string `json:"tags,omitempty"`
Secrets map[string]string `json:"secrets,omitempty"`
Output string `json:"output,omitempty"`
}
func (*ScheduledJob) Clone ¶ added in v0.1.109
func (j *ScheduledJob) Clone() *ScheduledJob
type ScheduledJobState ¶ added in v0.1.109
type ScheduledJobState string
const ( ScheduledJobStateActive ScheduledJobState = "ACTIVE" ScheduledJobStatePaused ScheduledJobState = "PAUSED" )
type ScheduledJobSummary ¶ added in v0.1.109
type ScheduledJobSummary struct {
ID string `json:"id,omitempty"`
CreatedBy *User `json:"createdBy,omitempty"`
Inputs map[string]string `json:"inputs,omitempty"`
State ScheduledJobState `json:"state,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
Cron string `json:"cron,omitempty"`
}
func NewScheduledJobSummary ¶ added in v0.1.109
func NewScheduledJobSummary(sj *ScheduledJob) *ScheduledJobSummary
type SubJobTask ¶
type SubJobTask struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Tasks []*Task `json:"tasks,omitempty"`
Inputs map[string]string `json:"inputs,omitempty"`
Secrets map[string]string `json:"secrets,omitempty"`
AutoDelete *AutoDelete `json:"autoDelete,omitempty"`
Output string `json:"output,omitempty"`
Detached bool `json:"detached,omitempty"`
Webhooks []*Webhook `json:"webhooks,omitempty"`
}
func (*SubJobTask) Clone ¶
func (s *SubJobTask) Clone() *SubJobTask
type Task ¶
type Task struct {
ID string `json:"id,omitempty"`
JobID string `json:"jobId,omitempty"`
ParentID string `json:"parentId,omitempty"`
Position int `json:"position,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
State TaskState `json:"state,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
ScheduledAt *time.Time `json:"scheduledAt,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
FailedAt *time.Time `json:"failedAt,omitempty"`
CMD []string `json:"cmd,omitempty"`
Entrypoint []string `json:"entrypoint,omitempty"`
Run string `json:"run,omitempty"`
Image string `json:"image,omitempty"`
Registry *Registry `json:"registry,omitempty"`
Env map[string]string `json:"env,omitempty"`
Files map[string]string `json:"files,omitempty"`
Queue string `json:"queue,omitempty"`
Redelivered int `json:"redelivered,omitempty"`
Error string `json:"error,omitempty"`
Pre []*Task `json:"pre,omitempty"`
Post []*Task `json:"post,omitempty"`
Sidecars []*Task `json:"sidecars,omitempty"`
Mounts []*Mount `json:"mounts,omitempty"`
Networks []string `json:"networks,omitempty"`
NodeID string `json:"nodeId,omitempty"`
Retry *TaskRetry `json:"retry,omitempty"`
Limits *TaskLimits `json:"limits,omitempty"`
Timeout string `json:"timeout,omitempty"`
Result string `json:"result,omitempty"`
Var string `json:"var,omitempty"`
If string `json:"if,omitempty"`
Parallel *ParallelTask `json:"parallel,omitempty"`
Each *EachTask `json:"each,omitempty"`
SubJob *SubJobTask `json:"subjob,omitempty"`
GPUs string `json:"gpus,omitempty"`
Tags []string `json:"tags,omitempty"`
Workdir string `json:"workdir,omitempty"`
Priority int `json:"priority,omitempty"`
Progress float64 `json:"progress,omitempty"`
Probe *Probe `json:"probe,omitempty"`
}
Task is the basic unit of work that a Worker can handle.
func CloneTasks ¶
type TaskLimits ¶
type TaskLimits struct {
CPUs string `json:"cpus,omitempty"`
Memory string `json:"memory,omitempty"`
}
func (*TaskLimits) Clone ¶
func (l *TaskLimits) Clone() *TaskLimits
type TaskLogPart ¶ added in v0.1.63
type TaskMetrics ¶ added in v0.1.5
type TaskMetrics struct {
Running int `json:"running"`
}
type TaskRetry ¶
type TaskState ¶
type TaskState = string
State defines the list of states that a task can be in, at any given moment.
const ( TaskStateCreated TaskState = "CREATED" TaskStatePending TaskState = "PENDING" TaskStateScheduled TaskState = "SCHEDULED" TaskStateRunning TaskState = "RUNNING" TaskStateCancelled TaskState = "CANCELLED" TaskStateStopped TaskState = "STOPPED" TaskStateCompleted TaskState = "COMPLETED" TaskStateFailed TaskState = "FAILED" TaskStateSkipped TaskState = "SKIPPED" )
type TaskSummary ¶ added in v0.1.62
type TaskSummary struct {
ID string `json:"id,omitempty"`
JobID string `json:"jobId,omitempty"`
Position int `json:"position,omitempty"`
Progress float64 `json:"progress,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
State TaskState `json:"state,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
ScheduledAt *time.Time `json:"scheduledAt,omitempty"`
StartedAt *time.Time `json:"startedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
Error string `json:"error,omitempty"`
Result string `json:"result,omitempty"`
Var string `json:"var,omitempty"`
Tags []string `json:"tags,omitempty"`
}
func NewTaskSummary ¶ added in v0.1.62
func NewTaskSummary(t *Task) *TaskSummary
type User ¶ added in v0.1.75
type UsernameKey ¶ added in v0.1.75
type UsernameKey string
Directories
¶
| Path | Synopsis |
|---|---|
|
db
|
|
|
internal
|
|
|
reexec
Package reexec facilitates the busybox style reexec of the docker binary that we require because of the forking limitations of using Go.
|
Package reexec facilitates the busybox style reexec of the docker binary that we require because of the forking limitations of using Go. |
|
middleware
|
|
Click to show internal directories.
Click to hide internal directories.
