provisionerd

package
v2.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectResponse added in v2.2.0

type ConnectResponse struct {
	Job    *proto.AcquiredJob
	Client sdkproto.DRPCProvisionerClient
	Error  error
}

ConnectResponse is the response returned asynchronously from Connector.Connect containing either the Provisioner Client or an Error. The Job is also returned unaltered to disambiguate responses if the respCh is shared among multiple jobs

type Connector added in v2.2.0

type Connector interface {
	// Connect to the correct provisioner for the given job. The response is
	// delivered asynchronously over the respCh.  If the provided context expires,
	// the Connector may stop waiting for the provisioner and return an error
	// response.
	Connect(ctx context.Context, job *proto.AcquiredJob, respCh chan<- ConnectResponse)
}

Connector allows the provisioner daemon to Connect to a provisioner for the given job.

type Dialer

Dialer represents the function to create a daemon client connection.

type LocalProvisioners added in v2.2.0

type LocalProvisioners map[string]sdkproto.DRPCProvisionerClient

LocalProvisioners is a Connector that stores a static set of in-process provisioners.

func (LocalProvisioners) Connect added in v2.2.0

func (l LocalProvisioners) Connect(_ context.Context, job *proto.AcquiredJob, respCh chan<- ConnectResponse)

type Metrics

type Metrics struct {
	Runner runner.Metrics
}

func NewMetrics

func NewMetrics(reg prometheus.Registerer) Metrics

type Options

type Options struct {
	Logger         slog.Logger
	TracerProvider trace.TracerProvider
	Metrics        *Metrics

	ForceCancelInterval time.Duration
	UpdateInterval      time.Duration
	LogBufferInterval   time.Duration
	Connector           Connector
}

Options provides customizations to the behavior of a provisioner daemon.

type Server

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

func New

func New(clientDialer Dialer, opts *Options) *Server

New creates and starts a provisioner daemon.

func (*Server) Close

func (p *Server) Close() error

Close ends the provisioner. It will mark any running jobs as failed.

func (*Server) CommitQuota

func (*Server) CompleteJob

func (p *Server) CompleteJob(ctx context.Context, in *proto.CompletedJob) error

func (*Server) FailJob

func (p *Server) FailJob(ctx context.Context, in *proto.FailedJob) error

func (*Server) Shutdown

func (p *Server) Shutdown(ctx context.Context, cancelActiveJob bool) error

Shutdown gracefully exists with the option to cancel the active job. If false, it will wait for the job to complete.

func (*Server) UpdateJob

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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