Documentation
¶
Index ¶
- func ExtractPoolNameFromVMID(vmid string) (string, error)
- type Config
- type FirecrackerConfig
- type FirecrackerMachineConfig
- type GitHubConfig
- type MetricsConfig
- type MicroVM
- type MicroVMManager
- type Opt
- type Pool
- func (p *Pool) GetCurrentSize() int
- func (p *Pool) GetDir() string
- func (p *Pool) ListMicroVMs(ctx context.Context, pool string) ([]*MicroVM, error)
- func (p *Pool) Pause()
- func (p *Pool) Resume()
- func (p *Pool) Scale(ctx context.Context, replicas int) error
- func (p *Pool) Start()
- func (p *Pool) Stop()
- type PoolConfig
- type PoolManager
- type RunnerConfig
- type Server
- func (s *Server) GetMicroVM(ctx context.Context, vmid string) (*MicroVM, error)
- func (s *Server) GetPool(ctx context.Context, id string) (*Pool, error)
- func (s *Server) ListMicroVMs(ctx context.Context, poolName string) ([]*MicroVM, error)
- func (s *Server) ListPools(ctx context.Context) ([]*Pool, error)
- func (s *Server) PausePool(ctx context.Context, id string) error
- func (s *Server) Reload(ctx context.Context) error
- func (s *Server) ResumePool(ctx context.Context, id string) error
- func (s *Server) Run(ctx context.Context) error
- func (s *Server) ScalePool(ctx context.Context, id string, replicas int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractPoolNameFromVMID ¶ added in v0.4.0
ExtractPoolNameFromVMID parses a VMID to get the associated Pool name. VMIDs (runnerName) are formatted as "pool-suffix", so this avoids scanning all Pools.
Types ¶
type Config ¶
type Config struct {
BindAddress string `yaml:"bind_address" validate:"required,hostname_port"`
Metrics *MetricsConfig `yaml:"metrics"`
BasicAuthEnabled bool `yaml:"basic_auth_enabled" validate:""`
BasicAuthUsers map[string]string `yaml:"basic_auth_users" validate:"required_if=basic_auth_enabled true"`
GitHub *GitHubConfig `yaml:"github" validate:"required"`
Pools []*PoolConfig `yaml:"pools" validate:"required,min=1"`
LogLevel string `yaml:"log_level" validate:"required,oneof=debug info warn error fatal panic trace"`
Debug bool `yaml:"debug" validate:""`
// contains filtered or unexported fields
}
Config is the configuration for the Client.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig creates a new Config with default values.
type FirecrackerConfig ¶
type FirecrackerConfig struct {
BinaryPath string `yaml:"binary_path" `
KernelImagePath string `yaml:"kernel_image_path"`
KernelArgs string `yaml:"kernel_args"`
MachineConfig FirecrackerMachineConfig `yaml:"machine_config"`
Metadata map[string]interface{} `yaml:"metadata"`
}
type GitHubConfig ¶
type MetricsConfig ¶
type MicroVMManager ¶ added in v0.3.0
type MicroVMManager interface {
ListMicroVMs(ctx context.Context, pool string) ([]*MicroVM, error)
GetMicroVM(ctx context.Context, vmid string) (*MicroVM, error)
}
MicroVMManager is an interface for managing MicroVMs.
type Opt ¶
type Opt func(s *Server)
Opt is a functional option for Server.
func WithLogger ¶
WithLogger sets the logger for the Server.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a pool of Firecracker VMs that are used to run GitHub Actions jobs.
func (*Pool) GetCurrentSize ¶
GetCurrentSize returns the current size of the pool.
func (*Pool) ListMicroVMs ¶ added in v0.3.0
ListMicroVMs retrieves the names and IP addresses of all running Firecracker VMs inside the pool.
func (*Pool) Pause ¶
func (p *Pool) Pause()
Pause pauses the pool. Pausing the pool will prevent the pool from scaling.
func (*Pool) Resume ¶
func (p *Pool) Resume()
Resume resumes the pool. Resuming the pool will allow the pool to scale.
type PoolConfig ¶
type PoolConfig struct {
Name string `yaml:"name" validate:"required"`
MaxRunners int `yaml:"max_runners" validate:"min=1"`
MinRunners int `yaml:"min_runners" validate:"min=1"`
Runner *RunnerConfig `yaml:"runner" validate:"required"`
Firecracker *FirecrackerConfig `yaml:"firecracker" validate:"required"`
}
PoolConfig represents the configuration of a Pool.
type PoolManager ¶
type PoolManager interface {
ListPools(ctx context.Context) ([]*Pool, error)
GetPool(ctx context.Context, id string) (*Pool, error)
ScalePool(ctx context.Context, id string, delta int) error
PausePool(ctx context.Context, id string) error
ResumePool(ctx context.Context, id string) error
Reload(ctx context.Context) error
}
PoolManager is an interface for managing pools.
type RunnerConfig ¶
type RunnerConfig struct {
Name string `yaml:"name" validate:"required"`
ImagePullPolicy string `yaml:"image_pull_policy" validate:"required,oneof=always never ifnotpresent"`
Image string `yaml:"image" validate:"required"`
Organization string `yaml:"organization" validate:"required"`
GroupID int64 `yaml:"group_id" validate:"required"`
Labels []string `yaml:"labels" validate:"required"`
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the Fireactions server.
func (*Server) GetMicroVM ¶ added in v0.4.0
GetMicroVM returns a MicroVM object by the given VM ID.
func (*Server) ListMicroVMs ¶ added in v0.3.0
ListMicroVMs returns a list of MicroVMs for the given poolName.
func (*Server) ResumePool ¶
ResumePool resumes the pool with the given ID.