Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentdExecutor ¶
type AgentdExecutor interface {
Execute(ctx context.Context, podIP string, req *NodeExecRequest) (*NodeExecResponse, error)
}
type HTTPAgentdExecutor ¶
HTTPAgentdExecutor calls agentd via HTTP.
func (*HTTPAgentdExecutor) Execute ¶
func (e *HTTPAgentdExecutor) Execute(ctx context.Context, podIP string, req *NodeExecRequest) (*NodeExecResponse, error)
type NodeExecRequest ¶
type NodeExecRequest struct {
NodeID string `json:"nodeId"`
NodeType string `json:"nodeType"`
Spec json.RawMessage `json:"spec"`
Input json.RawMessage `json:"input"`
Timeout string `json:"timeout,omitempty"`
}
type NodeExecResponse ¶
type NodeExecResponse struct {
Output json.RawMessage `json:"output,omitempty"`
Branch string `json:"branch,omitempty"`
ErrorCode string `json:"errorCode,omitempty"`
Detail string `json:"detail,omitempty"`
}
type ReconcilerLogger ¶
type ReconcilerStore ¶
type ReconcilerStore interface {
ClaimQueuedRuns(ctx context.Context, limit int) ([]*wf.WorkflowRunRow, error)
UpdateWorkflowRunStatus(ctx context.Context, runID, status string, errorCode *string, errMsg json.RawMessage, output json.RawMessage) error
CreateNodeRun(ctx context.Context, row *wf.WorkflowNodeRunRow) error
UpdateNodeRunStatus(ctx context.Context, nodeRunID, status string, output json.RawMessage, branch *string, errorCode *string, errMsg json.RawMessage) error
IncrementTriggerFailures(ctx context.Context, triggerID string) (int, error)
ResetTriggerFailures(ctx context.Context, triggerID string) error
}
type Scheduler ¶
type Scheduler struct {
Store SchedulerStore
Logger ReconcilerLogger
TickInterval time.Duration
BatchLimit int
}
Scheduler polls due cron triggers and fires them.
func (*Scheduler) NeedLeaderElection ¶
type SchedulerStore ¶
type SchedulerStore interface {
ListDueCronTriggers(ctx context.Context, now time.Time, limit int) ([]*wf.TriggerRow, error)
GetWorkflow(ctx context.Context, ownerType, ownerID, workflowID string) (*wf.WorkflowRow, error)
CreateWorkflowRunWithFire(ctx context.Context, fire *wf.TriggerFireRow, run *wf.WorkflowRunRow) error
CreateTriggerFire(ctx context.Context, row *wf.TriggerFireRow) error
UpdateTriggerFireTimestamps(ctx context.Context, triggerID string, lastFiredAt time.Time, nextFireAt *time.Time) error
IncrementTriggerFailures(ctx context.Context, triggerID string) (int, error)
DisableTrigger(ctx context.Context, triggerID string) error
}
SchedulerStore is the narrow store interface for the scheduler.
type WorkflowReconciler ¶
type WorkflowReconciler struct {
Store ReconcilerStore
AgentdClient AgentdExecutor
K8sClient WorkspaceActivator
Logger ReconcilerLogger
MaxConcurrent int
TickInterval time.Duration
// contains filtered or unexported fields
}
WorkflowReconciler drives workflow runs from queued to terminal.
func (*WorkflowReconciler) Cancel ¶
func (r *WorkflowReconciler) Cancel(runID string)
func (*WorkflowReconciler) NeedLeaderElection ¶
func (r *WorkflowReconciler) NeedLeaderElection() bool
Click to show internal directories.
Click to hide internal directories.