evergreen

package module
v0.0.0-...-a9abf63 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 38 Imported by: 0

README

Evergreen

Evergreen is a distributed continuous integration system built by MongoDB. It dynamically allocates hosts to run tasks in parallel across many machines.

Features

Elastic Host Allocation

Use only the computing resources you need.

Clean UI

Easily navigate the state of your tests, logs, and commit history.

Multiplatform Support

Run jobs on any platform Go can cross-compile to.

Spawn Hosts

Spin up a copy of any machine in your test infrastructure for debugging.

Patch Builds

See test results for your code changes before committing.

Stepback on Failure

Automatically run past commits to pinpoint the origin of a test failure.

See the documentation for a full feature list!

System Requirements

The Evergreen agent, server, and CLI are supported on Linux, macOS, and Windows.

Go Requirements

Building the Binaries

Setup:

  • ensure that your GOPATH environment variable is set.
  • check out a copy of the repo into your gopath. You can use: go get github.com/evergreen-ci/evergreen. If you have an existing checkout of the evergreen repository that is not in $GOPATH/src/github.com/evergreen-ci/ move or create a symlink.

Possible Targets:

  • run make build to compile a binary for your local system.
  • run make dist to compile binaries for all supported systems and create a dist tarball with all artifacts.

Documentation

Index

Constants

View Source
const (
	Announcement BannerTheme = "announcement"
	Information              = "information"
	Warning                  = "warning"
	Important                = "important"
)
View Source
const (
	DefaultEventProcessingLimit    = 1000
	DefaultBufferIntervalSeconds   = 60
	DefaultBufferTargetPerInterval = 20
)
View Source
const (
	RoleCollection  = "roles"
	ScopeCollection = "scopes"
)
View Source
const (
	User            = "mci"
	GithubPatchUser = "github_pull_request"

	HostRunning         = "running"
	HostTerminated      = "terminated"
	HostUninitialized   = "initializing"
	HostBuilding        = "building"
	HostStarting        = "starting"
	HostProvisioning    = "provisioning"
	HostProvisionFailed = "provision failed"
	HostQuarantined     = "quarantined"
	HostDecommissioned  = "decommissioned"

	HostStopping = "stopping"
	HostStopped  = "stopped"

	HostExternalUserName = "external"

	HostStatusSuccess = "success"
	HostStatusFailed  = "failed"

	// TaskInactive is not assigned to any new tasks, but can be found
	// in the database and is used in the UI.
	TaskInactive = "inactive"

	// TaskUnstarted is assigned to a display task after cleaning up one of
	// its execution tasks. This indicates that the display task is
	// pending a rerun
	TaskUnstarted = "unstarted"

	// TaskUndispatched indicates either
	//  1. a task is not scheduled to run (when Task.Activated == false)
	//  2. a task is scheduled to run (when Task.Activated == true)
	TaskUndispatched = "undispatched"

	// TaskStarted indicates a task is running on an agent
	TaskStarted = "started"

	// TaskDispatched indicates that an agent has received the task, but
	// the agent has not yet told Evergreen that it's running the task
	TaskDispatched = "dispatched"

	// The task statuses below indicate that a task has finished.
	TaskSucceeded = "success"

	// These statuses indicate the types of failures that are stored in
	// Task.Status field, build TaskCache and TaskEndDetails.
	TaskFailed       = "failed"
	TaskSystemFailed = "system-failed"
	TaskTestTimedOut = "test-timed-out"
	TaskSetupFailed  = "setup-failed"

	TaskStatusBlocked = "blocked"
	TaskStatusPending = "pending"

	// Task Command Types
	CommandTypeTest   = "test"
	CommandTypeSystem = "system"
	CommandTypeSetup  = "setup"

	// Task descriptions
	TaskDescriptionHeartbeat = "heartbeat"
	TaskDescriptionStranded  = "stranded"

	// Task Statuses that are currently used only by the UI, and in tests
	// (these may be used in old tasks)
	TaskSystemUnresponse = "system-unresponsive"
	TaskSystemTimedOut   = "system-timed-out"
	TaskTimedOut         = "task-timed-out"

	// TaskConflict is used only in communication with the Agent
	TaskConflict = "task-conflict"

	TestFailedStatus         = "fail"
	TestSilentlyFailedStatus = "silentfail"
	TestSkippedStatus        = "skip"
	TestSucceededStatus      = "pass"

	BuildStarted   = "started"
	BuildCreated   = "created"
	BuildFailed    = "failed"
	BuildSucceeded = "success"

	VersionStarted   = "started"
	VersionCreated   = "created"
	VersionFailed    = "failed"
	VersionSucceeded = "success"

	PatchCreated   = "created"
	PatchStarted   = "started"
	PatchSucceeded = "succeeded"
	PatchFailed    = "failed"

	PushLogPushing = "pushing"
	PushLogSuccess = "success"

	HostTypeStatic = "static"

	PushStage = "push"

	MergeTestStarted   = "started"
	MergeTestSucceeded = "succeeded"
	MergeTestFailed    = "failed"

	// maximum task (zero based) execution number
	MaxTaskExecution = 3

	// maximum task priority
	MaxTaskPriority = 100

	DisabledTaskPriority = int64(-1)

	// LogMessage struct versions
	LogmessageFormatTimestamp = 1
	LogmessageCurrentVersion  = LogmessageFormatTimestamp

	DefaultEvergreenConfig = ".evergreen.yml"

	EvergreenHome = "EVGHOME"
	MongodbUrl    = "MONGO_URL"

	// Special logging output targets
	LocalLoggingOverride          = "LOCAL"
	StandardOutputLoggingOverride = "STDOUT"

	DefaultTaskActivator   = ""
	StepbackTaskActivator  = "stepback"
	APIServerTaskActivator = "apiserver"

	// Restart Types
	RestartVersions = "versions"
	RestartTasks    = "tasks"

	RestRoutePrefix = "rest"
	APIRoutePrefix  = "api"

	AgentAPIVersion  = 2
	APIRoutePrefixV2 = "/rest/v2"

	AgentMonitorTag = "agent-monitor"

	DegradedLoggingPercent = 10

	SetupScriptName               = "setup.sh"
	TempSetupScriptName           = "setup-temp.sh"
	PowerShellSetupScriptName     = "setup.ps1"
	PowerShellTempSetupScriptName = "setup-temp.ps1"

	RoutePaginatorNextPageHeaderKey = "Link"

	PlannerVersionLegacy  = "legacy"
	PlannerVersionTunable = "tunable"

	DispatcherVersionLegacy                  = "legacy"
	DispatcherVersionRevised                 = "revised"
	DispatcherVersionRevisedWithDependencies = "revised-with-dependencies"

	// maximum turnaround we want to maintain for all hosts for a given distro
	MaxDurationPerDistroHost               = 30 * time.Minute
	MaxDurationPerDistroHostWithContainers = 2 * time.Minute

	// Spawn hosts
	SpawnHostExpireDays                 = 30
	HostExpireDays                      = 10
	ExpireOnFormat                      = "2006-01-02"
	DefaultMaxSpawnHostsPerUser         = 3
	DefaultSpawnHostExpiration          = 24 * time.Hour
	SpawnHostNoExpirationDuration       = 7 * 24 * time.Hour
	MaxSpawnHostExpirationDurationHours = 24 * time.Hour * 14
	DefaultMaxVolumeSizePerUser         = 500
	DefaultUnexpirableHostsPerUser      = 1
	DefaultUnexpirableVolumesPerUser    = 1

	// host resource tag names
	TagName             = "name"
	TagDistro           = "distro"
	TagEvergreenService = "evergreen-service"
	TagUsername         = "username"
	TagOwner            = "owner"
	TagMode             = "mode"
	TagStartTime        = "start-time"
	TagExpireOn         = "expire-on"

	FinderVersionLegacy    = "legacy"
	FinderVersionParallel  = "parallel"
	FinderVersionPipeline  = "pipeline"
	FinderVersionAlternate = "alternate"

	HostAllocatorDuration    = "duration"
	HostAllocatorDeficit     = "deficit"
	HostAllocatorUtilization = "utilization"

	// CommitQueueAlias and GithubAlias are special aliases to specify variants and tasks for commit queue and GitHub PR patches
	CommitQueueAlias = "__commit_queue"
	GithubAlias      = "__github"
	GitTagAlias      = "__git_tag"

	MergeTaskVariant = "commit-queue-merge"
	MergeTaskName    = "merge-patch"
	MergeTaskGroup   = "merge-task-group"

	MaxTeardownGroupTimeoutSecs = 30 * 60

	DefaultJasperPort = 2385

	GlobalGitHubTokenExpansion = "global_github_oauth_token"

	VSCodePort = 2021

	// can flip this when regions are configured
	UseSpawnHostRegions = false

	// DefaultTaskSyncAtEndTimeout is the default timeout for task sync at the
	// end of a patch.
	DefaultTaskSyncAtEndTimeout = time.Hour
)
View Source
const (
	UIPackage      = "EVERGREEN_UI"
	RESTV2Package  = "EVERGREEN_REST_V2"
	MonitorPackage = "EVERGREEN_MONITOR"
)

evergreen package names

View Source
const (
	AuthTokenCookie     = "mci-token"
	TaskHeader          = "Task-Id"
	TaskSecretHeader    = "Task-Secret"
	HostHeader          = "Host-Id"
	HostSecretHeader    = "Host-Secret"
	ContentTypeHeader   = "Content-Type"
	ContentTypeValue    = "application/json"
	ContentLengthHeader = "Content-Length"
	APIUserHeader       = "Api-User"
	APIKeyHeader        = "Api-Key"
)
View Source
const (
	CredentialsCollection = "credentials"
	CAName                = "evergreen"
)
View Source
const (
	ProviderNameEc2Auto     = "ec2-auto"
	ProviderNameEc2OnDemand = "ec2-ondemand"
	ProviderNameEc2Spot     = "ec2-spot"
	ProviderNameEc2Fleet    = "ec2-fleet"
	ProviderNameDocker      = "docker"
	ProviderNameDockerMock  = "docker-mock"
	ProviderNameGce         = "gce"
	ProviderNameStatic      = "static"
	ProviderNameOpenstack   = "openstack"
	ProviderNameVsphere     = "vsphere"
	ProviderNameMock        = "mock"

	// Default EC2 region where hosts should be spawned
	DefaultEC2Region = "us-east-1"
	// This is Amazon's EBS type default
	DefaultEBSType = "gp2"
	// This may be a temporary default
	DefaultEBSAvailabilityZone = "us-east-1a"
)

cloud provider related constants

View Source
const (
	DefaultServiceConfigurationFileName = "/etc/mci_settings.yml"
	DefaultDatabaseUrl                  = "mongodb://localhost:27017"
	DefaultDatabaseName                 = "mci"
	DefaultDatabaseWriteMode            = "majority"

	// database and config directory, set to the testing version by default for safety
	NotificationsFile = "mci-notifications.yml"
	ClientDirectory   = "clients"

	// version requester types
	PatchVersionRequester       = "patch_request"
	GithubPRRequester           = "github_pull_request"
	GitTagRequester             = "git_tag_request"
	RepotrackerVersionRequester = "gitter_request"
	TriggerRequester            = "trigger_request"
	MergeTestRequester          = "merge_test"
	AdHocRequester              = "ad_hoc"
)
View Source
const (
	GenerateTasksCommandName = "generate.tasks"
	HostCreateCommandName    = "host.create"
	S3PushCommandName        = "s3.push"
	S3PullCommandName        = "s3.pull"
)
View Source
const (
	SenderGithubStatus = SenderKey(iota)
	SenderEvergreenWebhook
	SenderSlack
	SenderJIRAIssue
	SenderJIRAComment
	SenderEmail
	SenderGithubMerge
	SenderCommitQueueDequeue
)
View Source
const (
	ArchDarwinAmd64  = "darwin_amd64"
	ArchLinux386     = "linux_386"
	ArchLinuxPpc64le = "linux_ppc64le"
	ArchLinuxS390x   = "linux_s390x"
	ArchLinuxArm64   = "linux_arm64"
	ArchLinuxAmd64   = "linux_amd64"
	ArchWindows386   = "windows_386"
	ArchWindowsAmd64 = "windows_amd64"
)

Recognized architectures, should be in the form ${GOOS}_${GOARCH}.

View Source
const (
	SuperUserResourceType = "super_user"
	ProjectResourceType   = "project"
	DistroResourceType    = "distro"

	AllProjectsScope          = "all_projects"
	UnrestrictedProjectsScope = "unrestricted_projects"
	AllDistrosScope           = "all_distros"
)
View Source
const (
	LogTypeAgent  = "agent_log"
	LogTypeTask   = "task_log"
	LogTypeSystem = "system_log"
)

Evergreen log types

View Source
const NameTimeFormat = "20060102150405"

NameTimeFormat is the format in which to log times like instance start time.

Variables

View Source
var (
	// Should be specified with -ldflags at build time
	BuildRevision = ""

	// Commandline Version String; used to control auto-updating.
	ClientVersion = "2020-07-15"

	// Agent version to control agent rollover.
	AgentVersion = "2020-07-18"
)
View Source
var (
	ConfigCollection = "admin"
	ConfigDocID      = "global"
)
View Source
var (

	// AuthConfig keys
	AuthLDAPKey    = bsonutil.MustHaveTag(AuthConfig{}, "LDAP")
	AuthOktaKey    = bsonutil.MustHaveTag(AuthConfig{}, "Okta")
	AuthGithubKey  = bsonutil.MustHaveTag(AuthConfig{}, "Github")
	AuthNaiveKey   = bsonutil.MustHaveTag(AuthConfig{}, "Naive")
	AuthOnlyAPIKey = bsonutil.MustHaveTag(AuthConfig{}, "OnlyAPI")
	AuthMultiKey   = bsonutil.MustHaveTag(AuthConfig{}, "Multi")

	// ContainerPool keys
	ContainerPoolIdKey = bsonutil.MustHaveTag(ContainerPool{}, "Id")
)

nolint: megacheck, deadcode, unused

View Source
var (
	PatchRequesters = []string{
		PatchVersionRequester,
		GithubPRRequester,
		MergeTestRequester,
	}

	// UpHostStatus is a list of all host statuses that are considered up.
	UpHostStatus = []string{
		HostRunning,
		HostUninitialized,
		HostBuilding,
		HostStarting,
		HostProvisioning,
		HostProvisionFailed,
		HostStopping,
		HostStopped,
	}

	StartedHostStatus = []string{
		HostBuilding,
		HostStarting,
	}

	// ProvisioningHostStatus describes hosts that have started,
	// but have not yet completed the provisioning process.
	ProvisioningHostStatus = []string{
		HostStarting,
		HostProvisioning,
		HostProvisionFailed,
		HostBuilding,
	}

	// CanRunTaskStatus is a list of all host statuses in which a host could be running a task.
	CanRunTaskStatus = []string{
		HostStarting,
		HostProvisioning,
		HostRunning,
	}

	// DownHostStatus is a list of all host statuses that are considered down.
	DownHostStatus = []string{
		HostTerminated,
		HostQuarantined,
		HostDecommissioned,
	}

	// NotRunningStatus is a list of host statuses from before the host starts running.
	NotRunningStatus = []string{
		HostUninitialized,
		HostBuilding,
		HostProvisioning,
		HostStarting,
	}

	// Hosts in "initializing" status aren't actually running yet:
	// they're just intents, so this list omits that value.
	ActiveStatus = []string{
		HostRunning,
		HostBuilding,
		HostStarting,
		HostProvisioning,
		HostProvisionFailed,
		HostStopping,
		HostStopped,
	}

	// Set of host status values that can be user set via the API
	ValidUserSetStatus = []string{
		HostRunning,
		HostTerminated,
		HostQuarantined,
		HostDecommissioned,
	}

	// Set of valid PlannerSettings.Version strings that can be user set via the API
	ValidTaskPlannerVersions = []string{
		PlannerVersionLegacy,
		PlannerVersionTunable,
	}

	// Set of valid DispatchSettings.Version strings that can be user set via the API
	ValidTaskDispatcherVersions = []string{
		DispatcherVersionLegacy,
		DispatcherVersionRevised,
		DispatcherVersionRevisedWithDependencies,
	}

	// Set of valid FinderSettings.Version strings that can be user set via the API
	ValidTaskFinderVersions = []string{
		FinderVersionLegacy,
		FinderVersionParallel,
		FinderVersionPipeline,
		FinderVersionAlternate,
	}

	// Set of valid Host Allocators types
	ValidHostAllocators = []string{
		HostAllocatorUtilization,
	}

	// constant arrays for db update logic
	AbortableStatuses = []string{TaskStarted, TaskDispatched}
	CompletedStatuses = []string{TaskSucceeded, TaskFailed}

	SyncStatuses = []string{TaskSucceeded, TaskFailed}

	ValidCommandTypes = []string{CommandTypeSetup, CommandTypeSystem, CommandTypeTest}

	// Map from valid architectures to display names
	ValidArchDisplayNames = map[string]string{
		ArchWindowsAmd64: "Windows 64-bit",
		ArchLinuxPpc64le: "Linux PowerPC 64-bit",
		ArchLinuxS390x:   "Linux zSeries",
		ArchLinuxArm64:   "Linux ARM 64-bit",
		ArchWindows386:   "Windows 32-bit",
		ArchDarwinAmd64:  "OSX 64-bit",
		ArchLinuxAmd64:   "Linux 64-bit",
		ArchLinux386:     "Linux 32-bit",
	}
)
View Source
var (
	UnauthedUserRoles  = []string{"unauthorized_project"}
	ValidResourceTypes = []string{SuperUserResourceType, ProjectResourceType, DistroResourceType}
	// SuperUserPermissions resource ID.
	SuperUserPermissionsID = "super_user"

	// Admin permissions.
	PermissionAdminSettings = "admin_settings"
	PermissionProjectCreate = "project_create"
	PermissionDistroCreate  = "distro_create"
	PermissionRoleModify    = "modify_roles"
	// Project permissions.
	PermissionProjectSettings  = "project_settings"
	PermissionProjectVariables = "project_variables"
	PermissionTasks            = "project_tasks"
	PermissionPatches          = "project_patches"
	PermissionLogs             = "project_logs"
	// Distro permissions.
	PermissionDistroSettings = "distro_settings"
	PermissionHosts          = "distro_hosts"
)
View Source
var (
	AdminSettingsEdit = PermissionLevel{
		Description: "Edit admin settings",
		Value:       10,
	}
	ProjectCreate = PermissionLevel{
		Description: "Create new projects",
		Value:       10,
	}
	DistroCreate = PermissionLevel{
		Description: "Create new distros",
		Value:       10,
	}
	RoleModify = PermissionLevel{
		Description: "Modify system roles and permissions",
		Value:       10,
	}
	ProjectSettingsEdit = PermissionLevel{
		Description: "Edit project settings",
		Value:       20,
	}
	ProjectSettingsView = PermissionLevel{
		Description: "View project settings",
		Value:       10,
	}
	ProjectSettingsNone = PermissionLevel{
		Description: "No project settings permissions",
		Value:       0,
	}
	TasksAdmin = PermissionLevel{
		Description: "Full tasks permissions",
		Value:       30,
	}
	TasksBasic = PermissionLevel{
		Description: "Basic modifications to tasks",
		Value:       20,
	}
	TasksView = PermissionLevel{
		Description: "View tasks",
		Value:       10,
	}
	TasksNone = PermissionLevel{
		Description: "Not able to view or edit tasks",
		Value:       0,
	}
	PatchSubmit = PermissionLevel{
		Description: "Submit and edit patches",
		Value:       10,
	}
	PatchNone = PermissionLevel{
		Description: "Not able to view or submit patches",
		Value:       0,
	}
	LogsView = PermissionLevel{
		Description: "View logs",
		Value:       10,
	}
	LogsNone = PermissionLevel{
		Description: "Not able to view logs",
		Value:       0,
	}
	DistroSettingsRemove = PermissionLevel{
		Description: "Remove distro and edit distro settings",
		Value:       30,
	}
	DistroSettingsEdit = PermissionLevel{
		Description: "Edit distro settings",
		Value:       20,
	}
	DistroSettingsView = PermissionLevel{
		Description: "View distro settings",
		Value:       10,
	}
	DistroSettingsNone = PermissionLevel{
		Description: "No distro settings permissions",
		Value:       0,
	}
	HostsEdit = PermissionLevel{
		Description: "Edit hosts",
		Value:       20,
	}
	HostsView = PermissionLevel{
		Description: "View hosts",
		Value:       10,
	}
	HostsNone = PermissionLevel{
		Description: "No hosts permissions",
		Value:       0,
	}
)

permission levels

View Source
var (

	// don't ever access this directly except from testutil
	PermissionSystemDisabled = false
)

Functions

func FindEvergreenHome

func FindEvergreenHome() string

FindEvergreenHome finds the directory of the EVGHOME environment variable.

func GetDisplayNameForPermissionKey

func GetDisplayNameForPermissionKey(permissionKey string) string

GetDisplayNameForPermissionKey gets the display name associated with a permission key

func IsFailedTaskStatus

func IsFailedTaskStatus(status string) bool

func IsFinishedTaskStatus

func IsFinishedTaskStatus(status string) bool

func IsGitHubPatchRequester

func IsGitHubPatchRequester(requester string) bool

func IsGitTagRequester

func IsGitTagRequester(requester string) bool

func IsPatchRequester

func IsPatchRequester(requester string) bool

func IsSystemActivator

func IsSystemActivator(caller string) bool

IsSystemActivator returns true when the task activator is Evergreen.

func PermissionsDisabledForTests

func PermissionsDisabledForTests() bool

Permissions-related constants

func SetBanner

func SetBanner(bannerText string) error

SetBanner sets the text of the Evergreen site-wide banner. Setting a blank string here means that there is no banner

func SetBannerTheme

func SetBannerTheme(theme BannerTheme) error

SetBanner sets the text of the Evergreen site-wide banner. Setting a blank string here means that there is no banner

func SetEnvironment

func SetEnvironment(env Environment)

func SetServiceFlags

func SetServiceFlags(flags ServiceFlags) error

SetServiceFlags sets whether each of the runner/API server processes is enabled

func ShouldConsiderBatchtime

func ShouldConsiderBatchtime(requester string) bool

func UpdateConfig

func UpdateConfig(config *Settings) error

UpdateConfig updates all evergreen settings documents in DB

Types

type APIConfig

type APIConfig struct {
	HttpListenAddr      string `bson:"http_listen_addr" json:"http_listen_addr" yaml:"httplistenaddr"`
	GithubWebhookSecret string `bson:"github_webhook_secret" json:"github_webhook_secret" yaml:"github_webhook_secret"`
}

APIConfig holds relevant log and listener settings for the API server.

func (*APIConfig) Get

func (c *APIConfig) Get(env Environment) error

func (*APIConfig) SectionId

func (c *APIConfig) SectionId() string

func (*APIConfig) Set

func (c *APIConfig) Set() error

func (*APIConfig) ValidateAndDefault

func (c *APIConfig) ValidateAndDefault() error

type AWSConfig

type AWSConfig struct {
	EC2Keys []EC2Key `bson:"ec2_keys" json:"ec2_keys" yaml:"ec2_keys"`
	Subnets []Subnet `bson:"subnets" json:"subnets" yaml:"subnets"`

	S3 S3Credentials `bson:"s3_credentials"`
	// TaskSync stores credentials for storing task data in S3.
	TaskSync S3Credentials `bson:"task_sync" json:"task_sync" yaml:"task_sync"`
	// TaskSyncRead stores credentials for reading task data in S3.
	TaskSyncRead S3Credentials `bson:"task_sync_read" json:"task_sync_read" yaml:"task_sync_read"`
	S3BaseURL    string        `bson:"s3_base_url" json:"s3_base_url" yaml:"s3_base_url"`

	DefaultSecurityGroup string `bson:"default_security_group" json:"default_security_group" yaml:"default_security_group"`

	// EC2 instance types for spawn hosts
	AllowedInstanceTypes []string `bson:"allowed_instance_types" json:"allowed_instance_types" yaml:"allowed_instance_types"`
	MaxVolumeSizePerUser int      `bson:"max_volume_size" json:"max_volume_size" yaml:"max_volume_size"`
}

AWSConfig stores auth info for Amazon Web Services.

type AlertsConfig

type AlertsConfig struct {
	SMTP SMTPConfig `bson:"smtp" json:"smtp" yaml:"smtp"`
}

func (*AlertsConfig) Get

func (c *AlertsConfig) Get(env Environment) error

func (*AlertsConfig) SectionId

func (c *AlertsConfig) SectionId() string

func (*AlertsConfig) Set

func (c *AlertsConfig) Set() error

func (*AlertsConfig) ValidateAndDefault

func (c *AlertsConfig) ValidateAndDefault() error

type AmboyConfig

type AmboyConfig struct {
	Name                                  string `bson:"name" json:"name" yaml:"name"`
	SingleName                            string `bson:"single_name" json:"single_name" yaml:"single_name"`
	DB                                    string `bson:"database" json:"database" yaml:"database"`
	PoolSizeLocal                         int    `bson:"pool_size_local" json:"pool_size_local" yaml:"pool_size_local"`
	PoolSizeRemote                        int    `bson:"pool_size_remote" json:"pool_size_remote" yaml:"pool_size_remote"`
	LocalStorage                          int    `bson:"local_storage_size" json:"local_storage_size" yaml:"local_storage_size"`
	GroupDefaultWorkers                   int    `bson:"group_default_workers" json:"group_default_workers" yaml:"group_default_workers"`
	GroupBackgroundCreateFrequencyMinutes int    `bson:"group_background_create_frequency" json:"group_background_create_frequency" yaml:"group_background_create_frequency"`
	GroupPruneFrequencyMinutes            int    `bson:"group_prune_frequency" json:"group_prune_frequency" yaml:"group_prune_frequency"`
	GroupTTLMinutes                       int    `bson:"group_ttl" json:"group_ttl" yaml:"group_ttl"`
	RequireRemotePriority                 bool   `bson:"require_remote_priority" json:"require_remote_priority" yaml:"require_remote_priority"`
	LockTimeoutMinutes                    int    `bson:"lock_timeout_minutes" json:"lock_timeout_minutes" yaml:"lock_timeout_minutes"`
}

func (*AmboyConfig) Get

func (c *AmboyConfig) Get(env Environment) error

func (*AmboyConfig) SectionId

func (c *AmboyConfig) SectionId() string

func (*AmboyConfig) Set

func (c *AmboyConfig) Set() error

func (*AmboyConfig) ValidateAndDefault

func (c *AmboyConfig) ValidateAndDefault() error

type AuthConfig

type AuthConfig struct {
	LDAP                    *LDAPConfig        `bson:"ldap,omitempty" json:"ldap" yaml:"ldap"`
	Okta                    *OktaConfig        `bson:"okta,omitempty" json:"okta" yaml:"okta"`
	Naive                   *NaiveAuthConfig   `bson:"naive,omitempty" json:"naive" yaml:"naive"`
	OnlyAPI                 *OnlyAPIAuthConfig `bson:"only_api,omitempty" json:"only_api" yaml:"only_api"`
	Github                  *GithubAuthConfig  `bson:"github,omitempty" json:"github" yaml:"github"`
	Multi                   *MultiAuthConfig   `bson:"multi" json:"multi" yaml:"multi"`
	PreferredType           string             `bson:"preferred_type,omitempty" json:"preferred_type" yaml:"preferred_type"`
	BackgroundReauthMinutes int                `bson:"background_reauth_minutes" json:"background_reauth_minutes" yaml:"background_reauth_minutes"`
}

AuthConfig contains the settings for the various auth managers.

func (*AuthConfig) Get

func (c *AuthConfig) Get(env Environment) error

func (*AuthConfig) SectionId

func (c *AuthConfig) SectionId() string

func (*AuthConfig) Set

func (c *AuthConfig) Set() error

func (*AuthConfig) ValidateAndDefault

func (c *AuthConfig) ValidateAndDefault() error

type AuthUser

type AuthUser struct {
	Username    string `bson:"username" json:"username" yaml:"username"`
	DisplayName string `bson:"display_name" json:"display_name" yaml:"display_name"`
	Password    string `bson:"password" json:"password" yaml:"password"`
	Email       string `bson:"email" json:"email" yaml:"email"`
}

AuthUser configures a user for our Naive authentication setup.

type BackupConfig

type BackupConfig struct {
	BucketName string `bson:"bucket_name" json:"bucket_name" yaml:"bucket_name"`
	Key        string `bson:"key" json:"key" yaml:"key"`
	Secret     string `bson:"secret" json:"secret" yaml:"secret"`
	Prefix     string `bson:"prefix" json:"prefix" yaml:"prefix"`
	Compress   bool   `bson:"compress" json:"compress" yaml:"compress"`
}

func (*BackupConfig) Get

func (c *BackupConfig) Get(env Environment) error

func (*BackupConfig) Populated

func (c *BackupConfig) Populated() bool

func (*BackupConfig) SectionId

func (c *BackupConfig) SectionId() string

func (*BackupConfig) Set

func (c *BackupConfig) Set() error

func (*BackupConfig) ValidateAndDefault

func (c *BackupConfig) ValidateAndDefault() error

type BannerTheme

type BannerTheme string

supported banner themes in Evergreen

func IsValidBannerTheme

func IsValidBannerTheme(input string) (bool, BannerTheme)

type BuildBaronProject

type BuildBaronProject struct {
	TicketCreateProject  string   `mapstructure:"ticket_create_project" bson:"ticket_create_project"`
	TicketSearchProjects []string `mapstructure:"ticket_search_projects" bson:"ticket_search_projects"`

	// The BF Suggestion server as a source of suggestions is only enabled for projects where BFSuggestionServer isn't the empty string.
	BFSuggestionServer      string `mapstructure:"bf_suggestion_server" bson:"bf_suggestion_server"`
	BFSuggestionUsername    string `mapstructure:"bf_suggestion_username" bson:"bf_suggestion_username"`
	BFSuggestionPassword    string `mapstructure:"bf_suggestion_password" bson:"bf_suggestion_password"`
	BFSuggestionTimeoutSecs int    `mapstructure:"bf_suggestion_timeout_secs" bson:"bf_suggestion_timeout_secs"`
	BFSuggestionFeaturesURL string `mapstructure:"bf_suggestion_features_url" bson:"bf_suggestion_features_url"`
}

type ClientBinary

type ClientBinary struct {
	Arch        string `yaml:"arch" json:"arch"`
	OS          string `yaml:"os" json:"os"`
	URL         string `yaml:"url" json:"url"`
	DisplayName string `yaml:"display_name" json:"display_name"`
}

type ClientConfig

type ClientConfig struct {
	ClientBinaries []ClientBinary `yaml:"client_binaries" json:"ClientBinaries"`
	LatestRevision string         `yaml:"latest_revision" json:"LatestRevision"`
}

type CloudProviders

type CloudProviders struct {
	AWS       AWSConfig       `bson:"aws" json:"aws" yaml:"aws"`
	Docker    DockerConfig    `bson:"docker" json:"docker" yaml:"docker"`
	GCE       GCEConfig       `bson:"gce" json:"gce" yaml:"gce"`
	OpenStack OpenStackConfig `bson:"openstack" json:"openstack" yaml:"openstack"`
	VSphere   VSphereConfig   `bson:"vsphere" json:"vsphere" yaml:"vsphere"`
}

CloudProviders stores configuration settings for the supported cloud host providers.

func (*CloudProviders) Get

func (c *CloudProviders) Get(env Environment) error

func (*CloudProviders) SectionId

func (c *CloudProviders) SectionId() string

func (*CloudProviders) Set

func (c *CloudProviders) Set() error

func (*CloudProviders) ValidateAndDefault

func (c *CloudProviders) ValidateAndDefault() error

type CommitQueueConfig

type CommitQueueConfig struct {
	MergeTaskDistro string `yaml:"merge_task_distro" bson:"merge_task_distro" json:"merge_task_distro"`
	CommitterName   string `yaml:"committer_name" bson:"committer_name" json:"committer_name"`
	CommitterEmail  string `yaml:"committer_email" bson:"committer_email" json:"committer_email"`
}

func (*CommitQueueConfig) Get

func (c *CommitQueueConfig) Get(env Environment) error

func (*CommitQueueConfig) SectionId

func (c *CommitQueueConfig) SectionId() string

func (*CommitQueueConfig) Set

func (c *CommitQueueConfig) Set() error

func (*CommitQueueConfig) ValidateAndDefault

func (c *CommitQueueConfig) ValidateAndDefault() error

type ConfigSection

type ConfigSection interface {
	// SectionId() returns the ID of the section to be used in the database document and struct tag
	SectionId() string
	// Get() populates the section from the DB
	Get(Environment) error
	// Set() upserts the section document into the DB
	Set() error
	// ValidateAndDefault() validates input and sets defaults
	ValidateAndDefault() error
}

ConfigSection defines a sub-document in the evergreen config any config sections must also be added to registry.go

type ConfigSectionRegistry

type ConfigSectionRegistry struct {
	// contains filtered or unexported fields
}
var ConfigRegistry *ConfigSectionRegistry

func (*ConfigSectionRegistry) GetSection

func (r *ConfigSectionRegistry) GetSection(id string) ConfigSection

func (*ConfigSectionRegistry) GetSections

func (r *ConfigSectionRegistry) GetSections() map[string]ConfigSection

type ContainerPool

type ContainerPool struct {
	// Distro of parent host that hosts containers
	Distro string `bson:"distro" json:"distro" yaml:"distro"`
	// ID of container pool
	Id string `bson:"id" json:"id" yaml:"id"`
	// Maximum number of containers per parent host with this container pool
	MaxContainers int `bson:"max_containers" json:"max_containers" yaml:"max_containers"`
	// Port number to start at for SSH connections
	Port uint16 `bson:"port" json:"port" yaml:"port"`
	// # of images that can be on a single host, defaults to 3 if not set
	MaxImages int
}

ContainerPool holds settings for each container pool

type ContainerPoolsConfig

type ContainerPoolsConfig struct {
	Pools []ContainerPool `bson:"pools" json:"pools" yaml:"pools"`
}

func (*ContainerPoolsConfig) Get

func (*ContainerPoolsConfig) GetContainerPool

func (c *ContainerPoolsConfig) GetContainerPool(id string) *ContainerPool

GetContainerPool retrieves the container pool with a given id from a ContainerPoolsConfig struct

func (*ContainerPoolsConfig) SectionId

func (c *ContainerPoolsConfig) SectionId() string

func (*ContainerPoolsConfig) Set

func (c *ContainerPoolsConfig) Set() error

func (*ContainerPoolsConfig) ValidateAndDefault

func (c *ContainerPoolsConfig) ValidateAndDefault() error

type DBSettings

type DBSettings struct {
	Url                  string       `yaml:"url"`
	DB                   string       `yaml:"db"`
	WriteConcernSettings WriteConcern `yaml:"write_concern"`
}

type DockerConfig

type DockerConfig struct {
	APIVersion    string `bson:"api_version" json:"api_version" yaml:"api_version"`
	DefaultDistro string `bson:"default_distro" json:"default_distro" yaml:"default_distro"`
}

DockerConfig stores auth info for Docker.

type EC2Key

type EC2Key struct {
	Name   string `bson:"name" json:"name" yaml:"name"`
	Region string `bson:"region" json:"region" yaml:"region"`
	Key    string `bson:"key" json:"key" yaml:"key"`
	Secret string `bson:"secret" json:"secret" yaml:"secret"`
}

EC2Key links a region with a corresponding key and secret

type Environment

type Environment interface {
	// Returns the settings object. The settings object is not
	// necessarily safe for concurrent access.
	Settings() *Settings
	Context() (context.Context, context.CancelFunc)

	Session() db.Session
	Client() *mongo.Client
	DB() *mongo.Database

	// The Environment provides access to several amboy queues for
	// processing background work in the context of the Evergreen
	// application.
	//
	// The LocalQueue provides process-local execution, to support
	// reporting and cleanup operations local to a single instance
	// of the evergreen application.  These queues are not
	// durable, and job data are not available between application
	// restarts.
	//
	// The RemoteQueue provides a single queue with many
	// workers, distributed across all application servers. Each
	// application dedicates a moderate pool of workers, and work
	// enters this queue from periodic operations
	// (e.g. "cron-like") as well as work that is submitted as a
	// result of user requests. The service queue is
	// mixed-workload.
	//
	// The RemoteQueueGroup provides logically distinct
	// application queues in situations where we need to isolate
	// workloads between queues. The queues are backed remotely, which
	// means that their work persists between restarts.
	LocalQueue() amboy.Queue
	RemoteQueue() amboy.Queue
	RemoteQueueGroup() amboy.QueueGroup

	// Jasper is a process manager for running external
	// commands. Every process has a manager service.
	JasperManager() jasper.Manager
	CertificateDepot() certdepot.Depot

	// ClientConfig provides access to a list of the latest evergreen
	// clients, that this server can serve to users
	ClientConfig() *ClientConfig

	// SaveConfig persists the configuration settings.
	SaveConfig() error

	// GetSender provides a grip Sender configured with the environment's
	// settings. These Grip senders must be used with Composers that specify
	// all message details.
	GetSender(SenderKey) (send.Sender, error)
	SetSender(SenderKey, send.Sender) error

	// RegisterCloser adds a function object to an internal
	// tracker to be called by the Close method before process
	// termination. The ID is used in reporting, but must be
	// unique or a new closer could overwrite an existing closer
	// in some implementations.
	RegisterCloser(string, bool, func(context.Context) error)
	// Close calls all registered closers in the environment.
	Close(context.Context) error

	// RoleManager returns an interface that can be used to interact with roles and permissions
	RoleManager() gimlet.RoleManager

	// UserManager returns the global user manager for authentication.
	UserManager() gimlet.UserManager
	SetUserManager(gimlet.UserManager)
	// UserManagerInfo returns the information about the user manager.
	UserManagerInfo() UserManagerInfo
	SetUserManagerInfo(UserManagerInfo)
}

Environment provides application-level services (e.g. databases, configuration, queues.

func GetEnvironment

func GetEnvironment() Environment

GetEnvironment returns the global application level environment. This implementation is thread safe, but must be configured before use.

In general you should call this operation once per process execution and pass the Environment interface through your application like a context, although there are cases in legacy code (e.g. models) and in the implementation of amboy jobs where it is necessary to access the global environment. There is a mock implementation for use in testing.

func NewEnvironment

func NewEnvironment(ctx context.Context, confPath string, db *DBSettings) (Environment, error)

NewEnvironment constructs an Environment instance, establishing a new connection to the database, and creating a new set of worker queues.

When NewEnvironment returns without an error, you should assume that the queues have been started, there was no issue establishing a connection to the database, and that the local and remote queues have started.

NewEnvironment requires that either the path or DB is sent so that if both are specified, the settings are read from the file.

type GCEConfig

type GCEConfig struct {
	ClientEmail  string `bson:"client_email" json:"client_email" yaml:"client_email"`
	PrivateKey   string `bson:"private_key" json:"private_key" yaml:"private_key"`
	PrivateKeyID string `bson:"private_key_id" json:"private_key_id" yaml:"private_key_id"`
	TokenURI     string `bson:"token_uri" json:"token_uri" yaml:"token_uri"`
}

GCEConfig stores auth info for Google Compute Engine. Can be retrieved from: https://developers.google.com/identity/protocols/application-default-credentials

type GithubAuthConfig

type GithubAuthConfig struct {
	ClientId     string   `bson:"client_id" json:"client_id" yaml:"client_id"`
	ClientSecret string   `bson:"client_secret" json:"client_secret" yaml:"client_secret"`
	Users        []string `bson:"users" json:"users" yaml:"users"`
	Organization string   `bson:"organization" json:"organization" yaml:"organization"`
}

GithubAuthConfig contains settings for interacting with Github Authentication including the ClientID, ClientSecret and CallbackUri which are given when registering the application Furthermore,

type HostInitConfig

type HostInitConfig struct {
	HostThrottle         int `bson:"host_throttle" json:"host_throttle" yaml:"host_throttle"`
	ProvisioningThrottle int `bson:"provisioning_throttle" json:"provisioning_throttle" yaml:"provisioning_throttle"`
	CloudStatusBatchSize int `bson:"cloud_batch_size" json:"cloud_batch_size" yaml:"cloud_batch_size"`
}

HostInitConfig holds logging settings for the hostinit process.

func (*HostInitConfig) Get

func (c *HostInitConfig) Get(env Environment) error

func (*HostInitConfig) SectionId

func (c *HostInitConfig) SectionId() string

func (*HostInitConfig) Set

func (c *HostInitConfig) Set() error

func (*HostInitConfig) ValidateAndDefault

func (c *HostInitConfig) ValidateAndDefault() error

type HostJasperConfig

type HostJasperConfig struct {
	BinaryName       string `yaml:"binary_name" bson:"binary_name" json:"binary_name"`
	DownloadFileName string `yaml:"download_file_name" bson:"download_file_name" json:"download_file_name"`
	Port             int    `yaml:"port" bson:"port" json:"port"`
	URL              string `yaml:"url" bson:"url" json:"url"`
	Version          string `yaml:"version" bson:"version" json:"version"`
}

HostJasperConfig represents the configuration of the Jasper service running on non-legacy hosts.

func (*HostJasperConfig) Get

func (c *HostJasperConfig) Get(env Environment) error

func (*HostJasperConfig) SectionId

func (c *HostJasperConfig) SectionId() string

func (*HostJasperConfig) Set

func (c *HostJasperConfig) Set() error

func (*HostJasperConfig) ValidateAndDefault

func (c *HostJasperConfig) ValidateAndDefault() error

type JIRANotificationsConfig

type JIRANotificationsConfig struct {
	CustomFields []JIRANotificationsProject `bson:"custom_fields"`
}

func (*JIRANotificationsConfig) Get

func (*JIRANotificationsConfig) SectionId

func (c *JIRANotificationsConfig) SectionId() string

func (*JIRANotificationsConfig) Set

func (c *JIRANotificationsConfig) Set() error

func (*JIRANotificationsConfig) ValidateAndDefault

func (c *JIRANotificationsConfig) ValidateAndDefault() error

type JIRANotificationsCustomField

type JIRANotificationsCustomField struct {
	Field    string `bson:"field"`
	Template string `bson:"template"`
}

type JIRANotificationsProject

type JIRANotificationsProject struct {
	Project    string                         `bson:"project"`
	Fields     []JIRANotificationsCustomField `bson:"fields"`
	Components []string                       `bson:"components"`
	Labels     []string                       `bson:"labels"`
}

type JiraBasicAuthConfig

type JiraBasicAuthConfig struct {
	Username string `yaml:"username" bson:"username" json:"username"`
	Password string `yaml:"password" bson:"password" json:"password"`
}

type JiraConfig

type JiraConfig struct {
	Host            string              `yaml:"host" bson:"host" json:"host"`
	BasicAuthConfig JiraBasicAuthConfig `yaml:"basic_auth" bson:"basic_auth" json:"basic_auth"`
	OAuth1Config    JiraOAuth1Config    `yaml:"oauth1" bson:"oauth1" json:"oauth1"`
	DefaultProject  string              `yaml:"default_project" bson:"default_project" json:"default_project"`
}

JiraConfig stores auth info for interacting with Atlassian Jira.

func (JiraConfig) Export

func (c JiraConfig) Export() *send.JiraOptions

func (*JiraConfig) Get

func (c *JiraConfig) Get(env Environment) error

func (JiraConfig) GetHostURL

func (c JiraConfig) GetHostURL() string

func (*JiraConfig) SectionId

func (c *JiraConfig) SectionId() string

func (*JiraConfig) Set

func (c *JiraConfig) Set() error

func (*JiraConfig) ValidateAndDefault

func (c *JiraConfig) ValidateAndDefault() error

type JiraOAuth1Config

type JiraOAuth1Config struct {
	PrivateKey  string `yaml:"private_key" bson:"private_key" json:"private_key"`
	AccessToken string `yaml:"access_token" bson:"access_token" json:"access_token"`
	TokenSecret string `yaml:"token_secret" bson:"token_secret" json:"token_secret"`
	ConsumerKey string `yaml:"consumer_key" bson:"consumer_key" json:"consumer_key"`
}

type LDAPConfig

type LDAPConfig struct {
	URL                string `bson:"url" json:"url" yaml:"url"`
	Port               string `bson:"port" json:"port" yaml:"port"`
	UserPath           string `bson:"path" json:"path" yaml:"path"`
	ServicePath        string `bson:"service_path" json:"service_path" yaml:"service_path"`
	Group              string `bson:"group" json:"group" yaml:"group"`
	ServiceGroup       string `bson:"service_group" json:"service_group" yaml:"service_group"`
	ExpireAfterMinutes string `bson:"expire_after_minutes" json:"expire_after_minutes" yaml:"expire_after_minutes"`
	GroupOU            string `bson:"group_ou" json:"group_ou" yaml:"group_ou"`
}

LDAPConfig contains settings for interacting with an LDAP server.

type LDAPRoleMap

type LDAPRoleMap []LDAPRoleMapping

LDAPRoleMap contains mappings of LDAP groups for a user to roles. LDAP groups are represented by their name and roles by their unique ID in the roles collection.

func (*LDAPRoleMap) Add

func (m *LDAPRoleMap) Add(group, roleID string) error

Add adds a new (or updates an existing) LDAP group to role mapping in the database.

func (*LDAPRoleMap) Remove

func (m *LDAPRoleMap) Remove(group string) error

Remove removes a LDAP group to role mapping from the database.

type LDAPRoleMapping

type LDAPRoleMapping struct {
	LDAPGroup string `bson:"ldap_group" json:"ldap_group" yaml:"ldap_group"`
	RoleID    string `bson:"role_id" json:"role_id" yaml:"role_id"`
}

LDAPRoleMapping contains a single mapping of a LDAP group to a role ID.

type LogBuffering

type LogBuffering struct {
	DurationSeconds int `bson:"duration_seconds" json:"duration_seconds" yaml:"duration_seconds"`
	Count           int `bson:"count" json:"count" yaml:"count"`
}

type LoggerConfig

type LoggerConfig struct {
	Buffer              LogBuffering `bson:"buffer" json:"buffer" yaml:"buffer"`
	DefaultLevel        string       `bson:"default_level" json:"default_level" yaml:"default_level"`
	ThresholdLevel      string       `bson:"threshold_level" json:"threshold_level" yaml:"threshold_level"`
	LogkeeperURL        string       `bson:"logkeeper_url" json:"logkeeper_url" yaml:"logkeeper_url"`
	BuildloggerBaseURL  string       `bson:"buildlogger_base_url" json:"buildlogger_base_url" yaml:"buildlogger_base_url"`
	BuildloggerRPCPort  string       `bson:"buildlogger_rpc_port" json:"buildlogger_rpc_port" yaml:"buildlogger_rpc_port"`
	BuildloggerUser     string       `bson:"buildlogger_user" json:"buildlogger_user" yaml:"buildlogger_user"`
	BuildloggerPassword string       `bson:"buildlogger_password" json:"buildlogger_password" yaml:"buildlogger_password"`
	BuildloggerAPIKey   string       `bson:"buildlogger_api_key" json:"buildlogger_api_key" yaml:"buildlogger_api_key"`
	DefaultLogger       string       `bson:"default_logger" json:"default_logger" yaml:"default_logger"`
}

func (*LoggerConfig) Get

func (c *LoggerConfig) Get(env Environment) error

func (LoggerConfig) Info

func (c LoggerConfig) Info() send.LevelInfo

func (*LoggerConfig) SectionId

func (c *LoggerConfig) SectionId() string

func (*LoggerConfig) Set

func (c *LoggerConfig) Set() error

func (*LoggerConfig) ValidateAndDefault

func (c *LoggerConfig) ValidateAndDefault() error

type MultiAuthConfig

type MultiAuthConfig struct {
	ReadWrite []string `bson:"read_write" json:"read_write" yaml:"read_write"`
	ReadOnly  []string `bson:"read_only" json:"read_only" yaml:"read_only"`
}

MultiAuthConfig contains settings for using multiple authentication mechanisms.

func (*MultiAuthConfig) IsZero

func (c *MultiAuthConfig) IsZero() bool

IsZero checks if the configuration is populated or not.

type NaiveAuthConfig

type NaiveAuthConfig struct {
	Users []AuthUser `bson:"users" json:"users" yaml:"users"`
}

NaiveAuthConfig contains a list of AuthUsers from the settings file.

type NewRelicConfig

type NewRelicConfig struct {
	AccountID     string `bson:"account_id" json:"account_id" yaml:"account_id"`
	TrustKey      string `bson:"trust_key" json:"trust_key" yaml:"trust_key"`
	AgentID       string `bson:"agent_id" json:"agent_id" yaml:"agent_id"`
	LicenseKey    string `bson:"license_key" json:"license_key" yaml:"license_key"`
	ApplicationID string `bson:"application_id" json:"application_id" yaml:"application_id"`
}

func (*NewRelicConfig) Get

func (c *NewRelicConfig) Get(env Environment) error

func (*NewRelicConfig) SectionId

func (c *NewRelicConfig) SectionId() string

func (*NewRelicConfig) Set

func (c *NewRelicConfig) Set() error

func (*NewRelicConfig) ValidateAndDefault

func (c *NewRelicConfig) ValidateAndDefault() error

type NotifyConfig

type NotifyConfig struct {
	BufferTargetPerInterval int        `bson:"buffer_target_per_interval" json:"buffer_target_per_interval" yaml:"buffer_target_per_interval"`
	BufferIntervalSeconds   int        `bson:"buffer_interval_seconds" json:"buffer_interval_seconds" yaml:"buffer_interval_seconds"`
	EventProcessingLimit    int        `bson:"event_processing_limit" json:"event_processing_limit" yaml:"event_processing_limit"`
	SMTP                    SMTPConfig `bson:"smtp" json:"smtp" yaml:"smtp"`
}

NotifyConfig hold logging and email settings for the notify package.

func (*NotifyConfig) Get

func (c *NotifyConfig) Get(env Environment) error

func (*NotifyConfig) SectionId

func (c *NotifyConfig) SectionId() string

func (*NotifyConfig) Set

func (c *NotifyConfig) Set() error

func (*NotifyConfig) ValidateAndDefault

func (c *NotifyConfig) ValidateAndDefault() error

type OktaConfig

type OktaConfig struct {
	ClientID           string `bson:"client_id" json:"client_id" yaml:"client_id"`
	ClientSecret       string `bson:"client_secret" json:"client_secret" yaml:"client_secret"`
	Issuer             string `bson:"issuer" json:"issuer" yaml:"issuer"`
	UserGroup          string `bson:"user_group" json:"user_group" yaml:"user_group"`
	ExpireAfterMinutes int    `bson:"expire_after_minutes" json:"expire_after_minutes" yaml:"expire_after_minutes"`
}

type OnlyAPIAuthConfig

type OnlyAPIAuthConfig struct {
	Users []OnlyAPIUser `bson:"users" json:"users" yaml:"users"`
}

KeyAuthConfig contains the users that can only authenticate via the API from the settings.

type OnlyAPIUser

type OnlyAPIUser struct {
	Username string   `bson:"username" json:"username" yaml:"username"`
	Key      string   `bson:"key" json:"key" yaml:"key"`
	Roles    []string `bson:"roles" json:"roles" yaml:"roles"`
}

OnlyAPIUser configures a special service user with only access to the API via a key.

type OpenStackConfig

type OpenStackConfig struct {
	IdentityEndpoint string `bson:"identity_endpoint" json:"identity_endpoint" yaml:"identity_endpoint"`

	Username   string `bson:"username" json:"username" yaml:"username"`
	Password   string `bson:"password" json:"password" yaml:"password"`
	DomainName string `bson:"domain_name" json:"domain_name" yaml:"domain_name"`

	ProjectName string `bson:"project_name" json:"project_name" yaml:"project_name"`
	ProjectID   string `bson:"project_id" json:"project_id" yaml:"project_id"`

	Region string `bson:"region" json:"region" yaml:"region"`
}

OpenStackConfig stores auth info for Linaro using Identity V3. All fields required.

The config is NOT compatible with Identity V2.

type PermissionLevel

type PermissionLevel struct {
	Description string `json:"description"`
	Value       int    `json:"value"`
}

func GetPermissionLevelsForPermissionKey

func GetPermissionLevelsForPermissionKey(permissionKey string) []PermissionLevel

GetPermissionLevelsForPermissionKey gets all permissions associated with a permission key

type PluginConfig

type PluginConfig map[string]map[string]interface{}

PluginConfig holds plugin-specific settings, which are handled. manually by their respective plugins

type RepoTrackerConfig

type RepoTrackerConfig struct {
	NumNewRepoRevisionsToFetch int `bson:"revs_to_fetch" json:"revs_to_fetch" yaml:"numnewreporevisionstofetch"`
	MaxRepoRevisionsToSearch   int `bson:"max_revs_to_search" json:"max_revs_to_search" yaml:"maxreporevisionstosearch"`
	MaxConcurrentRequests      int `bson:"max_con_requests" json:"max_con_requests" yaml:"maxconcurrentrequests"`
}

RepoTrackerConfig holds settings for polling project repositories.

func (*RepoTrackerConfig) Get

func (c *RepoTrackerConfig) Get(env Environment) error

func (*RepoTrackerConfig) SectionId

func (c *RepoTrackerConfig) SectionId() string

func (*RepoTrackerConfig) Set

func (c *RepoTrackerConfig) Set() error

func (*RepoTrackerConfig) ValidateAndDefault

func (c *RepoTrackerConfig) ValidateAndDefault() error

type S3Credentials

type S3Credentials struct {
	Key    string `bson:"key" json:"key" yaml:"key"`
	Secret string `bson:"secret" json:"secret" yaml:"secret"`
	Bucket string `bson:"bucket" json:"bucket" yaml:"bucket"`
}

func (*S3Credentials) Validate

func (c *S3Credentials) Validate() error

type SMTPConfig

type SMTPConfig struct {
	Server     string   `bson:"server" json:"server" yaml:"server"`
	Port       int      `bson:"port" json:"port" yaml:"port"`
	UseSSL     bool     `bson:"use_ssl" json:"use_ssl" yaml:"use_ssl"`
	Username   string   `bson:"username" json:"username" yaml:"username"`
	Password   string   `bson:"password" json:"password" yaml:"password"`
	From       string   `bson:"from" json:"from" yaml:"from"`
	AdminEmail []string `bson:"admin_email" json:"admin_email" yaml:"admin_email"`
}

SMTPConfig holds SMTP email settings.

type SSHKeyPair

type SSHKeyPair struct {
	Name    string `bson:"name" json:"name" yaml:"name"`
	Public  string `bson:"public" json:"public" yaml:"public"`
	Private string `bson:"private" json:"private" yaml:"private"`
	// EC2Regions contains all EC2 regions that have stored this SSH key.
	EC2Regions []string `bson:"ec2_regions" json:"ec2_regions" yaml:"ec2_regions"`
}

SSHKeyPair represents a public and private SSH key pair.

func (*SSHKeyPair) AddEC2Region

func (p *SSHKeyPair) AddEC2Region(region string) error

AddEC2Region adds the given EC2 region to the set of regions containing the SSH key.

func (*SSHKeyPair) PrivatePath

func (p *SSHKeyPair) PrivatePath(settings *Settings) string

type SchedulerConfig

type SchedulerConfig struct {
	TaskFinder                    string  `bson:"task_finder" json:"task_finder" yaml:"task_finder"`
	HostAllocator                 string  `bson:"host_allocator" json:"host_allocator" yaml:"host_allocator"`
	FreeHostFraction              float64 `bson:"free_host_fraction" json:"free_host_fraction" yaml:"free_host_fraction"`
	CacheDurationSeconds          int     `bson:"cache_duration_seconds" json:"cache_duration_seconds" yaml:"cache_duration_seconds"`
	Planner                       string  `bson:"planner" json:"planner" mapstructure:"planner"`
	TargetTimeSeconds             int     `bson:"target_time_seconds" json:"target_time_seconds" mapstructure:"target_time_seconds"`
	AcceptableHostIdleTimeSeconds int     `` /* 130-byte string literal not displayed */
	GroupVersions                 bool    `bson:"group_versions" json:"group_versions" mapstructure:"group_versions"`
	PatchFactor                   int64   `bson:"patch_zipper_factor" json:"patch_factor" mapstructure:"patch_zipper"`
	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"`
}

SchedulerConfig holds relevant settings for the scheduler process.

func (*SchedulerConfig) Get

func (c *SchedulerConfig) Get(env Environment) error

func (*SchedulerConfig) SectionId

func (c *SchedulerConfig) SectionId() string

func (*SchedulerConfig) Set

func (c *SchedulerConfig) Set() error

func (*SchedulerConfig) ValidateAndDefault

func (c *SchedulerConfig) ValidateAndDefault() error

type SenderKey

type SenderKey int

func (SenderKey) String

func (k SenderKey) String() string

func (SenderKey) Validate

func (k SenderKey) Validate() error

type ServiceFlags

type ServiceFlags struct {
	TaskDispatchDisabled          bool `bson:"task_dispatch_disabled" json:"task_dispatch_disabled"`
	HostInitDisabled              bool `bson:"host_init_disabled" json:"host_init_disabled"`
	MonitorDisabled               bool `bson:"monitor_disabled" json:"monitor_disabled"`
	AlertsDisabled                bool `bson:"alerts_disabled" json:"alerts_disabled"`
	AgentStartDisabled            bool `bson:"agent_start_disabled" json:"agent_start_disabled"`
	RepotrackerDisabled           bool `bson:"repotracker_disabled" json:"repotracker_disabled"`
	SchedulerDisabled             bool `bson:"scheduler_disabled" json:"scheduler_disabled"`
	GithubPRTestingDisabled       bool `bson:"github_pr_testing_disabled" json:"github_pr_testing_disabled"`
	CLIUpdatesDisabled            bool `bson:"cli_updates_disabled" json:"cli_updates_disabled"`
	BackgroundStatsDisabled       bool `bson:"background_stats_disabled" json:"background_stats_disabled"`
	TaskLoggingDisabled           bool `bson:"task_logging_disabled" json:"task_logging_disabled"`
	CacheStatsJobDisabled         bool `bson:"cache_stats_job_disabled" json:"cache_stats_job_disabled"`
	CacheStatsEndpointDisabled    bool `bson:"cache_stats_endpoint_disabled" json:"cache_stats_endpoint_disabled"`
	CacheStatsOldTasksDisabled    bool `bson:"cache_stats_old_tasks_disabled" json:"cache_stats_old_tasks_disabled"`
	TaskReliabilityDisabled       bool `bson:"task_reliability_disabled" json:"task_reliability_disabled"`
	CommitQueueDisabled           bool `bson:"commit_queue_disabled" json:"commit_queue_disabled"`
	PlannerDisabled               bool `bson:"planner_disabled" json:"planner_disabled"`
	HostAllocatorDisabled         bool `bson:"host_allocator_disabled" json:"host_allocator_disabled"`
	DRBackupDisabled              bool `bson:"dr_backup_disabled" json:"dr_backup_disabled"`
	BackgroundReauthDisabled      bool `bson:"background_reauth_disabled" json:"background_reauth_disabled"`
	BackgroundCleanupDisabled     bool `bson:"background_cleanup_disabled" json:"background_cleanup_disabled"`
	AmboyRemoteManagementDisabled bool `bson:"amboy_remote_management_disabled" json:"amboy_remote_management_disabled"`

	// Notification Flags
	EventProcessingDisabled      bool `bson:"event_processing_disabled" json:"event_processing_disabled"`
	JIRANotificationsDisabled    bool `bson:"jira_notifications_disabled" json:"jira_notifications_disabled"`
	SlackNotificationsDisabled   bool `bson:"slack_notifications_disabled" json:"slack_notifications_disabled"`
	EmailNotificationsDisabled   bool `bson:"email_notifications_disabled" json:"email_notifications_disabled"`
	WebhookNotificationsDisabled bool `bson:"webhook_notifications_disabled" json:"webhook_notifications_disabled"`
	GithubStatusAPIDisabled      bool `bson:"github_status_api_disabled" json:"github_status_api_disabled"`
}

ServiceFlags holds the state of each of the runner/API processes

func GetServiceFlags

func GetServiceFlags() (*ServiceFlags, error)

func (*ServiceFlags) Get

func (c *ServiceFlags) Get(env Environment) error

func (*ServiceFlags) SectionId

func (c *ServiceFlags) SectionId() string

func (*ServiceFlags) Set

func (c *ServiceFlags) Set() error

func (*ServiceFlags) ValidateAndDefault

func (c *ServiceFlags) ValidateAndDefault() error

type Settings

type Settings struct {
	Id                 string                    `bson:"_id" json:"id" yaml:"id"`
	Alerts             AlertsConfig              `yaml:"alerts" bson:"alerts" json:"alerts" id:"alerts"`
	Amboy              AmboyConfig               `yaml:"amboy" bson:"amboy" json:"amboy" id:"amboy"`
	Api                APIConfig                 `yaml:"api" bson:"api" json:"api" id:"api"`
	ApiUrl             string                    `yaml:"api_url" bson:"api_url" json:"api_url"`
	AuthConfig         AuthConfig                `yaml:"auth" bson:"auth" json:"auth" id:"auth"`
	Banner             string                    `bson:"banner" json:"banner" yaml:"banner"`
	BannerTheme        BannerTheme               `bson:"banner_theme" json:"banner_theme" yaml:"banner_theme"`
	Bugsnag            string                    `yaml:"bugsnag" bson:"bugsnag" json:"bugsnag"`
	Backup             BackupConfig              `bson:"backup" json:"backup" yaml:"backup"`
	ClientBinariesDir  string                    `yaml:"client_binaries_dir" bson:"client_binaries_dir" json:"client_binaries_dir"`
	CommitQueue        CommitQueueConfig         `yaml:"commit_queue" bson:"commit_queue" json:"commit_queue" id:"commit_queue"`
	ConfigDir          string                    `yaml:"configdir" bson:"configdir" json:"configdir"`
	ContainerPools     ContainerPoolsConfig      `yaml:"container_pools" bson:"container_pools" json:"container_pools" id:"container_pools"`
	Credentials        map[string]string         `yaml:"credentials" bson:"credentials" json:"credentials"`
	CredentialsNew     util.KeyValuePairSlice    `yaml:"credentials_new" bson:"credentials_new" json:"credentials_new"`
	Database           DBSettings                `yaml:"database" json:"database" bson:"database"`
	DomainName         string                    `yaml:"domain_name" bson:"domain_name" json:"domain_name"`
	Expansions         map[string]string         `yaml:"expansions" bson:"expansions" json:"expansions"`
	ExpansionsNew      util.KeyValuePairSlice    `yaml:"expansions_new" bson:"expansions_new" json:"expansions_new"`
	GithubPRCreatorOrg string                    `yaml:"github_pr_creator_org" bson:"github_pr_creator_org" json:"github_pr_creator_org"`
	GithubOrgs         []string                  `yaml:"github_orgs" bson:"github_orgs" json:"github_orgs"`
	HostInit           HostInitConfig            `yaml:"hostinit" bson:"hostinit" json:"hostinit" id:"hostinit"`
	HostJasper         HostJasperConfig          `yaml:"host_jasper" bson:"host_jasper" json:"host_jasper" id:"host_jasper"`
	Jira               JiraConfig                `yaml:"jira" bson:"jira" json:"jira" id:"jira"`
	JIRANotifications  JIRANotificationsConfig   `yaml:"jira_notifications" json:"jira_notifications" bson:"jira_notifications" id:"jira_notifications"`
	Keys               map[string]string         `yaml:"keys" bson:"keys" json:"keys"`
	KeysNew            util.KeyValuePairSlice    `yaml:"keys_new" bson:"keys_new" json:"keys_new"`
	LDAPRoleMap        LDAPRoleMap               `yaml:"ldap_role_map" bson:"ldap_role_map" json:"ldap_role_map"`
	LoggerConfig       LoggerConfig              `yaml:"logger_config" bson:"logger_config" json:"logger_config" id:"logger_config"`
	LogPath            string                    `yaml:"log_path" bson:"log_path" json:"log_path"`
	NewRelic           NewRelicConfig            `yaml:"newrelic" bson:"newrelic" json:"newrelic" id:"newrelic"`
	Notify             NotifyConfig              `yaml:"notify" bson:"notify" json:"notify" id:"notify"`
	Plugins            PluginConfig              `yaml:"plugins" bson:"plugins" json:"plugins"`
	PluginsNew         util.KeyValuePairSlice    `yaml:"plugins_new" bson:"plugins_new" json:"plugins_new"`
	PprofPort          string                    `yaml:"pprof_port" bson:"pprof_port" json:"pprof_port"`
	Providers          CloudProviders            `yaml:"providers" bson:"providers" json:"providers" id:"providers"`
	RepoTracker        RepoTrackerConfig         `yaml:"repotracker" bson:"repotracker" json:"repotracker" id:"repotracker"`
	Scheduler          SchedulerConfig           `yaml:"scheduler" bson:"scheduler" json:"scheduler" id:"scheduler"`
	ServiceFlags       ServiceFlags              `bson:"service_flags" json:"service_flags" id:"service_flags" yaml:"service_flags"`
	SSHKeyDirectory    string                    `yaml:"ssh_key_directory" bson:"ssh_key_directory" json:"ssh_key_directory"`
	SSHKeyPairs        []SSHKeyPair              `yaml:"ssh_key_pairs" bson:"ssh_key_pairs" json:"ssh_key_pairs"`
	Slack              SlackConfig               `yaml:"slack" bson:"slack" json:"slack" id:"slack"`
	Splunk             send.SplunkConnectionInfo `yaml:"splunk" bson:"splunk" json:"splunk"`
	Triggers           TriggerConfig             `yaml:"triggers" bson:"triggers" json:"triggers" id:"triggers"`
	Ui                 UIConfig                  `yaml:"ui" bson:"ui" json:"ui" id:"ui"`
	Spawnhost          SpawnHostConfig           `yaml:"spawnhost" bson:"spawnhost" json:"spawnhost" id:"spawnhost"`
}

Settings contains all configuration settings for running Evergreen. Settings with the "id" struct tag should implement the ConfigSection interface.

func BootstrapConfig

func BootstrapConfig(env Environment) (*Settings, error)

Bootstrap config gets a config from the database defined in the environment.

func GetConfig

func GetConfig() (*Settings, error)

GetConfig retrieves the Evergreen config document. If no document is present in the DB, it will return the defaults.

func NewSettings

func NewSettings(filename string) (*Settings, error)

NewSettings builds an in-memory representation of the given settings file.

func (*Settings) Get

func (c *Settings) Get(env Environment) error

func (*Settings) GetGithubOauthString

func (s *Settings) GetGithubOauthString() (string, error)

func (*Settings) GetGithubOauthToken

func (s *Settings) GetGithubOauthToken() (string, error)

func (*Settings) GetSender

func (s *Settings) GetSender(ctx context.Context, env Environment) (send.Sender, error)

func (*Settings) SectionId

func (c *Settings) SectionId() string

func (*Settings) Set

func (c *Settings) Set() error

Set saves the global fields in the configuration (i.e. those that are not ConfigSections).

func (*Settings) Validate

func (settings *Settings) Validate() error

Validate checks the settings and returns nil if the config is valid, or an error with a message explaining why otherwise.

func (*Settings) ValidateAndDefault

func (c *Settings) ValidateAndDefault() error

type SlackConfig

type SlackConfig struct {
	Options *send.SlackOptions `bson:"options" json:"options" yaml:"options"`
	Token   string             `bson:"token" json:"token" yaml:"token"`
	Level   string             `bson:"level" json:"level" yaml:"level"`
}

func (*SlackConfig) Get

func (c *SlackConfig) Get(env Environment) error

func (*SlackConfig) SectionId

func (c *SlackConfig) SectionId() string

func (*SlackConfig) Set

func (c *SlackConfig) Set() error

func (*SlackConfig) ValidateAndDefault

func (c *SlackConfig) ValidateAndDefault() error

type SpawnHostConfig

type SpawnHostConfig struct {
	UnexpirableHostsPerUser   int `yaml:"unexpirable_hosts_per_user" bson:"unexpirable_hosts_per_user" json:"unexpirable_hosts_per_user"`
	UnexpirableVolumesPerUser int `yaml:"unexpirable_volumes_per_user" bson:"unexpirable_volumes_per_user" json:"unexpirable_volumes_per_user"`
	SpawnHostsPerUser         int `yaml:"spawn_hosts_per_user" bson:"spawn_hosts_per_user" json:"spawn_hosts_per_user"`
}

func (*SpawnHostConfig) Get

func (c *SpawnHostConfig) Get(env Environment) error

func (*SpawnHostConfig) SectionId

func (c *SpawnHostConfig) SectionId() string

func (*SpawnHostConfig) Set

func (c *SpawnHostConfig) Set() error

func (*SpawnHostConfig) ValidateAndDefault

func (c *SpawnHostConfig) ValidateAndDefault() error

type Subnet

type Subnet struct {
	AZ       string `bson:"az" json:"az" yaml:"az"`
	SubnetID string `bson:"subnet_id" json:"subnet_id" yaml:"subnet_id"`
}

type TriggerConfig

type TriggerConfig struct {
	GenerateTaskDistro string `bson:"generate_distro" json:"generate_distro" yaml:"generate_distro"`
}

func (*TriggerConfig) Get

func (c *TriggerConfig) Get(env Environment) error

func (*TriggerConfig) SectionId

func (c *TriggerConfig) SectionId() string

func (*TriggerConfig) Set

func (c *TriggerConfig) Set() error

func (*TriggerConfig) ValidateAndDefault

func (c *TriggerConfig) ValidateAndDefault() error

type UIConfig

type UIConfig struct {
	Url                     string   `bson:"url" json:"url" yaml:"url"`
	HelpUrl                 string   `bson:"help_url" json:"help_url" yaml:"helpurl"`
	UIv2Url                 string   `bson:"uiv2_url" json:"uiv2_url" yaml:"uiv2_url"`
	HttpListenAddr          string   `bson:"http_listen_addr" json:"http_listen_addr" yaml:"httplistenaddr"`
	Secret                  string   `bson:"secret" json:"secret" yaml:"secret"`                           // Secret to encrypt session storage
	DefaultProject          string   `bson:"default_project" json:"default_project" yaml:"defaultproject"` // Default project to assume when none specified
	CacheTemplates          bool     `bson:"cache_templates" json:"cache_templates" yaml:"cachetemplates"` // Cache results of template compilation
	CsrfKey                 string   `bson:"csrf_key" json:"csrf_key" yaml:"csrfkey"`                      // 32-byte key used to generate tokens that validate UI requests
	CORSOrigins             []string `bson:"cors_origins" json:"cors_origins" yaml:"cors_origins"`         // allowed request origins for some UI Routes
	LoginDomain             string   `bson:"login_domain" json:"login_domain" yaml:"login_domain"`         // domain for the login cookie (defaults to domain of app)
	ExpireLoginCookieDomain string   `bson:"expire_domain" json:"expire_domain" yaml:"expire_domain"`      // expire login token for this domain when the user logs in
}

UIConfig holds relevant settings for the UI server.

func (*UIConfig) Get

func (c *UIConfig) Get(env Environment) error

func (*UIConfig) SectionId

func (c *UIConfig) SectionId() string

func (*UIConfig) Set

func (c *UIConfig) Set() error

func (*UIConfig) ValidateAndDefault

func (c *UIConfig) ValidateAndDefault() error

type UserManagerInfo

type UserManagerInfo struct {
	CanClearTokens bool
	CanReauthorize bool
}

UserManagerInfo lists properties of the UserManager regarding its support for certain features. TODO: this should probably be removed by refactoring the optional methods in the gimlet.UserManager.

type VSphereConfig

type VSphereConfig struct {
	Host     string `bson:"host" json:"host" yaml:"host"`
	Username string `bson:"username" json:"username" yaml:"username"`
	Password string `bson:"password" json:"password" yaml:"password"`
}

VSphereConfig stores auth info for VMware vSphere. The config fields refer to your vCenter server, a centralized management tool for the vSphere suite.

type WriteConcern

type WriteConcern struct {
	W        int    `yaml:"w"`
	WMode    string `yaml:"wmode"`
	WTimeout int    `yaml:"wtimeout"`
	J        bool   `yaml:"j"`
}

func (WriteConcern) Resolve

func (wc WriteConcern) Resolve() *writeconcern.WriteConcern

Directories

Path Synopsis
cmd
evergreen command
generate-lint command
go-test-config command
load-smoke-data command
make-tarball command
Archive
Archive
parse-host-file command
revendor command
run-linter command
set-project-var command
set-var command
stats
Package stats provides functions to generate and query pre-computed test and task statistics.
Package stats provides functions to generate and query pre-computed test and task statistics.
The REST API V2 has a series of central types that are useful to understand when adding new endpoints or increasing its functionality.
The REST API V2 has a series of central types that are useful to understand when adding new endpoints or increasing its functionality.
data
Adding to the Connector
Adding to the Connector
model
Adding Models
Adding Models
Package units contains amboy.Job definiteness for Evergreen tasks.
Package units contains amboy.Job definiteness for Evergreen tasks.

Jump to

Keyboard shortcuts

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