provisioner

package
v0.750.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provisioner

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

Provisioner provisions and terminates agent instances. It is composed of four parts: a provisioner, a scaling decision maker, a provider, and a rate limiter.

  1. The provisioner is capable of reporting provider information and updating scaling info. 1.1. `Scheduler` pushes an immutable view of agents and tasks to `Provisioner`. `Provisioner` pulls instance data from instance providers.
  2. Based on the pending tasks, the scaleDecider chooses how many new instances to launch and which instances to terminate. 2.1 It terminates instances if they stay idle for more than `maxIdleAgentPeriod` time. 2.2 It checks recently launched instances and avoids provisioning more than needed.
  3. The instance providers take actions to launch/terminate instances.
  4. The rate limiter ensures telemetry does not get sent more frequently than every 90sec.

func New

func New(
	resourcePool string, config *provconfig.Config, cert *tls.Certificate, db db.DB,
) (*Provisioner, error)

New creates a new Provisioner.

func Setup

func Setup(
	config *provconfig.Config,
	resourcePool string,
	cert *tls.Certificate,
	db db.DB,
) (*Provisioner, error)

Setup initializes the provisioner.

func (*Provisioner) CurrentSlotCount

func (p *Provisioner) CurrentSlotCount() (int, error)

CurrentSlotCount returns the number of Slots available in the cluster.

func (*Provisioner) InstanceType

func (p *Provisioner) InstanceType() string

InstanceType returns the instance type of the provider for the provisioner.

func (*Provisioner) LaunchError

func (p *Provisioner) LaunchError() error

LaunchError returns the current launch error sent from the provider.

func (*Provisioner) Provision

func (p *Provisioner) Provision()

Provision runs a single provisioning iteration.

func (*Provisioner) Run

func (p *Provisioner) Run()

Run starts the provisioner loop.

func (*Provisioner) SlotsPerInstance

func (p *Provisioner) SlotsPerInstance() int

SlotsPerInstance returns the number of Slots per instance the provisioner launches.

func (*Provisioner) UpdateScalingInfo

func (p *Provisioner) UpdateScalingInfo(info *sproto.ScalingInfo)

UpdateScalingInfo updates the scaling info for the provisioner.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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