controller

package
v0.412.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(
	ctx context.Context,
	config Config,
	storage *artefacts.OCIArtefactService,
	adminClient ftlv1connect.AdminServiceClient,
	timelineClient *timeline.Client,
	conn *sql.DB,
	devel bool,
) error

Start the Controller. Blocks until the context is cancelled.

Types

type CommonConfig

type CommonConfig struct {
	IdleRunners    int           `help:"Number of idle runners to keep around (not supported in production)." default:"3"`
	WaitFor        []string      `help:"Wait for these modules to be deployed before becoming ready." placeholder:"MODULE"`
	CronJobTimeout time.Duration `help:"Timeout for cron jobs." default:"5m"`
}

CommonConfig between the production controller and development server.

type Config

type Config struct {
	Bind                         *url.URL            `help:"Socket to bind to." default:"http://127.0.0.1:8892" env:"FTL_BIND"`
	Key                          model.ControllerKey `help:"Controller key (auto)." placeholder:"KEY"`
	DSN                          string              `help:"DAL DSN." default:"${dsn}" env:"FTL_DSN"`
	Advertise                    *url.URL            `` /* 135-byte string literal not displayed */
	RunnerTimeout                time.Duration       `help:"Runner heartbeat timeout." default:"10s"`
	ControllerTimeout            time.Duration       `help:"Controller heartbeat timeout." default:"10s"`
	DeploymentReservationTimeout time.Duration       `help:"Deployment reservation timeout." default:"120s"`
	ModuleUpdateFrequency        time.Duration       `help:"Frequency to send module updates." default:"30s"`
	ArtefactChunkSize            int                 `help:"Size of each chunk streamed to the client." default:"1048576"`
	MaxOpenDBConnections         int                 `help:"Maximum number of database connections." default:"20" env:"FTL_MAX_OPEN_DB_CONNECTIONS"`
	MaxIdleDBConnections         int                 `help:"Maximum number of idle database connections." default:"20" env:"FTL_MAX_IDLE_DB_CONNECTIONS"`
	CommonConfig
}

func (*Config) OpenDBAndInstrument

func (c *Config) OpenDBAndInstrument() (*sql.DB, error)

func (*Config) SetDefaults

func (c *Config) SetDefaults()

type Service

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

func New

func New(
	ctx context.Context,
	conn *sql.DB,
	adminClient ftlv1connect.AdminServiceClient,
	timelineClient *timeline.Client,
	storage *artefacts.OCIArtefactService,
	config Config,
	devel bool,
) (*Service, error)

func (*Service) Call

func (*Service) GetDeploymentContext

GetDeploymentContext retrieves config, secrets and DSNs for a module.

func (*Service) Ping

func (*Service) UpdateDeploy

Directories

Path Synopsis
Package scheduledtask implements a task scheduler.
Package scheduledtask implements a task scheduler.

Jump to

Keyboard shortcuts

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