runner

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const RUNNER_METADATA_UPDATE_INTERVAL = 2 * time.Second

Variables

View Source
var ErrConfigNotFound = errors.New("run 'daytona runner configure' to configure the runner")

Functions

func DeleteConfigDir

func DeleteConfigDir() error

func DisableTelemetry

func DisableTelemetry(c Config) error

func EnableTelemetry

func EnableTelemetry(c Config) error

func GetConfigDir

func GetConfigDir() (string, error)

func GetLogsDir

func GetLogsDir(configDir string) string

func GetProviderDownloadUrls

func GetProviderDownloadUrls(name, version, registryUrl string) (map[os.OperatingSystem]string, error)

func Save

func Save(c Config) error

Types

type Config

type Config struct {
	Id               string              `json:"id"`
	Name             string              `json:"name"`
	ApiPort          int32               `json:"apiPort"`
	ServerApiKey     string              `json:"serverApiKey"`
	ServerApiUrl     string              `json:"serverApiUrl"`
	ProvidersDir     string              `json:"providersDir"`
	LogFile          *logs.LogFileConfig `json:"logFile"`
	ClientId         string              `envconfig:"DAYTONA_CLIENT_ID"`
	TelemetryEnabled bool                `json:"telemetryEnabled"`

} // @name RunnerConfig

func GetConfig

func GetConfig() (*Config, error)

func GetDefaultConfig

func GetDefaultConfig() (*Config, error)

type IRunner

type IRunner interface {
	Start(ctx context.Context) error
	CheckAndRunJobs(ctx context.Context) error
	Purge(ctx context.Context) error
}

func NewRunner

func NewRunner(config RunnerConfig) IRunner

type ProviderManifest

type ProviderManifest struct {
	Default  bool               `json:"default"`
	Label    *string            `json:"label"`
	Versions map[string]Version `json:"versions"`
}

func (*ProviderManifest) FindLatestVersion

func (p *ProviderManifest) FindLatestVersion() (string, *Version)

type ProvidersManifest

type ProvidersManifest map[string]ProviderManifest

func GetProvidersManifest

func GetProvidersManifest(registryUrl string) (*ProvidersManifest, error)

func (*ProvidersManifest) GetDefaultProviders

func (p *ProvidersManifest) GetDefaultProviders() map[string]*Version

func (*ProvidersManifest) GetLatestVersions

func (m *ProvidersManifest) GetLatestVersions() *ProvidersManifest

func (*ProvidersManifest) GetProviderListFromManifest

func (m *ProvidersManifest) GetProviderListFromManifest() []services.ProviderDTO

func (*ProvidersManifest) HasUpdateAvailable

func (p *ProvidersManifest) HasUpdateAvailable(providerName string, currentVersion string) bool

type Runner

type Runner struct {
	models.Runner
	Config *Config
	// contains filtered or unexported fields
}

func (*Runner) CheckAndRunJobs

func (r *Runner) CheckAndRunJobs(ctx context.Context) error

func (*Runner) Purge

func (r *Runner) Purge(ctx context.Context) error

func (*Runner) Start

func (r *Runner) Start(ctx context.Context) error

func (*Runner) UpdateRunnerMetadata

func (r *Runner) UpdateRunnerMetadata(config *Config) error

type RunnerConfig

type RunnerConfig struct {
	models.Runner
	Config *Config
	Logger *log.Logger

	ProviderManager providermanager.IProviderManager
	RegistryUrl     string

	ListPendingJobs     func(ctx context.Context) ([]*models.Job, int, error)
	UpdateJobState      func(ctx context.Context, jobId string, state models.JobState, err error) error
	SetRunnerMetadata   func(ctx context.Context, runnerId string, metadata models.RunnerMetadata) error
	TrackTelemetryEvent func(event telemetry.Event, clientId string) error

	WorkspaceJobFactory workspace.IWorkspaceJobFactory
	TargetJobFactory    target.ITargetJobFactory
	BuildJobFactory     build.IBuildJobFactory
	RunnerJobFactory    runner.IRunnerJobFactory
}

type Version

type Version struct {
	DownloadUrls map[os.OperatingSystem]string `json:"downloadUrls"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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