Documentation ¶
Index ¶
- Constants
- Variables
- func FindEvergreenHome() string
- func IsFailedTaskStatus(status string) bool
- func IsFinishedTaskStatus(status string) bool
- func IsGitHubPatchRequester(requester string) bool
- func IsPatchRequester(requester string) bool
- func IsSystemActivator(caller string) bool
- func SetBanner(bannerText string) error
- func SetBannerTheme(theme BannerTheme) error
- func SetEnvironment(env Environment)
- func SetServiceFlags(flags ServiceFlags) error
- func UpdateConfig(config *Settings) error
- type APIConfig
- type AWSConfig
- type AlertsConfig
- type AmboyConfig
- type AuthConfig
- type AuthUser
- type BannerTheme
- type BuildBaronProject
- type ClientBinary
- type ClientConfig
- type CloudProviders
- type CommitQueueConfig
- type ConfigSection
- type ConfigSectionRegistry
- type ContainerPool
- type ContainerPoolsConfig
- type DBSettings
- type DockerConfig
- type Environment
- type GCEConfig
- type GithubAuthConfig
- type HostInitConfig
- type HostJasperConfig
- type JIRACustomFieldsByProject
- type JIRANotificationsConfig
- type JIRANotificationsCustomField
- type JIRANotificationsProject
- type JiraConfig
- type LDAPConfig
- type LogBuffering
- type LoggerConfig
- type NaiveAuthConfig
- type NotifyConfig
- type OpenStackConfig
- type PluginConfig
- type RepoTrackerConfig
- type SMTPConfig
- type SchedulerConfig
- type SenderKey
- type ServiceFlags
- type Settings
- func (c *Settings) Get(env Environment) error
- func (s *Settings) GetGithubOauthString() (string, error)
- func (s *Settings) GetGithubOauthToken() (string, error)
- func (s *Settings) GetSender(ctx context.Context, env Environment) (send.Sender, error)
- func (c *Settings) SectionId() string
- func (c *Settings) Set() error
- func (settings *Settings) Validate() error
- func (c *Settings) ValidateAndDefault() error
- type SlackConfig
- type TriggerConfig
- type UIConfig
- type VSphereConfig
- type WriteConcern
Constants ¶
const ( Announcement BannerTheme = "announcement" Information = "information" Warning = "warning" Important = "important" )
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" 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" // Task Command Types CommandTypeTest = "test" CommandTypeSystem = "system" CommandTypeSetup = "setup" // 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 // LogMessage struct versions LogmessageFormatTimestamp = 1 LogmessageCurrentVersion = LogmessageFormatTimestamp EvergreenHome = "EVGHOME" MongodbUrl = "MONGO_URL" // Special logging output targets LocalLoggingOverride = "LOCAL" StandardOutputLoggingOverride = "STDOUT" DefaultTaskActivator = "" StepbackTaskActivator = "stepback" APIServerTaskActivator = "apiserver" RestRoutePrefix = "rest" APIRoutePrefix = "api" AgentAPIVersion = 2 APIRoutePrefixV2 = "/rest/v2" DegradedLoggingPercent = 10 SetupScriptName = "setup.sh" TempSetupScriptName = "setup-temp.sh" TeardownScriptName = "teardown.sh" RoutePaginatorNextPageHeaderKey = "Link" PlannerVersionLegacy = "legacy" PlannerVersionRevised = "revised" PlannerVersionTunable = "tunable" FinderVersionLegacy = "legacy" FinderVersionParallel = "parallel" FinderVersionPipeline = "pipeline" FinderVersionAlternate = "alternate" HostAllocatorDuration = "duration" HostAllocatorDeficit = "deficit" HostAllocatorUtilization = "utilization" TaskOrderingNotDeclared = "" TaskOrderingInterleave = "interleave" TaskOrderingMainlineFirst = "mainlinefirst" TaskOrderingPatchFirst = "patchfirst" CommitQueueAlias = "__commit_queue" MergeTaskVariant = "commit-queue-merge" MergeTaskName = "merge-patch" MergeTaskGroup = "merge-task-group" MaxTeardownGroupTimeoutSecs = 30 * 60 DefaultJasperPort = 2385 )
const ( UIPackage = "EVERGREEN_UI" RESTV2Package = "EVERGREEN_REST_V2" MonitorPackage = "EVERGREEN_MONITOR" )
evergreen package names
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" )
const ( ProviderNameEc2Auto = "ec2-auto" ProviderNameEc2OnDemand = "ec2-ondemand" ProviderNameEc2Spot = "ec2-spot" ProviderNameDocker = "docker" ProviderNameDockerMock = "docker-mock" ProviderNameGce = "gce" ProviderNameStatic = "static" ProviderNameOpenstack = "openstack" ProviderNameVsphere = "vsphere" ProviderNameMock = "mock" // TODO: This can be removed when no more hosts with provider ec2 are running. ProviderNameEc2Legacy = "ec2" )
cloud provider related constants
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" RepotrackerVersionRequester = "gitter_request" TriggerRequester = "trigger_request" MergeTestRequester = "merge_test" AdHocRequester = "ad_hoc" )
const ( GenerateTasksCommandName = "generate.tasks" CreateHostCommandName = "host.create" )
const ( SenderGithubStatus = SenderKey(iota) SenderEvergreenWebhook SenderSlack SenderJIRAIssue SenderJIRAComment SenderEmail SenderGithubMerge SenderCommitQueueDequeue )
const (
EnableAmboyRemoteReporting = false
)
const NameTimeFormat = "20060102150405"
NameTimeFormat is the format in which to log times like instance start time.
Variables ¶
var ( // Should be specified with -ldflags at build time BuildRevision = "" // Commandline Version String; used to control auto-updating. ClientVersion = "2019-06-12" )
var ( ConfigCollection = "admin" ConfigDocID = "global" )
var ( // Providers where hosts can be created and terminated automatically. ProviderSpawnable = []string{ ProviderNameDocker, ProviderNameEc2Legacy, ProviderNameEc2OnDemand, ProviderNameEc2Spot, ProviderNameEc2Auto, ProviderNameGce, ProviderNameOpenstack, ProviderNameVsphere, ProviderNameMock, } SystemVersionRequesterTypes = []string{ RepotrackerVersionRequester, TriggerRequester, } )
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, } // 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, HostStarting, HostProvisioning, HostProvisionFailed, } // 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 ValidPlannerVersions = []string{ PlannerVersionLegacy, PlannerVersionRevised, PlannerVersionTunable, } // Set of valid FinderSettings.Version strings that can be user set via the API ValidFinderVersions = []string{ FinderVersionLegacy, FinderVersionAlternate, FinderVersionParallel, FinderVersionPipeline, } // Set of valid Host Allocators types ValidHostAllocators = []string{ HostAllocatorDuration, HostAllocatorDeficit, HostAllocatorUtilization, } // Set of valid Task Ordering options that can be user set via the API ValidTaskOrderings = []string{ TaskOrderingNotDeclared, TaskOrderingInterleave, TaskOrderingMainlineFirst, TaskOrderingPatchFirst, } // constant arrays for db update logic AbortableStatuses = []string{TaskStarted, TaskDispatched} CompletedStatuses = []string{TaskSucceeded, TaskFailed} ValidCommandTypes = []string{CommandTypeSetup, CommandTypeSystem, CommandTypeTest} )
var ( // ContainerPool keys ContainerPoolIdKey = bsonutil.MustHaveTag(ContainerPool{}, "Id") )
nolint: megacheck, deadcode, unused
Functions ¶
func FindEvergreenHome ¶
func FindEvergreenHome() string
FindEvergreenHome finds the directory of the EVGHOME environment variable.
func IsFailedTaskStatus ¶
func IsFinishedTaskStatus ¶
func IsGitHubPatchRequester ¶
func IsPatchRequester ¶
func IsSystemActivator ¶
IsSystemActivator returns true when the task activator is Evergreen.
func SetBanner ¶
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 UpdateConfig ¶
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) ValidateAndDefault ¶
type AWSConfig ¶
type AWSConfig struct { EC2Key string `bson:"aws_id" json:"aws_id" yaml:"aws_id"` EC2Secret string `bson:"aws_secret" json:"aws_secret" yaml:"aws_secret"` S3Key string `bson:"s3_key" json:"s3_key" yaml:"s3_key"` S3Secret string `bson:"s3_secret" json:"s3_secret" yaml:"s3_secret"` Bucket string `bson:"bucket" json:"bucket" yaml:"bucket"` S3BaseURL string `bson:"s3_base_url" json:"s3_base_url" yaml:"s3_base_url"` }
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"` }
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"` Naive *NaiveAuthConfig `bson:"naive,omitempty" json:"naive" yaml:"naive"` Github *GithubAuthConfig `bson:"github,omitempty" json:"github" yaml:"github"` }
AuthConfig has a pointer to either a CrowConfig or a NaiveAuthConfig.
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 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 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 evegreen 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"` }
ContainerPool holds settings for each container pool
type ContainerPoolsConfig ¶
type ContainerPoolsConfig struct {
Pools []ContainerPool `bson:"pools" json:"pools" yaml:"pools"`
}
func (*ContainerPoolsConfig) Get ¶
func (c *ContainerPoolsConfig) Get(env Environment) error
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"`
}
DockerConfig stores auth info for Docker.
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 // 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, func(context.Context) error) // Close calls all registered closers in the environment. Close(context.Context) error }
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 holds 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 {
SSHTimeoutSeconds int64 `bson:"ssh_timeout_secs" json:"ssh_timeout_secs" yaml:"sshtimeoutseconds"`
}
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 JIRACustomFieldsByProject ¶
type JIRACustomFieldsByProject []JIRANotificationsProject
type JIRANotificationsConfig ¶
type JIRANotificationsConfig struct { // CustomFields is a map[string]map[string]string. The key of the first // map is the JIRA project (ex: EVG), the key of the second map is // the custom field name, and the inner most value is the template // for the custom field CustomFields JIRACustomFieldsByProject `bson:"custom_fields"` }
func (*JIRANotificationsConfig) Get ¶
func (c *JIRANotificationsConfig) Get(env Environment) error
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 JIRANotificationsProject ¶
type JIRANotificationsProject struct { Project string `bson:"project"` Fields []JIRANotificationsCustomField `bson:"fields"` }
type JiraConfig ¶
type JiraConfig struct { Host string `yaml:"host" bson:"host" json:"host"` Username string `yaml:"username" bson:"username" json:"username"` Password string `yaml:"password" bson:"password" json:"password"` DefaultProject string `yaml:"default_project" bson:"default_project" json:"default_project"` }
JiraConfig stores auth info for interacting with Atlassian Jira.
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 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"` }
LDAPConfig contains settings for interacting with an LDAP server.
type LogBuffering ¶
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"` }
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 NaiveAuthConfig ¶
type NaiveAuthConfig struct {
Users []*AuthUser `bson:"users" json:"users" yaml:"users"`
}
NaiveAuthConfig contains a list of AuthUsers from the settings file.
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"` 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 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 PluginConfig ¶
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 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 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"` TaskOrdering string `bson:"task_ordering" json:"task_ordering" yaml:"task_ordering"` 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"` PatchZipperFactor int `bson:"patch_zipper_factor" json:"patch_zipper_factor" mapstructure:"patch_zipper_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 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"` 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"` // 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"` 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"` 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"` 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"` 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"` Slack SlackConfig `yaml:"slack" bson:"slack" json:"slack" id:"slack"` Splunk send.SplunkConnectionInfo `yaml:"splunk" bson:"splunk" json:"splunk"` SuperUsers []string `yaml:"superusers" bson:"superusers" json:"superusers"` Triggers TriggerConfig `yaml:"triggers" bson:"triggers" json:"triggers" id:"triggers"` Ui UIConfig `yaml:"ui" bson:"ui" json:"ui" id:"ui"` }
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 ¶
GetConfig retrieves the Evergreen config document. If no document is present in the DB, it will return the defaults
func NewSettings ¶
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 (*Settings) GetGithubOauthToken ¶
func (*Settings) Validate ¶
Validate checks the settings and returns nil if the config is valid, or an error with a message explaining why otherwise.
func (*Settings) ValidateAndDefault ¶
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 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"` HttpListenAddr string `bson:"http_listen_addr" json:"http_listen_addr" yaml:"httplistenaddr"` // Secret to encrypt session storage Secret string `bson:"secret" json:"secret" yaml:"secret"` // Default project to assume when none specified, e.g. when using // the /waterfall route use this project, while /waterfall/other-project // then use `other-project` DefaultProject string `bson:"default_project" json:"default_project" yaml:"defaultproject"` // Cache results of template compilation, so you don't have to re-read files // on every request. Note that if this is true, changes to HTML templates // won't take effect until server restart. CacheTemplates bool `bson:"cache_templates" json:"cache_templates" yaml:"cachetemplates"` // CsrfKey is a 32-byte key used to generate tokens that validate UI requests CsrfKey string `bson:"csrf_key" json:"csrf_key" yaml:"csrfkey"` // CORSOrigin is the allowed CORS Origin for some UI Routes CORSOrigin string `bson:"cors_origin" json:"cors_origin" yaml:"cors_origin"` }
UIConfig holds relevant settings for the UI server.
func (*UIConfig) Get ¶
func (c *UIConfig) Get(env Environment) error
func (*UIConfig) ValidateAndDefault ¶
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
Source Files ¶
- config.go
- config_alerts_notify.go
- config_amboy.go
- config_api.go
- config_auth.go
- config_cloud.go
- config_commitqueue.go
- config_containerpools.go
- config_db.go
- config_hostinit.go
- config_jasper.go
- config_jira.go
- config_jira_notifications.go
- config_logger.go
- config_registry.go
- config_repotracker.go
- config_scheduler.go
- config_serviceflags.go
- config_slack.go
- config_triggers.go
- config_ui.go
- environment.go
- globals.go
- loggers_linux.go
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
make-tarball
Archive Provides a single "MakeTarball" function to create tar (tar.gz) archives.
|
Archive Provides a single "MakeTarball" function to create tar (tar.gz) archives. |
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 The Connector is a very large interface that defines how to access the main state of the database and data central to Evergreen's function.
|
Adding to the Connector The Connector is a very large interface that defines how to access the main state of the database and data central to Evergreen's function. |
model
Adding Models Each model is kept in the model package of the REST v2 API in its own file.
|
Adding Models Each model is kept in the model package of the REST v2 API in its own file. |
Package units contains amboy.Job definiteness for Evergreen tasks.
|
Package units contains amboy.Job definiteness for Evergreen tasks. |