distro

package
v0.0.0-...-f52f6c5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 23 Imported by: 123

Documentation

Overview

Package distro models an environment configuration for a host. Distros can be used for hosts with different purposes, such as running tasks and virtual workstations.

Index

Constants

View Source
const (
	DockerImageBuildTypeImport = "import"
	DockerImageBuildTypePull   = "pull"

	// Bootstrapping mechanisms
	// BootstrapMethodNone is for internal use only.
	BootstrapMethodNone      = "none"
	BootstrapMethodLegacySSH = "legacy-ssh"
	BootstrapMethodSSH       = "ssh"
	BootstrapMethodUserData  = "user-data"

	// Means of communicating with hosts
	CommunicationMethodLegacySSH = "legacy-ssh"
	CommunicationMethodSSH       = "ssh"
	CommunicationMethodRPC       = "rpc"
)
View Source
const Collection = "distro"

Variables

View Source
var (
	// bson fields for the Distro struct
	IdKey                    = bsonutil.MustHaveTag(Distro{}, "Id")
	AliasesKey               = bsonutil.MustHaveTag(Distro{}, "Aliases")
	NoteKey                  = bsonutil.MustHaveTag(Distro{}, "Note")
	ArchKey                  = bsonutil.MustHaveTag(Distro{}, "Arch")
	ProviderKey              = bsonutil.MustHaveTag(Distro{}, "Provider")
	ProviderSettingsListKey  = bsonutil.MustHaveTag(Distro{}, "ProviderSettingsList")
	SetupAsSudoKey           = bsonutil.MustHaveTag(Distro{}, "SetupAsSudo")
	SetupKey                 = bsonutil.MustHaveTag(Distro{}, "Setup")
	AuthorizedKeysFileKey    = bsonutil.MustHaveTag(Distro{}, "AuthorizedKeysFile")
	UserKey                  = bsonutil.MustHaveTag(Distro{}, "User")
	SSHOptionsKey            = bsonutil.MustHaveTag(Distro{}, "SSHOptions")
	BootstrapSettingsKey     = bsonutil.MustHaveTag(Distro{}, "BootstrapSettings")
	DispatcherSettingsKey    = bsonutil.MustHaveTag(Distro{}, "DispatcherSettings")
	WorkDirKey               = bsonutil.MustHaveTag(Distro{}, "WorkDir")
	SpawnAllowedKey          = bsonutil.MustHaveTag(Distro{}, "SpawnAllowed")
	ExpansionsKey            = bsonutil.MustHaveTag(Distro{}, "Expansions")
	DisabledKey              = bsonutil.MustHaveTag(Distro{}, "Disabled")
	ContainerPoolKey         = bsonutil.MustHaveTag(Distro{}, "ContainerPool")
	PlannerSettingsKey       = bsonutil.MustHaveTag(Distro{}, "PlannerSettings")
	FinderSettingsKey        = bsonutil.MustHaveTag(Distro{}, "FinderSettings")
	HomeVolumeSettingsKey    = bsonutil.MustHaveTag(Distro{}, "HomeVolumeSettings")
	HostAllocatorSettingsKey = bsonutil.MustHaveTag(Distro{}, "HostAllocatorSettings")
	DisableShallowCloneKey   = bsonutil.MustHaveTag(Distro{}, "DisableShallowClone")
	ValidProjectsKey         = bsonutil.MustHaveTag(Distro{}, "ValidProjects")
	IsVirtualWorkstationKey  = bsonutil.MustHaveTag(Distro{}, "IsVirtualWorkstation")
	IsClusterKey             = bsonutil.MustHaveTag(Distro{}, "IsCluster")
	IceCreamSettingsKey      = bsonutil.MustHaveTag(Distro{}, "IceCreamSettings")
)
View Source
var (
	// bson fields for the BootstrapSettings struct
	BootstrapSettingsMethodKey                = bsonutil.MustHaveTag(BootstrapSettings{}, "Method")
	BootstrapSettingsCommunicationKey         = bsonutil.MustHaveTag(BootstrapSettings{}, "Communication")
	BootstrapSettingsClientDirKey             = bsonutil.MustHaveTag(BootstrapSettings{}, "ClientDir")
	BootstrapSettingsJasperBinaryDirKey       = bsonutil.MustHaveTag(BootstrapSettings{}, "JasperBinaryDir")
	BootstrapSettingsJasperCredentialsPathKey = bsonutil.MustHaveTag(BootstrapSettings{}, "JasperCredentialsPath")
	BootstrapSettingsServiceUserKey           = bsonutil.MustHaveTag(BootstrapSettings{}, "ServiceUser")
	BootstrapSettingsShellPathKey             = bsonutil.MustHaveTag(BootstrapSettings{}, "ShellPath")
	BootstrapSettingsRootDirKey               = bsonutil.MustHaveTag(BootstrapSettings{}, "RootDir")
	BootstrapSettingsEnvKey                   = bsonutil.MustHaveTag(BootstrapSettings{}, "Env")
	BootstrapSettingsResourceLimitsKey        = bsonutil.MustHaveTag(BootstrapSettings{}, "ResourceLimits")

	ResourceLimitsNumFilesKey        = bsonutil.MustHaveTag(ResourceLimits{}, "NumFiles")
	ResourceLimitsNumProcessesKey    = bsonutil.MustHaveTag(ResourceLimits{}, "NumProcesses")
	ResourceLimitsNumTasksKey        = bsonutil.MustHaveTag(ResourceLimits{}, "NumTasks")
	ResourceLimitsVirtualMemoryKBKey = bsonutil.MustHaveTag(ResourceLimits{}, "VirtualMemoryKB")
	ResourceLimitsLockedMemoryKBKey  = bsonutil.MustHaveTag(ResourceLimits{}, "LockedMemoryKB")
)
View Source
var (
	IceCreamSettingsSchedulerHostKey = bsonutil.MustHaveTag(IceCreamSettings{}, "SchedulerHost")
	IceCreamSettingsConfigPathKey    = bsonutil.MustHaveTag(IceCreamSettings{}, "ConfigPath")
)
View Source
var (
	// bson fields for the HostAllocatorSettings struct
	// HostAllocatorSettingsVersionKey                = bsonutil.MustHaveTag(HostAllocatorSettings{}, "Version")
	// HostAllocatorSettingsMinimumHostsKey           = bsonutil.MustHaveTag(HostAllocatorSettings{}, "MinimumHosts")
	HostAllocatorSettingsMaximumHostsKey = bsonutil.MustHaveTag(HostAllocatorSettings{}, "MaximumHosts")
)

Functions

func ById

func ById(id string) bson.M

ById returns a query that contains an Id selector on the string, id.

func ByIds

func ByIds(ids []string) bson.M

ByIds creates a query that finds all distros for the given ids and implicitly returns them ordered by {"_id": 1}

func ByNeedsHostsPlanning

func ByNeedsHostsPlanning(containerPools []evergreen.ContainerPool) bson.M

ByNeedsHostsPlanning returns a query that selects distros that don't run containers

func ByNeedsPlanning

func ByNeedsPlanning(containerPools []evergreen.ContainerPool) bson.M

ByNeedsPlanning returns a query that selects only active or static distros that don't run containers

func ByProvider

func ByProvider(p string) bson.M

ByProvider returns a query that contains a Provider selector on the string, p.

func BySpawnAllowed

func BySpawnAllowed() bson.M

BySpawnAllowed returns a query that contains the SpawnAllowed selector.

func FindApplicableDistroIDs

func FindApplicableDistroIDs(ctx context.Context, id string) ([]string, error)

func Remove

func Remove(ctx context.Context, ID string) error

Remove removes one distro.

func ValidateArch

func ValidateArch(arch string) error

ValidateArch checks that the architecture is one of the supported architectures.

func ValidateContainerPoolDistros

func ValidateContainerPoolDistros(ctx context.Context, s *evergreen.Settings) error

ValidateContainerPoolDistros ensures that container pools have valid distros

Types

type AliasLookupTable

type AliasLookupTable map[string][]string

func NewDistroAliasesLookupTable

func NewDistroAliasesLookupTable(ctx context.Context) (AliasLookupTable, error)

func (AliasLookupTable) Expand

func (da AliasLookupTable) Expand(in []string) []string

type BootstrapSettings

type BootstrapSettings struct {
	// Required
	Method        string `bson:"method" json:"method" mapstructure:"method"`
	Communication string `bson:"communication,omitempty" json:"communication,omitempty" mapstructure:"communication,omitempty"`

	// Optional
	Env                 []EnvVar             `bson:"env,omitempty" json:"env,omitempty" mapstructure:"env,omitempty"`
	ResourceLimits      ResourceLimits       `bson:"resource_limits,omitempty" json:"resource_limits,omitempty" mapstructure:"resource_limits,omitempty"`
	PreconditionScripts []PreconditionScript `bson:"precondition_scripts,omitempty" json:"precondition_scripts,omitempty" mapstructure:"precondition_scripts,omitempty"`

	// Required for new provisioning
	ClientDir             string `bson:"client_dir,omitempty" json:"client_dir,omitempty" mapstructure:"client_dir,omitempty"`
	JasperBinaryDir       string `bson:"jasper_binary_dir,omitempty" json:"jasper_binary_dir,omitempty" mapstructure:"jasper_binary_dir,omitempty"`
	JasperCredentialsPath string `` /* 130-byte string literal not displayed */

	// Windows-specific
	ServiceUser string `bson:"service_user,omitempty" json:"service_user,omitempty" mapstructure:"service_user,omitempty"`
	ShellPath   string `bson:"shell_path,omitempty" json:"shell_path,omitempty" mapstructure:"shell_path,omitempty"`
	RootDir     string `bson:"root_dir,omitempty" json:"root_dir,omitempty" mapstructure:"root_dir,omitempty"`
}

BootstrapSettings encapsulates all settings related to bootstrapping hosts.

type DispatcherSettings

type DispatcherSettings struct {
	Version string `bson:"version" json:"version" mapstructure:"version"`
}

type Distro

type Distro struct {
	Id                    string                `bson:"_id" json:"_id,omitempty" mapstructure:"_id,omitempty"`
	AdminOnly             bool                  `bson:"admin_only,omitempty" json:"admin_only,omitempty" mapstructure:"admin_only,omitempty"`
	Aliases               []string              `bson:"aliases,omitempty" json:"aliases,omitempty" mapstructure:"aliases,omitempty"`
	Arch                  string                `bson:"arch" json:"arch,omitempty" mapstructure:"arch,omitempty"`
	WorkDir               string                `bson:"work_dir" json:"work_dir,omitempty" mapstructure:"work_dir,omitempty"`
	Provider              string                `bson:"provider" json:"provider,omitempty" mapstructure:"provider,omitempty"`
	ProviderSettingsList  []*birch.Document     `bson:"provider_settings,omitempty" json:"provider_settings,omitempty" mapstructure:"provider_settings,omitempty"`
	SetupAsSudo           bool                  `bson:"setup_as_sudo,omitempty" json:"setup_as_sudo,omitempty" mapstructure:"setup_as_sudo,omitempty"`
	Setup                 string                `bson:"setup,omitempty" json:"setup,omitempty" mapstructure:"setup,omitempty"`
	User                  string                `bson:"user,omitempty" json:"user,omitempty" mapstructure:"user,omitempty"`
	BootstrapSettings     BootstrapSettings     `bson:"bootstrap_settings" json:"bootstrap_settings" mapstructure:"bootstrap_settings"`
	SSHOptions            []string              `bson:"ssh_options,omitempty" json:"ssh_options,omitempty" mapstructure:"ssh_options,omitempty"`
	AuthorizedKeysFile    string                `bson:"authorized_keys_file,omitempty" json:"authorized_keys_file,omitempty" mapstructure:"authorized_keys_file,omitempty"`
	SpawnAllowed          bool                  `bson:"spawn_allowed" json:"spawn_allowed,omitempty" mapstructure:"spawn_allowed,omitempty"`
	Expansions            []Expansion           `bson:"expansions,omitempty" json:"expansions,omitempty" mapstructure:"expansions,omitempty"`
	Disabled              bool                  `bson:"disabled,omitempty" json:"disabled,omitempty" mapstructure:"disabled,omitempty"`
	ContainerPool         string                `bson:"container_pool,omitempty" json:"container_pool,omitempty" mapstructure:"container_pool,omitempty"`
	FinderSettings        FinderSettings        `bson:"finder_settings" json:"finder_settings" mapstructure:"finder_settings"`
	PlannerSettings       PlannerSettings       `bson:"planner_settings" json:"planner_settings" mapstructure:"planner_settings"`
	DispatcherSettings    DispatcherSettings    `bson:"dispatcher_settings" json:"dispatcher_settings" mapstructure:"dispatcher_settings"`
	HostAllocatorSettings HostAllocatorSettings `bson:"host_allocator_settings" json:"host_allocator_settings" mapstructure:"host_allocator_settings"`
	DisableShallowClone   bool                  `bson:"disable_shallow_clone" json:"disable_shallow_clone" mapstructure:"disable_shallow_clone"`
	Note                  string                `bson:"note" json:"note" mapstructure:"note"`
	WarningNote           string                `bson:"warning_note,omitempty" json:"warning_note,omitempty" mapstructure:"warning_note,omitempty"`
	ValidProjects         []string              `bson:"valid_projects,omitempty" json:"valid_projects,omitempty" mapstructure:"valid_projects,omitempty"`
	IsVirtualWorkstation  bool                  `bson:"is_virtual_workstation" json:"is_virtual_workstation" mapstructure:"is_virtual_workstation"`
	IsCluster             bool                  `bson:"is_cluster" json:"is_cluster" mapstructure:"is_cluster"`
	HomeVolumeSettings    HomeVolumeSettings    `bson:"home_volume_settings" json:"home_volume_settings" mapstructure:"home_volume_settings"`
	IceCreamSettings      IceCreamSettings      `bson:"icecream_settings,omitempty" json:"icecream_settings,omitempty" mapstructure:"icecream_settings,omitempty"`
	Mountpoints           []string              `bson:"mountpoints,omitempty" json:"mountpoints,omitempty" mapstructure:"mountpoints,omitempty"`
}

func AllDistroIDs

func AllDistroIDs(ctx context.Context) ([]Distro, error)

func AllDistros

func AllDistros(ctx context.Context) ([]Distro, error)

func Find

func Find(ctx context.Context, query bson.M, options ...*options.FindOptions) ([]Distro, error)

func FindByIdWithDefaultSettings

func FindByIdWithDefaultSettings(ctx context.Context, id string) (*Distro, error)

func FindOne

func FindOne(ctx context.Context, query bson.M, options ...*options.FindOneOptions) (*Distro, error)

func FindOneId

func FindOneId(ctx context.Context, id string) (*Distro, error)

FindOneId returns one Distro by Id.

func GetHostCreateDistro

func GetHostCreateDistro(ctx context.Context, createHost apimodels.CreateHost) (*Distro, error)

GetHostCreateDistro returns the distro based on the name and provider. If the provider is Docker, passing in the distro is required, and the distro must be a Docker distro. If the provider is EC2, the distro name is optional.

func (*Distro) AbsPathCygwinCompatible

func (d *Distro) AbsPathCygwinCompatible(path ...string) string

AbsPathCygwinCompatible creates an absolute path from the given path that is compatible with the host's provisioning settings.

For example, in the context of an SSH session with Cygwin, if you invoke the "/usr/bin/echo" binary, Cygwin uses the binary located relative to Cygwin's filesystem root directory, so it will use the binary at "$ROOT_DIR/usr/bin/echo". Similarly, Cygwin binaries like "ls" will resolve filepaths as paths relative to the Cygwin root directory, so "ls /usr/bin", will correctly list the directory contents of "$ROOT_DIR/usr/bin".

However, in almost all other cases, Windows binaries expect native Windows paths for everything. For example, if the evergreen binary accepts a filepath given in the command line flags, the Golang standard library uses native paths. Therefore, giving a path like "/home/Administrator/my_file" will fail, because the library has no awareness of the Cygwin filesystem context. The correct path would be to give an absolute native path, "$ROOT_DIR/home/Administrator/evergreen".

Documentation for Cygwin paths: https://www.cygwin.com/cygwin-ug-net/using-effectively.html

func (*Distro) AbsPathNotCygwinCompatible

func (d *Distro) AbsPathNotCygwinCompatible(path ...string) string

AbsPathNotCygwinCompatible creates a Cygwin-incompatible absolute path using RootDir to get around the fact that Cygwin binaries use POSIX paths relative to the Cygwin filesystem root directory, but most other paths require absolute filepaths using native Windows absolute paths. See (*Distro).AbsPathCygwinCompatible for more details.

func (*Distro) Add

func (d *Distro) Add(ctx context.Context, creator *user.DBUser) error

func (*Distro) AddPermissions

func (d *Distro) AddPermissions(creator *user.DBUser) error

func (*Distro) BinaryName

func (d *Distro) BinaryName() string

func (*Distro) ClientURL

func (d *Distro) ClientURL(settings *evergreen.Settings) string

ClientURL returns the URL used to get the latest Evergreen client version directly from the Evergreen server.

func (*Distro) DistroData

func (d *Distro) DistroData() DistroData

DistroData creates distro data from this distro. The provider settings are converted into maps instead of Birch BSON documents.

func (*Distro) ExecutableSubPath

func (d *Distro) ExecutableSubPath() string

ExecutableSubPath returns the directory containing the compiled agents.

func (*Distro) GenerateName

func (d *Distro) GenerateName() string

GenerateName generates a unique instance name for a host in a distro.

func (*Distro) GetAuthorizedKeysFile

func (d *Distro) GetAuthorizedKeysFile() string

GetAuthorizedKeysFile returns the path to the SSH authorized keys file for the distro. If not explicitly set for the distro, it returns the default location of the SSH authorized keys file in the home directory.

func (*Distro) GetDefaultAMI

func (d *Distro) GetDefaultAMI() string

func (*Distro) GetImageID

func (d *Distro) GetImageID() (string, error)

GetImageID returns the distro provider's image.

func (*Distro) GetPoolSize

func (d *Distro) GetPoolSize() int

func (*Distro) GetProviderSettingByRegion

func (d *Distro) GetProviderSettingByRegion(region string) (*birch.Document, error)

func (*Distro) GetRegionsList

func (d *Distro) GetRegionsList(allowedRegions []string) []string

func (*Distro) GetResolvedHostAllocatorSettings

func (d *Distro) GetResolvedHostAllocatorSettings(s *evergreen.Settings) (HostAllocatorSettings, error)

GetResolvedHostAllocatorSettings combines the distro's HostAllocatorSettings fields with the SchedulerConfig defaults to resolve and validate a canonical set of HostAllocatorSettings' field values.

func (*Distro) GetResolvedPlannerSettings

func (d *Distro) GetResolvedPlannerSettings(s *evergreen.Settings) (PlannerSettings, error)

GetResolvedPlannerSettings combines the distro's PlannerSettings fields with the SchedulerConfig defaults to resolve and validate a canonical set of PlannerSettings' field values.

func (*Distro) GetTargetTime

func (d *Distro) GetTargetTime() time.Duration

func (*Distro) HomeDir

func (d *Distro) HomeDir() string

HomeDir gets the absolute path to the home directory for this distro's user. This is compatible with Cygwin (see (*Distro).AbsPathCygwinCompatible for details).

func (*Distro) Insert

func (d *Distro) Insert(ctx context.Context) error

Insert writes the distro to the database.

func (*Distro) IsEphemeral

func (d *Distro) IsEphemeral() bool

func (*Distro) IsLinux

func (d *Distro) IsLinux() bool

func (*Distro) IsParent

func (d *Distro) IsParent(s *evergreen.Settings) bool

IsParent returns whether the distro is the parent distro for any container pool

func (*Distro) IsPowerShellSetup

func (d *Distro) IsPowerShellSetup() bool

IsPowerShellSetup returns whether or not the setup script is a powershell script based on the header shebang line.

func (*Distro) IsWindows

func (d *Distro) IsWindows() bool

func (*Distro) JasperCommunication

func (d *Distro) JasperCommunication() bool

JasperCommunication returns whether or not the app server is communicating with hosts of this distro's Jasper service.

func (*Distro) LegacyBootstrap

func (d *Distro) LegacyBootstrap() bool

LegacyBootstrap returns whether hosts of this distro are bootstrapped using the legacy method.

func (*Distro) LegacyCommunication

func (d *Distro) LegacyCommunication() bool

LegacyCommunication returns whether the app server is communicating with hosts of this distro using the legacy method.

func (*Distro) MaxDurationPerHost

func (d *Distro) MaxDurationPerHost() time.Duration

func (*Distro) Platform

func (d *Distro) Platform() (string, string)

func (*Distro) ReplaceOne

func (d *Distro) ReplaceOne(ctx context.Context) error

ReplaceOne replaces one distro.

func (*Distro) S3ClientURL

func (d *Distro) S3ClientURL(env evergreen.Environment) string

S3ClientURL returns the URL in S3 where the Evergreen client version can be retrieved for this server's particular Evergreen build version.

func (*Distro) SetBSON

func (d *Distro) SetBSON(raw mgobson.Raw) error

func (*Distro) SetUserdata

func (d *Distro) SetUserdata(userdata, region string) error

func (*Distro) ShellBinary

func (d *Distro) ShellBinary() string

ShellPath returns the native path to the shell binary.

func (*Distro) ValidateBootstrapSettings

func (d *Distro) ValidateBootstrapSettings() error

ValidateBootstrapSettings checks if all of the bootstrap settings are valid for legacy or non-legacy bootstrapping.

type DistroData

type DistroData struct {
	Distro              Distro                   `bson:",inline"`
	ProviderSettingsMap []map[string]interface{} `bson:"provider_settings_list" json:"provider_settings_list"`
}

DistroData is the same as a distro, with the only difference being that all the provider settings are stored as maps instead of Birch BSON documents.

type DistroGroup

type DistroGroup []Distro

func (DistroGroup) GetDistroIds

func (distros DistroGroup) GetDistroIds() []string

GetDistroIds returns a slice of distro IDs for the given group of distros

type EnvVar

type EnvVar struct {
	Key   string `bson:"key" json:"key" mapstructure:"key,omitempty"`
	Value string `bson:"value" json:"value" mapstructure:"value,omitempty"`
}

type Expansion

type Expansion struct {
	Key   string `bson:"key,omitempty" json:"key,omitempty"`
	Value string `bson:"value,omitempty" json:"value,omitempty"`
}

type FinderSettings

type FinderSettings struct {
	Version string `bson:"version" json:"version" mapstructure:"version"`
}

type HomeVolumeSettings

type HomeVolumeSettings struct {
	FormatCommand string `bson:"format_command" json:"format_command" mapstructure:"format_command"`
}

type HostAllocatorSettings

type HostAllocatorSettings struct {
	Version                string `bson:"version" json:"version" mapstructure:"version"`
	MinimumHosts           int    `bson:"minimum_hosts" json:"minimum_hosts" mapstructure:"minimum_hosts"`
	MaximumHosts           int    `bson:"maximum_hosts" json:"maximum_hosts" mapstructure:"maximum_hosts"`
	RoundingRule           string `bson:"rounding_rule" json:"rounding_rule" mapstructure:"rounding_rule"`
	FeedbackRule           string `bson:"feedback_rule" json:"feedback_rule" mapstructure:"feedback_rule"`
	HostsOverallocatedRule string `bson:"hosts_overallocated_rule" json:"hosts_overallocated_rule" mapstructure:"hosts_overallocated_rule"`
	// AcceptableHostIdleTime is the amount of time we wait for an idle host to be marked as idle.
	AcceptableHostIdleTime time.Duration `bson:"acceptable_host_idle_time" json:"acceptable_host_idle_time" mapstructure:"acceptable_host_idle_time"`
	FutureHostFraction     float64       `bson:"future_host_fraction" json:"future_host_fraction" mapstructure:"future_host_fraction"`
}

type IceCreamSettings

type IceCreamSettings struct {
	SchedulerHost string `bson:"scheduler_host,omitempty" json:"scheduler_host,omitempty" mapstructure:"scheduler_host,omitempty"`
	ConfigPath    string `bson:"config_path,omitempty" json:"config_path,omitempty" mapstructure:"config_path,omitempty"`
}

func (IceCreamSettings) GetUpdateConfigScript

func (s IceCreamSettings) GetUpdateConfigScript() string

WriteConfigScript returns the shell script to update the icecream config file.

func (IceCreamSettings) Populated

func (s IceCreamSettings) Populated() bool

type PlannerSettings

type PlannerSettings struct {
	Version                   string        `bson:"version" json:"version" mapstructure:"version"`
	TargetTime                time.Duration `bson:"target_time" json:"target_time" mapstructure:"target_time,omitempty"`
	GroupVersions             *bool         `bson:"group_versions" json:"group_versions" mapstructure:"group_versions,omitempty"`
	PatchFactor               int64         `bson:"patch_zipper_factor" json:"patch_factor" mapstructure:"patch_factor"`
	PatchTimeInQueueFactor    int64         `bson:"patch_time_in_queue_factor" json:"patch_time_in_queue_factor" mapstructure:"patch_time_in_queue_factor"`
	CommitQueueFactor         int64         `bson:"commit_queue_factor" json:"commit_queue_factor" mapstructure:"commit_queue_factor"`
	MainlineTimeInQueueFactor int64         `bson:"mainline_time_in_queue_factor" json:"mainline_time_in_queue_factor" mapstructure:"mainline_time_in_queue_factor"`
	ExpectedRuntimeFactor     int64         `bson:"expected_runtime_factor" json:"expected_runtime_factor" mapstructure:"expected_runtime_factor"`
	GenerateTaskFactor        int64         `bson:"generate_task_factor" json:"generate_task_factor" mapstructure:"generate_task_factor"`
	StepbackTaskFactor        int64         `bson:"stepback_task_factor" json:"stepback_task_factor" mapstructure:"stepback_task_factor"`
	// contains filtered or unexported fields
}

func (*PlannerSettings) GetCommitQueueFactor

func (s *PlannerSettings) GetCommitQueueFactor() int64

func (*PlannerSettings) GetExpectedRuntimeFactor

func (s *PlannerSettings) GetExpectedRuntimeFactor() int64

func (*PlannerSettings) GetGenerateTaskFactor

func (s *PlannerSettings) GetGenerateTaskFactor() int64

func (*PlannerSettings) GetMainlineTimeInQueueFactor

func (s *PlannerSettings) GetMainlineTimeInQueueFactor() int64

func (*PlannerSettings) GetPatchFactor

func (s *PlannerSettings) GetPatchFactor() int64

func (*PlannerSettings) GetPatchTimeInQueueFactor

func (s *PlannerSettings) GetPatchTimeInQueueFactor() int64

func (*PlannerSettings) GetStepbackTaskFactor

func (s *PlannerSettings) GetStepbackTaskFactor() int64

func (*PlannerSettings) ShouldGroupVersions

func (s *PlannerSettings) ShouldGroupVersions() bool

type PreconditionScript

type PreconditionScript struct {
	Path   string `bson:"path,omitempty" json:"path,omitempty" mapstructure:"path,omitempty"`
	Script string `bson:"script,omitempty" json:"script,omitempty" mapstructure:"script,omitempty"`
}

PreconditionScript represents a script that must run and succeed before the Jasper service can start on a provisioning host.

type ResourceLimits

type ResourceLimits struct {
	NumFiles        int `bson:"num_files,omitempty" json:"num_files,omitempty" mapstructure:"num_files,omitempty"`
	NumProcesses    int `bson:"num_processes,omitempty" json:"num_processes,omitempty" mapstructure:"num_processes,omitempty"`
	NumTasks        int `bson:"num_tasks,omitempty" json:"num_tasks,omitempty" mapstructure:"num_tasks,omitempty"`
	LockedMemoryKB  int `bson:"locked_memory,omitempty" json:"locked_memory,omitempty" mapstructure:"locked_memory,omitempty"`
	VirtualMemoryKB int `bson:"virtual_memory,omitempty" json:"virtual_memory,omitempty" mapstructure:"virtual_memory,omitempty"`
}

ResourceLimits represents resource limits in Linux.

Jump to

Keyboard shortcuts

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