Documentation ¶
Index ¶
- Constants
- Variables
- func ByActiveOrStatic() db.Q
- func ById(id string) db.Q
- func ByIds(ids []string) db.Q
- func ByProvider(p string) db.Q
- func BySpawnAllowed() db.Q
- func Remove(id string) error
- func ValidateArch(arch string) error
- func ValidateCloneMethod(method string) error
- func ValidateContainerPoolDistros(s *evergreen.Settings) error
- type AliasLookupTable
- type BootstrapSettings
- type Distro
- func (d *Distro) BinaryName() string
- func (d *Distro) ExecutableSubPath() string
- func (d *Distro) GenerateName() string
- func (d *Distro) GetExpectedRuntimeFactor() int64
- func (d *Distro) GetImageID() (string, error)
- func (d *Distro) GetPatchFactor() int64
- func (d *Distro) GetPoolSize() int
- func (d *Distro) GetResolvedPlannerSettings(s *evergreen.Settings) (PlannerSettings, error)
- func (d *Distro) GetTimeInQueueFactor() int64
- func (d *Distro) HomeDir() string
- func (d *Distro) Insert() error
- func (d *Distro) IsEphemeral() bool
- func (d *Distro) IsParent(s *evergreen.Settings) bool
- func (d *Distro) IsWindows() bool
- func (d *Distro) MaxDurationPerHost() time.Duration
- func (d *Distro) Platform() (string, string)
- func (d *Distro) ShouldGroupVersions() bool
- func (d *Distro) Update() error
- type DistroGroup
- type Expansion
- type FinderSettings
- type PlannerSettings
Constants ¶
const ( DockerImageBuildTypeImport = "import" DockerImageBuildTypePull = "pull" // Recognized architectures, should be in the form ${GOOS}_${GOARCH}. ArchDarwinAmd64 = "darwin_amd64" ArchLinux386 = "linux_386" ArchLinuxPpc64le = "linux_ppc64le" ArchLinuxS390x = "linux_s390x" ArchLinuxArm64 = "linux_arm64" ArchLinuxAmd64 = "linux_amd64" ArchWindows386 = "windows_386" ArchWindowsAmd64 = "windows_amd64" // Bootstrapping mechanisms BootstrapMethodLegacySSH = "legacy-ssh" BootstrapMethodSSH = "ssh" BootstrapMethodPreconfiguredImage = "preconfigured-image" BootstrapMethodUserData = "user-data" // Means of communicating with hosts CommunicationMethodLegacySSH = "legacy-ssh" CommunicationMethodSSH = "ssh" CommunicationMethodRPC = "rpc" CloneMethodLegacySSH = "legacy-ssh" CloneMethodOAuth = "oauth" )
const Collection = "distro"
Variables ¶
var ( // bson fields for the Distro struct IdKey = bsonutil.MustHaveTag(Distro{}, "Id") AliasesKey = bsonutil.MustHaveTag(Distro{}, "Aliases") ArchKey = bsonutil.MustHaveTag(Distro{}, "Arch") PoolSizeKey = bsonutil.MustHaveTag(Distro{}, "PoolSize") ProviderKey = bsonutil.MustHaveTag(Distro{}, "Provider") ProviderSettingsKey = bsonutil.MustHaveTag(Distro{}, "ProviderSettings") SetupAsSudoKey = bsonutil.MustHaveTag(Distro{}, "SetupAsSudo") SetupKey = bsonutil.MustHaveTag(Distro{}, "Setup") UserKey = bsonutil.MustHaveTag(Distro{}, "User") SSHKeyKey = bsonutil.MustHaveTag(Distro{}, "SSHKey") SSHOptionsKey = bsonutil.MustHaveTag(Distro{}, "SSHOptions") BootstrapSettingsKey = bsonutil.MustHaveTag(Distro{}, "BootstrapSettings") CloneMethodKey = bsonutil.MustHaveTag(Distro{}, "CloneMethod") 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") )
var ( // bson fields for the BootstrapSettings struct BootstrapSettingsMethodKey = bsonutil.MustHaveTag(BootstrapSettings{}, "Method") BootstrapSettingsCommunicationKey = bsonutil.MustHaveTag(BootstrapSettings{}, "Communication") BootstrapSettingsShellPathKey = bsonutil.MustHaveTag(BootstrapSettings{}, "ShellPath") BootstrapSettingsJasperBinaryDirKey = bsonutil.MustHaveTag(BootstrapSettings{}, "JasperBinaryDir") BootstrapSettingsClientDirKey = bsonutil.MustHaveTag(BootstrapSettings{}, "ClientDir") BootstrapSettingsJasperCredentialsPathKey = bsonutil.MustHaveTag(BootstrapSettings{}, "JasperCredentialsPath") )
All is a query that returns all distros.
Functions ¶
func ByActiveOrStatic ¶
ByActiveOrStatic returns a query that selects only active or static distros
func ByIds ¶
ByIds creates a query that finds all distros for the given ids and implicitly returns them ordered by {"_id": 1}
func ByProvider ¶
ByProvider returns a query that contains a Provider selector on the string, p.
func BySpawnAllowed ¶
BySpawnAllowed returns a query that contains the SpawnAllowed selector.
func ValidateArch ¶
ValidateArch checks that the architecture is one of the supported architectures.
func ValidateCloneMethod ¶
ValidateCloneMethod checks that the clone mechanism is one of the supported methods.
func ValidateContainerPoolDistros ¶
ValidateContainerPoolDistros ensures that container pools have valid distros
Types ¶
type AliasLookupTable ¶
func NewDistroAliasesLookupTable ¶
func NewDistroAliasesLookupTable() (AliasLookupTable, error)
func (AliasLookupTable) Expand ¶
func (da AliasLookupTable) Expand(in []string) []string
type BootstrapSettings ¶
type BootstrapSettings struct { Method string `bson:"method" json:"method" mapstructure:"method"` Communication string `bson:"communication,omitempty" json:"communication,omitempty" mapstructure:"communication,omitempty"` 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 */ ShellPath string `bson:"shell_path,omitempty" json:"shell_path,omitempty" mapstructure:"shell_path,omitempty"` }
BootstrapSettings encapsulates all settings related to bootstrapping hosts.
func (*BootstrapSettings) Validate ¶
func (s *BootstrapSettings) Validate() error
Validate checks if all of the bootstrap settings are valid for legacy or non-legacy bootstrapping.
type Distro ¶
type Distro struct { Id string `bson:"_id" json:"_id,omitempty" mapstructure:"_id,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"` PoolSize int `bson:"pool_size,omitempty" json:"pool_size,omitempty" mapstructure:"pool_size,omitempty" yaml:"poolsize"` Provider string `bson:"provider" json:"provider,omitempty" mapstructure:"provider,omitempty"` ProviderSettings *map[string]interface{} `bson:"settings" json:"settings,omitempty" mapstructure:"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"` Teardown string `bson:"teardown,omitempty" json:"teardown,omitempty" mapstructure:"teardown,omitempty"` User string `bson:"user,omitempty" json:"user,omitempty" mapstructure:"user,omitempty"` BootstrapSettings BootstrapSettings `bson:"bootstrap_settings" json:"bootstrap_settings" mapstructure:"bootstrap_settings"` CloneMethod string `bson:"clone_method" json:"clone_method,omitempty" mapstructure:"clone_method,omitempty"` SSHKey string `bson:"ssh_key,omitempty" json:"ssh_key,omitempty" mapstructure:"ssh_key,omitempty"` SSHOptions []string `bson:"ssh_options,omitempty" json:"ssh_options,omitempty" mapstructure:"ssh_options,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"` PlannerSettings PlannerSettings `bson:"planner_settings" json:"planner_settings,omitempty" mapstructure:"planner_settings,omitempty"` FinderSettings FinderSettings `bson:"finder_settings" json:"finder_settings,omitempty" mapstructure:"finder_settings,omitempty"` }
func (*Distro) BinaryName ¶
func (*Distro) ExecutableSubPath ¶
ExecutableSubPath returns the directory containing the compiled agents.
func (*Distro) GenerateName ¶
GenerateName generates a unique instance name for a distro.
func (*Distro) GetExpectedRuntimeFactor ¶
func (*Distro) GetImageID ¶
func (*Distro) GetPatchFactor ¶
func (*Distro) GetPoolSize ¶
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) GetTimeInQueueFactor ¶
func (*Distro) HomeDir ¶
HomeDir gets the absolute path to the home directory for this distro's user.
func (*Distro) IsEphemeral ¶
func (*Distro) IsParent ¶
IsParent returns whether the distro is the parent distro for any container pool
func (*Distro) MaxDurationPerHost ¶
func (*Distro) ShouldGroupVersions ¶
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 FinderSettings ¶
type FinderSettings struct {
Version string `bson:"version" json:"version" mapstructure:"version"`
}
type PlannerSettings ¶
type PlannerSettings struct { Version string `bson:"version" json:"version" mapstructure:"version"` MinimumHosts int `bson:"minimum_hosts" json:"minimum_hosts,omitempty" mapstructure:"minimum_hosts,omitempty"` MaximumHosts int `bson:"maximum_hosts" json:"maximum_hosts,omitempty" mapstructure:"maximum_hosts,omitempty"` TargetTime time.Duration `bson:"target_time" json:"target_time" mapstructure:"target_time,omitempty"` AcceptableHostIdleTime time.Duration `bson:"acceptable_host_idle_time" json:"acceptable_host_idle_time" mapstructure:"acceptable_host_idle_time,omitempty"` GroupVersions *bool `bson:"group_versions" json:"group_versions" mapstructure:"group_versions,omitempty"` TaskOrdering string `bson:"task_ordering" json:"task_ordering" mapstructure:"task_ordering,omitempty"` PatchFactor int64 `bson:"patch_zipper_factor" json:"patch_factor" mapstructure:"patch_factor"` TimeInQueueFactor int64 `bson:"time_in_queue_factor" json:"time_in_queue_factor" mapstructure:"time_in_queue_factor"` ExpectedRuntimeFactor int64 `bson:"expected_runtime_factor" json:"expected_runtime_factor" mapstructure:"expected_runtime_factor"` // contains filtered or unexported fields }