Documentation ¶
Index ¶
- Constants
- Variables
- type AutoDelete
- type EachTask
- type Job
- type JobContext
- type JobDefaults
- type JobMetrics
- type JobState
- type JobSummary
- type Metrics
- type Mount
- type Node
- type NodeMetrics
- type NodeStatus
- type ParallelTask
- type Permission
- type Port
- type Registry
- type Role
- 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.96"
)
Variables ¶
View Source
var (
GitCommit string = "develop"
)
View Source
var HEARTBEAT_RATE = time.Second * 30
View Source
var LAST_HEARTBEAT_TIMEOUT = time.Minute * 5
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"` }
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 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"` }
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 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 Port ¶ added in v0.1.93
func ClonePorts ¶ added in v0.1.93
type Registry ¶ added in v0.1.11
type Role ¶ added in v0.1.80
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"` 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"` Error string `json:"error,omitempty"` Pre []*Task `json:"pre,omitempty"` Post []*Task `json:"post,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"` Ports []*Port `json:"ports,omitempty"` Internal bool `json:"-"` }
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 ( 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
Source Files ¶
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.