providers

package
v0.0.0-...-71b633e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRemoteConfig

func GetRemoteConfig(baseConfig types.AppConfig, tailscale *network.Tailscale) (*types.AppConfig, error)

func MachineId

func MachineId() string

Types

type EC2Provider

type EC2Provider struct {
	*ExternalProvider
	// contains filtered or unexported fields
}

func NewEC2Provider

func NewEC2Provider(ctx context.Context, appConfig types.AppConfig, providerRepo repository.ProviderRepository, workerRepo repository.WorkerRepository, tailscale *network.Tailscale) (*EC2Provider, error)

func (*EC2Provider) ProvisionMachine

func (p *EC2Provider) ProvisionMachine(ctx context.Context, poolName, token string, compute types.ProviderComputeRequest) (string, error)

func (*EC2Provider) TerminateMachine

func (p *EC2Provider) TerminateMachine(ctx context.Context, poolName, instanceId, machineId string) error

type ExternalProvider

type ExternalProvider struct {
	Ctx                  context.Context
	Name                 string
	ClusterName          string
	AppConfig            types.AppConfig
	ProviderRepo         repository.ProviderRepository
	Tailscale            *network.Tailscale
	WorkerRepo           repository.WorkerRepository
	ListMachinesFunc     func(ctx context.Context, poolName string) (map[string]string, error)
	TerminateMachineFunc func(ctx context.Context, poolName, instanceId, machineId string) error
}

func NewExternalProvider

func NewExternalProvider(ctx context.Context, cfg *ExternalProviderConfig) *ExternalProvider

func (*ExternalProvider) GetName

func (p *ExternalProvider) GetName() string

func (*ExternalProvider) Reconcile

func (p *ExternalProvider) Reconcile(ctx context.Context, poolName string)

type ExternalProviderConfig

type ExternalProviderConfig struct {
	Name                 string
	ClusterName          string
	AppConfig            types.AppConfig
	TailScale            *network.Tailscale
	ProviderRepo         repository.ProviderRepository
	WorkerRepo           repository.WorkerRepository
	ListMachinesFunc     func(ctx context.Context, poolName string) (map[string]string, error)
	TerminateMachineFunc func(ctx context.Context, poolName, instanceId, machineId string) error
}

type Instance

type Instance struct {
	Type string
	Spec InstanceSpec
}

type InstanceSpec

type InstanceSpec struct {
	Cpu      int64
	Memory   int64
	Gpu      string
	GpuCount uint32
}

type LambdaLabsProvider

type LambdaLabsProvider struct {
	*ExternalProvider
}

func NewLambdaLabsProvider

func NewLambdaLabsProvider(ctx context.Context, appConfig types.AppConfig, providerRepo repository.ProviderRepository, workerRepo repository.WorkerRepository, tailscale *network.Tailscale) (*LambdaLabsProvider, error)

func (*LambdaLabsProvider) ProvisionMachine

func (p *LambdaLabsProvider) ProvisionMachine(ctx context.Context, poolName, token string, compute types.ProviderComputeRequest) (string, error)

func (*LambdaLabsProvider) TerminateMachine

func (p *LambdaLabsProvider) TerminateMachine(ctx context.Context, poolName, instanceId, machineId string) error

type OCIProvider

type OCIProvider struct {
	*ExternalProvider
	// contains filtered or unexported fields
}

func NewOCIProvider

func NewOCIProvider(ctx context.Context, appConfig types.AppConfig, providerRepo repository.ProviderRepository, workerRepo repository.WorkerRepository, tailscale *network.Tailscale) (*OCIProvider, error)

func (*OCIProvider) ProvisionMachine

func (p *OCIProvider) ProvisionMachine(ctx context.Context, poolName, token string, compute types.ProviderComputeRequest) (string, error)

func (*OCIProvider) TerminateMachine

func (p *OCIProvider) TerminateMachine(ctx context.Context, poolName, instanceId, machineId string) error

type Provider

type Provider interface {
	ProvisionMachine(ctx context.Context, poolName, token string, compute types.ProviderComputeRequest) (string, error)
	TerminateMachine(ctx context.Context, poolName, instanceId, machineId string) error
	Reconcile(ctx context.Context, poolName string)
	GetName() string
}

Jump to

Keyboard shortcuts

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