agent

package
v1.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

Agent is responsible for running the DAG and handling communication via the unix socket. The agent performs the following tasks: 1. Start the DAG execution. 2. Propagate a signal to the running processes. 3. Handle the HTTP request via the unix socket. 4. Write the log and status to the data store.

func New

func New(
	requestID string,
	workflow *dag.DAG,
	lg logger.Logger,
	logDir, logFile string,
	cli client.Client,
	dataStore persistence.DataStores,
	opts *Options,
) *Agent

New creates a new Agent.

func (*Agent) HandleHTTP

func (a *Agent) HandleHTTP(w http.ResponseWriter, r *http.Request)

HandleHTTP handles HTTP requests via unix socket.

func (*Agent) Run

func (a *Agent) Run(ctx context.Context) error

Run setups the scheduler and runs the DAG.

func (*Agent) Signal

func (a *Agent) Signal(sig os.Signal)

Signal sends the signal to the processes running

func (*Agent) Status

func (a *Agent) Status() *model.Status

Status collects the current running status of the DAG and returns it.

type Options

type Options struct {
	// Dry is a dry-run mode. It does not execute the actual command.
	// Dry run does not create history data.
	Dry bool
	// RetryTarget is the target status (history of execution) to retry.
	// If it's specified the agent will execute the DAG with the same
	// configuration as the specified history.
	RetryTarget *model.Status
}

Options is the configuration for the Agent.

type Sender

type Sender interface {
	Send(
		from string, to []string, subject, body string, attachments []string,
	) error
}

Sender is a mailer interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL