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 ValidateBootstrapAndCommunicationMethods(bootstrap string, communication string) error
- func ValidateBootstrapMethod(method string) error
- func ValidateCloneMethod(method string) error
- func ValidateCommunicationMethod(method string) error
- func ValidateContainerPoolDistros(s *evergreen.Settings) error
- type Distro
- func (d *Distro) BinaryName() string
- func (d *Distro) ExecutableSubPath() string
- func (d *Distro) GenerateName() string
- func (d *Distro) GetImageID() (string, error)
- func (d *Distro) GetResolvedPlannerSettings(config evergreen.SchedulerConfig) (PlannerSettings, error)
- 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) Platform() (string, string)
- 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") 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") BootstrapMethodKey = bsonutil.MustHaveTag(Distro{}, "BootstrapMethod") CommunicationMethodKey = bsonutil.MustHaveTag(Distro{}, "CommunicationMethod") CloneMethodKey = bsonutil.MustHaveTag(Distro{}, "CloneMethod") ShellPathKey = bsonutil.MustHaveTag(Distro{}, "ShellPath") CuratorDirKey = bsonutil.MustHaveTag(Distro{}, "CuratorDir") ClientDirKey = bsonutil.MustHaveTag(Distro{}, "ClientDir") JasperCredentialsPathKey = bsonutil.MustHaveTag(Distro{}, "JasperCredentialsPath") 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") )
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 ValidateBootstrapAndCommunicationMethods ¶
ValidateBootstrapAndCommunicationMethods checks that the bootstrap and communication mechanisms are recognized, and that the combination of the two is allowed.
func ValidateBootstrapMethod ¶
ValidateBootstrapMethod checks that the bootstrap mechanism is one of the supported methods.
func ValidateCloneMethod ¶
ValidateCloneMethod checks that the clone mechanism is one of the supported methods.
func ValidateCommunicationMethod ¶
ValidateCommunicationMethod checks that the communication mechanism is one of the supported methods.
func ValidateContainerPoolDistros ¶
ValidateContainerPoolDistros ensures that container pools have valid distros
Types ¶
type Distro ¶
type Distro struct { Id string `bson:"_id" json:"_id,omitempty" mapstructure:"_id,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"` BootstrapMethod string `bson:"bootstrap_method,omitempty" json:"bootstrap_method,omitempty" mapstructure:"bootstrap_method,omitempty"` CommunicationMethod string `bson:"communication_method,omitempty" json:"communication_method,omitempty" mapstructure:"communication_method,omitempty"` CloneMethod string `bson:"clone_method" json:"clone_method,omitempty" mapstructure:"clone_method,omitempty"` ShellPath string `bson:"shell_path" json:"shell_path" mapstructure:"shell_path,omitempty"` CuratorDir string `bson:"curator_dir" json:"curator_dir" mapstructure:"curator_dir,omitempty"` ClientDir string `bson:"client_dir" json:"client_dir" mapstructure:"client_dir,omitempty"` JasperCredentialsPath string `json:"jasper_credentials_path" bson:"jasper_credentials_path" mapstructure:"jasper_credentials_path,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) GetImageID ¶
func (*Distro) GetResolvedPlannerSettings ¶
func (d *Distro) GetResolvedPlannerSettings(config evergreen.SchedulerConfig) (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) IsEphemeral ¶
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"` PatchZipperFactor int `bson:"patch_zipper_factor" json:"patch_zipper_factor" mapstructure:"patch_zipper_factor,omitempty"` TaskOrdering string `bson:"task_ordering" json:"task_ordering" mapstructure:"task_ordering,omitempty"` }