Documentation ¶
Index ¶
- Constants
- Variables
- func FindEvergreenHome() string
- func GetDisplayNameForPermissionKey(permissionKey string) string
- func IsCommitQueueRequester(requester string) bool
- func IsDockerProvider(provider string) bool
- func IsEc2Provider(provider string) bool
- func IsFailedTaskStatus(status string) bool
- func IsFinishedBuildStatus(status string) bool
- func IsFinishedTaskStatus(status string) bool
- func IsFinishedVersionStatus(status string) bool
- func IsGitHubPatchRequester(requester string) bool
- func IsGitTagRequester(requester string) bool
- func IsGithubMergeQueueRequester(requester string) bool
- func IsGithubPRRequester(requester string) bool
- func IsPatchRequester(requester string) bool
- func IsSystemActivator(caller string) bool
- func IsUnstartedTaskStatus(status string) bool
- func IsValidEC2Tenancy(tenancy EC2Tenancy) bool
- func IsValidTaskEndStatus(status string) bool
- func PermissionsDisabledForTests() bool
- func SetBanner(ctx context.Context, bannerText string) error
- func SetBannerTheme(ctx context.Context, theme BannerTheme) error
- func SetEnvironment(env Environment)
- func SetServiceFlags(ctx context.Context, flags ServiceFlags) error
- func ShouldConsiderBatchtime(requester string) bool
- func UpdateConfig(ctx context.Context, config *Settings) error
- func UserRequesterToInternalRequester(requester UserRequester) string
- func ValidateSSHKey(key string) error
- type APIConfig
- type AWSClientType
- type AWSConfig
- type AWSPodConfig
- type AWSVPCConfig
- type AmboyConfig
- type AmboyDBConfig
- type AmboyNamedQueueConfig
- type AmboyRetryConfig
- type AnnotationsSettings
- type AuthConfig
- type AuthUser
- type BannerTheme
- type BetaFeatures
- type BucketConfig
- type BucketType
- type BucketsConfig
- type BuildBaronSettings
- type CedarConfig
- type ClientBinary
- type ClientConfig
- type CloudProviders
- type CommitQueueConfig
- type ConfigSection
- type ConfigSections
- type ContainerArch
- type ContainerOS
- type ContainerPool
- type ContainerPoolsConfig
- func (c *ContainerPoolsConfig) Get(ctx context.Context) error
- func (c *ContainerPoolsConfig) GetContainerPool(id string) *ContainerPool
- func (c *ContainerPoolsConfig) SectionId() string
- func (c *ContainerPoolsConfig) Set(ctx context.Context) error
- func (c *ContainerPoolsConfig) ValidateAndDefault() error
- type CreateInstallationTokenFunc
- type DBSettings
- type DockerConfig
- type EC2Key
- type EC2Tenancy
- type ECSArch
- type ECSCapacityProvider
- type ECSClusterConfig
- type ECSConfig
- type ECSOS
- type ECSWindowsVersion
- type Environment
- type GitHubCheckRunConfig
- type GithubAuthConfig
- type HostInitConfig
- type HostJasperConfig
- type JIRANotificationsConfig
- type JIRANotificationsCustomField
- type JIRANotificationsProject
- type JiraBasicAuthConfig
- type JiraConfig
- type JiraOAuth1Config
- type KanopyAuthConfig
- type LogBuffering
- type LogViewer
- type LoggerConfig
- type ModificationAction
- type ModifySpawnHostSource
- type MultiAuthConfig
- type NaiveAuthConfig
- type NewRelicConfig
- type NotifyConfig
- type OktaConfig
- type OwnerRepo
- type ParameterStoreConfig
- type ParserProjectS3Config
- type ParserProjectStorageMethod
- type PermissionLevel
- type PersistentDNSConfig
- type PluginConfig
- type PodLifecycleConfig
- type ProjectCreationConfig
- func (c *ProjectCreationConfig) Get(ctx context.Context) error
- func (c *ProjectCreationConfig) IsExceptionToRepoLimit(owner, repo string) bool
- func (*ProjectCreationConfig) SectionId() string
- func (c *ProjectCreationConfig) Set(ctx context.Context) error
- func (c *ProjectCreationConfig) ValidateAndDefault() error
- type ReadConcern
- type RepoTrackerConfig
- type RuntimeEnvironmentsConfig
- type S3Credentials
- type SESConfig
- type SSHKeyPair
- type SchedulerConfig
- type SecretsManagerConfig
- type SenderKey
- type ServiceFlags
- type Settings
- func (c *Settings) Get(ctx context.Context) error
- func (s *Settings) GetSender(ctx context.Context, env Environment) (send.Sender, error)
- func (c *Settings) SectionId() string
- func (c *Settings) Set(ctx context.Context) error
- func (settings *Settings) Validate() error
- func (c *Settings) ValidateAndDefault() error
- type SlackConfig
- type SleepScheduleConfig
- type SpawnHostConfig
- type SplunkConfig
- type Subnet
- type TaskLimitsConfig
- type TracerConfig
- type TriggerConfig
- type UIConfig
- type UserManagerInfo
- type UserRequester
- type WebHook
- type WindowsVersion
- type WriteConcern
Constants ¶
const ( ECSOSLinux = "linux" ECSOSWindows = "windows" )
const ( ECSArchAMD64 = "amd64" ECSArchARM64 = "arm64" )
const ( ECSWindowsServer2016 = "windows_server_2016" ECSWindowsServer2019 = "windows_server_2019" ECSWindowsServer2022 = "windows_server_2022" )
const ( DefaultBufferIntervalSeconds = 60 DefaultBufferTargetPerInterval = 20 )
const ( RoleCollection = "roles" ScopeCollection = "scopes" )
const ( // User is the generic user representing the Evergreen application as a // whole entity. If there's a more specific user performing an operation, // prefer to use that instead. User = "mci" GithubPatchUser = "github_pull_request" GithubMergeUser = "github_merge_queue" PeriodicBuildUser = "periodic_build_user" ParentPatchUser = "parent_patch" HostRunning = "running" HostTerminated = "terminated" HostUninitialized = "initializing" // HostBuilding is an intermediate state indicating that the intent host is // attempting to create a real host from an intent host, but has not // successfully done so yet. HostBuilding = "building" // HostBuildingFailed is a failure state indicating that an intent host was // attempting to create a host but failed during creation. Hosts that fail // to build will terminate shortly. HostBuildingFailed = "building-failed" HostStarting = "starting" HostProvisioning = "provisioning" // HostProvisionFailed is a failure state indicating that a host was // successfully created (i.e. requested from the cloud provider) but failed // while it was starting up. Hosts that fail to provisoin will terminate // shortly. HostProvisionFailed = "provision failed" HostQuarantined = "quarantined" HostDecommissioned = "decommissioned" HostStopping = "stopping" HostStopped = "stopped" HostExternalUserName = "external" // 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" // 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" // TaskStarted indicates a task is running on an agent. TaskStarted = "started" // The task statuses below indicate that a task has finished. // TaskSucceeded indicates that the task has finished and is successful. TaskSucceeded = "success" // TaskFailed indicates that the task has finished and failed. This // encompasses any task failure, regardless of the specific failure reason // which can be found in the task end details. TaskFailed = "failed" // TaskUnscheduled indicates that the task is undispatched and is not // scheduled to eventually run. This is a display status, so it's only used // in the UI. TaskUnscheduled = "unscheduled" // TaskInactive is a deprecated legacy status that used to mean that the // task was not scheduled to run. This is equivalent to the TaskUnscheduled // display status. These are not stored in the task status (although they // used to be for very old tasks) but may be still used in some outdated // pieces of code. TaskInactive = "inactive" // TaskWillRun indicates that the task is scheduled to eventually run, // unless one of its dependencies becomes unattainable. This is a display // status, so it's only used in the UI. TaskWillRun = "will-run" // All other task failure reasons other than TaskFailed are display // statuses, so they're only used in the UI. These are not stored in the // task status (although they used to be for very old tasks). TaskSystemFailed = "system-failed" TaskTestTimedOut = "test-timed-out" TaskSetupFailed = "setup-failed" // TaskAborted indicates that the task was aborted while it was running. TaskAborted = "aborted" // TaskStatusBlocked indicates that the task cannot run because it is // blocked by an unattainable dependency. This is a display status, so it's // only used in the UI. TaskStatusBlocked = "blocked" // TaskKnownIssue indicates that the task has failed and is being tracked by // a linked issue in the task annotations. This is a display status, so it's // only used in the UI. TaskKnownIssue = "known-issue" // TaskStatusPending is a special state that's used for one specific return // value. Generally do not use this status as it is neither a meaningful // status in the UI nor in the back end. TaskStatusPending = "pending" // TaskAll is not a status, but rather a UI filter indicating that it should // select all tasks regardless of their status. TaskAll = "all" // Task Command Types CommandTypeTest = "test" CommandTypeSystem = "system" CommandTypeSetup = "setup" // Task descriptions // // TaskDescriptionHeartbeat indicates that a task failed because it did not // send a heartbeat while it was running. Tasks are expected to send // periodic heartbeats back to the app server indicating the task is still // actively running, or else they are considered stale. TaskDescriptionHeartbeat = "heartbeat" // TaskDescriptionStranded indicates that a task failed because its // underlying runtime environment (i.e. container or host) encountered an // issue. For example, if a host is terminated while the task is still // running, the task is considered stranded. TaskDescriptionStranded = "stranded" // TaskDescriptionNoResults indicates that a task failed because it did not // post any test results. TaskDescriptionNoResults = "expected test results, but none attached" // TaskDescriptionResultsFailed indicates that a task failed because the // test results contained a failure. TaskDescriptionResultsFailed = "test results contained failing test" // TaskDescriptionContainerUnallocatable indicates that the reason a // container task failed is because it cannot be allocated a container. TaskDescriptionContainerUnallocatable = "container task cannot be allocated" // TaskDescriptionAborted indicates that the reason a task failed is specifically // because it was manually aborted. TaskDescriptionAborted = "aborted" // Task Statuses that are only used by the UI, event log and tests // (these may be used in old tasks as actual task statuses rather than just // task display statuses). TaskSystemUnresponse = "system-unresponsive" TaskSystemTimedOut = "system-timed-out" TaskTimedOut = "task-timed-out" TestFailedStatus = "fail" TestSilentlyFailedStatus = "silentfail" TestSkippedStatus = "skip" TestSucceededStatus = "pass" BuildStarted = "started" BuildCreated = "created" BuildFailed = "failed" BuildSucceeded = "success" VersionStarted = "started" VersionCreated = "created" VersionFailed = "failed" VersionSucceeded = "success" // VersionAborted is a display status only and not stored in the DB VersionAborted = "aborted" PushLogPushing = "pushing" PushLogSuccess = "success" HostTypeStatic = "static" MergeTestStarted = "started" MergeTestSucceeded = "succeeded" MergeTestFailed = "failed" EnqueueFailed = "failed to enqueue" // MaxAutomaticRestarts is the maximum number of automatic restarts allowed for a task MaxAutomaticRestarts = 1 // MaxTaskDispatchAttempts is the maximum number of times a task can be // dispatched before it is considered to be in a bad state. MaxTaskDispatchAttempts = 5 // maximum task priority MaxTaskPriority = 100 DisabledTaskPriority = int64(-1) // if a patch has NumTasksForLargePatch number of tasks or greater, we log to splunk for investigation NumTasksForLargePatch = 10000 DefaultEvergreenConfig = ".evergreen.yml" // Env vars EvergreenHome = "EVGHOME" MongodbURL = "MONGO_URL" MongoAWSAuthEnabled = "MONGO_AWS_AUTH" EvergreenVersionID = "EVG_VERSION_ID" EvergreenClientS3Bucket = "EVG_CLIENT_S3_BUCKET" TraceEndpoint = "TRACE_ENDPOINT" // APIServerTaskActivator represents Evergreen's internal API activator APIServerTaskActivator = "apiserver" // StepbackTaskActivator represents the activator for tasks activated // due to stepback. StepbackTaskActivator = "stepback" // CheckBlockedTasksActivator represents the activator for task deactivated // by the check blocked tasks job. CheckBlockedTasksActivator = "check-blocked-tasks-job-activator" // BuildActivator represents the activator for builds that have been // activated. BuildActivator = "build-activator" // ElapsedBuildActivator represents the activator for batch time builds // that have their batchtimes elapsed. ElapsedBuildActivator = "elapsed-build-activator" // ElapsedTaskActivator represents the activator for batch time tasks // that have their batchtimes elapsed. ElapsedTaskActivator = "elapsed-task-activator" // GenerateTasksActivator represents the activator for tasks that have been // generated by a task generator. GenerateTasksActivator = "generate-tasks-activator" // AutoRestartActivator represents the activator for tasks that have been // automatically restarted via the retry_on_failure command flag. AutoRestartActivator = "automatic_restart" // StaleContainerTaskMonitor is the special name representing the unit // responsible for monitoring container tasks that have not dispatched but // have waiting for a long time since their activation. StaleContainerTaskMonitor = "stale-container-task-monitor" // UnderwaterTaskUnscheduler is the caller associated with unscheduling // and disabling tasks older than the task.UnschedulableThreshold from // their distro queue. UnderwaterTaskUnscheduler = "underwater-task-unscheduler" // Restart Types RestartVersions = "versions" RestartTasks = "tasks" RestRoutePrefix = "rest" APIRoutePrefix = "api" APIRoutePrefixV2 = "/rest/v2" AgentMonitorTag = "agent-monitor" HostFetchTag = "host-fetch" DegradedLoggingPercent = 10 SetupScriptName = "setup.sh" TempSetupScriptName = "setup-temp.sh" PowerShellSetupScriptName = "setup.ps1" PowerShellTempSetupScriptName = "setup-temp.ps1" PlannerVersionLegacy = "legacy" PlannerVersionTunable = "tunable" 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 SpawnHostRespawns = 2 SpawnHostNoExpirationDuration = 7 * 24 * time.Hour MaxVolumeExpirationDurationHours = 24 * time.Hour * 14 UnattachedVolumeExpiration = 24 * time.Hour * 30 DefaultMaxVolumeSizePerUser = 500 DefaultUnexpirableHostsPerUser = 1 DefaultUnexpirableVolumesPerUser = 1 DefaultSleepScheduleTimeZone = "America/New_York" // 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" HostAllocatorUtilization = "utilization" HostAllocatorRoundDown = "round-down" HostAllocatorRoundUp = "round-up" HostAllocatorRoundDefault = "" HostAllocatorWaitsOverThreshFeedback = "waits-over-thresh-feedback" HostAllocatorNoFeedback = "no-feedback" HostAllocatorUseDefaultFeedback = "" HostsOverallocatedTerminate = "terminate-hosts-when-overallocated" HostsOverallocatedIgnore = "no-terminations-when-overallocated" HostsOverallocatedUseDefault = "" // CommitQueueAlias and GithubPRAlias are special aliases to specify variants and tasks for commit queue and GitHub PR patches CommitQueueAlias = "__commit_queue" GithubPRAlias = "__github" GithubChecksAlias = "__github_checks" GitTagAlias = "__git_tag" MergeTaskVariant = "commit-queue-merge" MergeTaskName = "merge-patch" MergeTaskGroup = "merge-task-group" DefaultJasperPort = 2385 GithubAppPrivateKey = "github_app_key" GithubKnownHosts = "github_known_hosts" GithubCheckRun = "github_check_run" // GitHubRetryAttempts is the github client maximum number of attempts. GitHubRetryAttempts = 3 // GitHubRetryMinDelay is the github client's minimum amount of delay before attempting another request. GithubRetryMinDelay = time.Second VSCodePort = 2021 // DefaultTaskSyncAtEndTimeout is the default timeout for task sync at the // end of a patch. DefaultTaskSyncAtEndTimeout = time.Hour DefaultShutdownWaitSeconds = 10 // HeartbeatTimeoutThreshold is the timeout for how long a task can run without sending // a heartbeat HeartbeatTimeoutThreshold = 7 * time.Minute // MaxTeardownGroupThreshold specifies the duration after which the host should no longer continue // to tear down a task group. This is set one minute longer than the agent's maxTeardownGroupTimeout. MaxTeardownGroupThreshold = 4 * time.Minute SaveGenerateTasksError = "error saving config in `generate.tasks`" TasksAlreadyGeneratedError = "generator already ran and generated tasks" KeyTooLargeToIndexError = "key too large to index" InvalidDivideInputError = "$divide only supports numeric types" // ContainerHealthDashboard is the name of the Splunk dashboard that displays // charts relating to the health of container tasks. ContainerHealthDashboard = "container task health dashboard" // PRTasksRunningDescription is the description for a GitHub PR status // indicating that there are still running tasks. PRTasksRunningDescription = "tasks are running" // HostServicePasswordExpansion is the expansion for the service password that is stored on the host, // and is meant to be set as a private variable so that it will be redacted in all logs. HostServicePasswordExpansion = "host_service_password" // RedactedValue is the value that is shown in the REST API and UI for redacted values. RedactedValue = "{REDACTED}" RedactedAfterValue = "{REDACTED_AFTER}" RedactedBeforeValue = "{REDACTED_BEFORE}" )
const ( PackageName = "github.com/evergreen-ci/evergreen" OtelAttributeMaxLength = 10000 // task otel attributes TaskIDOtelAttribute = "evergreen.task.id" TaskNameOtelAttribute = "evergreen.task.name" TaskExecutionOtelAttribute = "evergreen.task.execution" TaskStatusOtelAttribute = "evergreen.task.status" TaskFailureTypeOtelAttribute = "evergreen.task.failure_type" TaskTagsOtelAttribute = "evergreen.task.tags" // version otel attributes VersionIDOtelAttribute = "evergreen.version.id" VersionRequesterOtelAttribute = "evergreen.version.requester" VersionStatusOtelAttribute = "evergreen.version.status" VersionCreateTimeOtelAttribute = "evergreen.version.create_time" VersionStartTimeOtelAttribute = "evergreen.version.start_time" VersionFinishTimeOtelAttribute = "evergreen.version.finish_time" VersionAuthorOtelAttribute = "evergreen.version.author" VersionBranchOtelAttribute = "evergreen.version.branch" VersionMakespanSecondsOtelAttribute = "evergreen.version.makespan_seconds" VersionTimeTakenSecondsOtelAttribute = "evergreen.version.time_taken_seconds" VersionPRNumOtelAttribute = "evergreen.version.pr_num" VersionDescriptionOtelAttribute = "evergreen.version.description" // build otel attributes BuildIDOtelAttribute = "evergreen.build.id" BuildNameOtelAttribute = "evergreen.build.name" ProjectIdentifierOtelAttribute = "evergreen.project.identifier" ProjectOrgOtelAttribute = "evergreen.project.org" ProjectRepoOtelAttribute = "evergreen.project.repo" ProjectIDOtelAttribute = "evergreen.project.id" DistroIDOtelAttribute = "evergreen.distro.id" HostIDOtelAttribute = "evergreen.host.id" HostStartedByOtelAttribute = "evergreen.host.started_by" HostNoExpirationOtelAttribute = "evergreen.host.no_expiration" HostInstanceTypeOtelAttribute = "evergreen.host.instance_type" AggregationNameOtelAttribute = "db.aggregationName" )
Common OTEL constants and attribute keys
const ( UIPackage = "EVERGREEN_UI" RESTV2Package = "EVERGREEN_REST_V2" MonitorPackage = "EVERGREEN_MONITOR" )
Constants for Evergreen package names (including legacy ones).
const ( AuthTokenCookie = "mci-token" TaskHeader = "Task-Id" TaskSecretHeader = "Task-Secret" HostHeader = "Host-Id" HostSecretHeader = "Host-Secret" PodHeader = "Pod-Id" PodSecretHeader = "Pod-Secret" ContentTypeHeader = "Content-Type" ContentTypeValue = "application/json" ContentLengthHeader = "Content-Length" APIUserHeader = "Api-User" APIKeyHeader = "Api-Key" )
const ( // CredentialsCollection is the collection containing TLS credentials to // connect to a Jasper service running on a host. CredentialsCollection = "credentials" // CAName is the name of the root CA for the TLS credentials. CAName = "evergreen" )
const ( ProviderNameEc2OnDemand = "ec2-ondemand" ProviderNameEc2Fleet = "ec2-fleet" ProviderNameDocker = "docker" ProviderNameDockerMock = "docker-mock" ProviderNameStatic = "static" ProviderNameMock = "mock" // DefaultEC2Region is the default region where hosts should be spawned and // general Evergreen operations occur in AWS if no particular region is // specified. DefaultEC2Region = "us-east-1" // DefaultEBSType is Amazon's default EBS type. DefaultEBSType = "gp3" // DefaultEBSAvailabilityZone is the default availability zone for EBS // volumes. This may be a temporary default. DefaultEBSAvailabilityZone = "us-east-1a" )
Constants related to cloud providers and provider-specific settings.
const ( DefaultDatabaseURL = "mongodb://localhost:27017" DefaultDatabaseName = "mci" DefaultDatabaseWriteMode = "majority" DefaultDatabaseReadMode = "majority" DefaultAmboyDatabaseURL = "mongodb://localhost:27017" // version requester types PatchVersionRequester = "patch_request" GithubPRRequester = "github_pull_request" GitTagRequester = "git_tag_request" RepotrackerVersionRequester = "gitter_request" TriggerRequester = "trigger_request" MergeTestRequester = "merge_test" // Evergreen commit queue AdHocRequester = "ad_hoc" // periodic build GithubMergeRequester = "github_merge_request" // GitHub merge queue )
const ( GenerateTasksCommandName = "generate.tasks" HostCreateCommandName = "host.create" S3PushCommandName = "s3.push" S3PullCommandName = "s3.pull" ShellExecCommandName = "shell.exec" AttachResultsCommandName = "attach.results" AttachArtifactsCommandName = "attach.artifacts" AttachXUnitResultsCommandName = "attach.xunit_results" )
Constants for project command names.
const ( // SenderGithubStatus sends messages to GitHub like PR status updates. This // sender key logically represents all GitHub senders collectively, of which // there is one per GitHub org. SenderGithubStatus = SenderKey(iota) SenderEvergreenWebhook SenderSlack SenderJIRAIssue SenderJIRAComment SenderEmail SenderGeneric )
const ( ArchDarwinAmd64 = "darwin_amd64" ArchDarwinArm64 = "darwin_arm64" ArchLinuxPpc64le = "linux_ppc64le" ArchLinuxS390x = "linux_s390x" ArchLinuxArm64 = "linux_arm64" ArchLinuxAmd64 = "linux_amd64" ArchWindowsAmd64 = "windows_amd64" )
Recognized Evergreen agent CPU architectures, which should be in the form ${GOOS}_${GOARCH}.
const ( SuperUserResourceType = "super_user" ProjectResourceType = "project" DistroResourceType = "distro" AllProjectsScope = "all_projects" UnrestrictedProjectsScope = "unrestricted_projects" RestrictedProjectsScope = "restricted_projects" AllDistrosScope = "all_distros" )
Constants for permission scopes and resource types.
const ( BasicProjectAccessRole = "basic_project_access" BasicDistroAccessRole = "basic_distro_access" SuperUserRole = "superuser" SuperUserProjectAccessRole = "admin_project_access" SuperUserDistroAccessRole = "superuser_distro_access" )
const ( // DefaultAmboyQueueName is the default namespace prefix for the Amboy // remote queue. DefaultAmboyQueueName = "evg.service" )
const (
DevProdServiceFieldName = "customfield_24158"
)
const NameTimeFormat = "20060102150405"
NameTimeFormat is the format in which to log times like instance start time.
Variables ¶
var ( // BuildRevision should be specified with -ldflags at build time BuildRevision = "" // ClientVersion is the commandline version string used to control updating // the CLI. The format is the calendar date (YYYY-MM-DD). ClientVersion = "2024-11-07" // Agent version to control agent rollover. The format is the calendar date // (YYYY-MM-DD). AgentVersion = "2024-11-21" )
var ( AuthOktaKey = bsonutil.MustHaveTag(AuthConfig{}, "Okta") AuthGithubKey = bsonutil.MustHaveTag(AuthConfig{}, "Github") AuthNaiveKey = bsonutil.MustHaveTag(AuthConfig{}, "Naive") AuthMultiKey = bsonutil.MustHaveTag(AuthConfig{}, "Multi") AuthKanopyKey = bsonutil.MustHaveTag(AuthConfig{}, "Kanopy") AuthAllowServiceUsersKey = bsonutil.MustHaveTag(AuthConfig{}, "AllowServiceUsers") )
var ( ConfigCollection = "admin" ConfigDocID = "global" )
var ( ProjectCreationConfigTotalProjectLimitKey = bsonutil.MustHaveTag(ProjectCreationConfig{}, "TotalProjectLimit") ProjectCreationConfigRepoProjectLimitKey = bsonutil.MustHaveTag(ProjectCreationConfig{}, "RepoProjectLimit") ProjectCreationConfigRepoExceptionsKey = bsonutil.MustHaveTag(ProjectCreationConfig{}, "RepoExceptions") ProjectCreationConfigJiraProjectKey = bsonutil.MustHaveTag(ProjectCreationConfig{}, "JiraProject") )
var ( // ProviderSpawnable includes all cloud provider types where hosts can be // dynamically created and terminated according to need. This has no // relation to spawn hosts. ProviderSpawnable = []string{ ProviderNameEc2OnDemand, ProviderNameEc2Fleet, ProviderNameMock, ProviderNameDocker, } // ProviderUserSpawnable includes all cloud provider types where a user can // request a dynamically created host for purposes such as host.create and // spawn hosts. ProviderUserSpawnable = []string{ ProviderNameEc2OnDemand, ProviderNameEc2Fleet, } ProviderContainer = []string{ ProviderNameDocker, } )
var ( // SystemVersionRequesterTypes contain non-patch requesters that are created by the Evergreen system, i.e. configs and patch files are unchanged by author. SystemVersionRequesterTypes = []string{ RepotrackerVersionRequester, TriggerRequester, GitTagRequester, AdHocRequester, } AllRequesterTypes = []string{ PatchVersionRequester, GithubPRRequester, GitTagRequester, RepotrackerVersionRequester, TriggerRequester, MergeTestRequester, AdHocRequester, GithubMergeRequester, } )
var ( PatchRequesters = []string{ PatchVersionRequester, GithubPRRequester, MergeTestRequester, GithubMergeRequester, } SystemActivators = []string{ APIServerTaskActivator, BuildActivator, CheckBlockedTasksActivator, ElapsedBuildActivator, ElapsedTaskActivator, GenerateTasksActivator, } // UpHostStatus is a list of all host statuses that are considered up. UpHostStatus = []string{ HostRunning, HostUninitialized, HostBuilding, HostStarting, HostProvisioning, HostProvisionFailed, HostStopping, HostStopped, } // StoppableHostStatuses represent all host statuses when it is possible to // stop a running host. StoppableHostStatuses = []string{ HostStopped, HostStopping, HostRunning, } // StoppableHostStatuses represent all host statuses when it is possible to // start a stopped host. StartableHostStatuses = []string{ HostStopped, HostStopping, HostRunning, } StartedHostStatus = []string{ HostBuilding, HostStarting, } // ProvisioningHostStatus describes hosts that have started, // but have not yet completed the provisioning process. ProvisioningHostStatus = []string{ HostStarting, HostProvisioning, HostProvisionFailed, HostBuilding, } // 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, } // IsRunningOrWillRunStatuses includes all statuses for active hosts (see // ActiveStatus) where the host is either currently running or is making // progress towards running. IsRunningOrWillRunStatuses = []string{ HostBuilding, HostStarting, HostProvisioning, HostRunning, } // ActiveStatuses includes all where the host is alive in the cloud provider // or could be alive (e.g. for building hosts, the host is in the process of // starting up). Intent hosts have not requested a real host from the cloud // provider, so they are omitted. ActiveStatuses = []string{ HostBuilding, HostBuildingFailed, HostStarting, HostProvisioning, HostProvisionFailed, HostRunning, HostStopping, HostStopped, HostDecommissioned, HostQuarantined, } // SleepScheduleStatuses are all host statuses for which the sleep schedule // can take effect. If it's not in one of these states, the sleep schedule // does not apply. SleepScheduleStatuses = []string{ HostRunning, HostStopped, HostStopping, } // Set of host status values that can be user set via the API ValidUserSetHostStatus = []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{ 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, } ValidHostAllocatorRoundingRules = []string{ HostAllocatorRoundDown, HostAllocatorRoundUp, HostAllocatorRoundDefault, } ValidDefaultHostAllocatorRoundingRules = []string{ HostAllocatorRoundDown, HostAllocatorRoundUp, } ValidHostAllocatorFeedbackRules = []string{ HostAllocatorWaitsOverThreshFeedback, HostAllocatorNoFeedback, HostAllocatorUseDefaultFeedback, } ValidDefaultHostAllocatorFeedbackRules = []string{ HostAllocatorWaitsOverThreshFeedback, HostAllocatorNoFeedback, } ValidHostsOverallocatedRules = []string{ HostsOverallocatedUseDefault, HostsOverallocatedIgnore, HostsOverallocatedTerminate, } ValidDefaultHostsOverallocatedRules = []string{ HostsOverallocatedIgnore, HostsOverallocatedTerminate, } // TaskInProgressStatuses have been picked up by an agent but have not // finished running. TaskInProgressStatuses = []string{TaskStarted, TaskDispatched} // TaskCompletedStatuses are statuses for tasks that have finished running. // This does not include task display statuses. TaskCompletedStatuses = []string{TaskSucceeded, TaskFailed} // TaskUncompletedStatuses are all statuses that do not represent a finished state. TaskUncompletedStatuses = []string{ TaskStarted, TaskUndispatched, TaskDispatched, TaskInactive, } SyncStatuses = []string{TaskSucceeded, TaskFailed} ValidCommandTypes = []string{CommandTypeSetup, CommandTypeSystem, CommandTypeTest} // Map from valid OS/architecture combinations to display names ValidArchDisplayNames = map[string]string{ ArchWindowsAmd64: "Windows 64-bit", ArchLinuxPpc64le: "Linux PowerPC 64-bit", ArchLinuxS390x: "Linux zSeries", ArchLinuxArm64: "Linux ARM 64-bit", ArchDarwinAmd64: "OSX 64-bit", ArchDarwinArm64: "OSX ARM 64-bit", ArchLinuxAmd64: "Linux 64-bit", } )
var ( 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" PermissionGitTagVersions = "project_git_tags" PermissionTasks = "project_tasks" PermissionAnnotations = "project_task_annotations" PermissionPatches = "project_patches" PermissionLogs = "project_logs" // Distro permissions. PermissionDistroSettings = "distro_settings" PermissionHosts = "distro_hosts" )
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, } GitTagVersionsCreate = PermissionLevel{ Description: "Create versions with git tags", Value: 10, } GitTagVersionsNone = PermissionLevel{ Description: "Not able to create versions with git tags", Value: 0, } AnnotationsModify = PermissionLevel{ Description: "Modify annotations", Value: 20, } AnnotationsView = PermissionLevel{ Description: "View annotations", Value: 10, } AnnotationsNone = PermissionLevel{ Description: "No annotations permissions", Value: 0, } TasksAdmin = PermissionLevel{ Description: "Edit tasks and override dependencies", Value: 30, } TasksBasic = PermissionLevel{ Description: "Edit tasks", Value: 20, } TasksView = PermissionLevel{ Description: "View tasks", Value: 10, } TasksNone = PermissionLevel{ Description: "Not able to view or edit tasks", Value: 0, } PatchSubmitAdmin = PermissionLevel{ Description: "Submit/edit patches, and submit patches on behalf of users", Value: 20, } PatchSubmit = PermissionLevel{ Description: "Submit and edit patches", Value: 10, } PatchNone = PermissionLevel{ Description: "Not able to submit patches", Value: 0, } LogsView = PermissionLevel{ Description: "View logs", Value: 10, } LogsNone = PermissionLevel{ Description: "Not able to view logs", Value: 0, } DistroSettingsAdmin = 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, } )
Constants related to permission levels.
var AllUserRequesterTypes = []UserRequester{ PatchVersionUserRequester, GithubPRUserRequester, GitTagUserRequester, RepotrackerVersionUserRequester, TriggerUserRequester, MergeTestUserRequester, AdHocUserRequester, GithubMergeUserRequester, }
var AttachCommands = []string{ AttachResultsCommandName, AttachArtifactsCommandName, AttachXUnitResultsCommandName, }
var ( // ContainerPool keys ContainerPoolIdKey = bsonutil.MustHaveTag(ContainerPool{}, "Id") )
var DevProdJiraServiceField = map[string]string{
"id": devProdServiceId,
"value": devProdServiceValue,
}
DevProdJiraServiceField defines a required field for DEVPROD tickets, which we sometimes auto-generate. Using "Other" prevents this from getting out of sync with service naming too quickly.
var DistroPermissions = []string{ PermissionDistroSettings, PermissionHosts, }
var GeneralAccessRoles = []string{ BasicProjectAccessRole, BasicDistroAccessRole, SuperUserRole, SuperUserProjectAccessRole, SuperUserDistroAccessRole, }
Contains both general and superuser access.
var InternalAliases = []string{ CommitQueueAlias, GithubPRAlias, GithubChecksAlias, GitTagAlias, }
var (
MaxExecTimeoutSecs = bsonutil.MustHaveTag(TaskLimitsConfig{}, "MaxExecTimeoutSecs")
)
var ( // don't ever access this directly except from testutil PermissionSystemDisabled = false )
var ProjectPermissions = []string{ PermissionProjectSettings, PermissionTasks, PermissionAnnotations, PermissionPatches, PermissionGitTagVersions, PermissionLogs, }
var SuperuserPermissions = []string{ PermissionAdminSettings, PermissionProjectCreate, PermissionDistroCreate, PermissionRoleModify, }
var TaskFailureStatuses = append([]string{TaskFailed}, TaskNonGenericFailureStatuses...)
TaskFailureStatuses represent all the ways that a completed task can fail, inclusive of display statuses such as system failures.
var TaskNonGenericFailureStatuses = []string{ TaskTimedOut, TaskSystemFailed, TaskTestTimedOut, TaskSetupFailed, TaskSystemUnresponse, TaskSystemTimedOut, }
TaskNonGenericFailureStatuses represents some kind of specific abnormal failure mode. These are display statuses used in the UI.
var TaskStatuses = []string{ TaskStarted, TaskSucceeded, TaskFailed, TaskSystemFailed, TaskTestTimedOut, TaskSetupFailed, TaskAborted, TaskStatusBlocked, TaskStatusPending, TaskKnownIssue, TaskSystemUnresponse, TaskSystemTimedOut, TaskTimedOut, TaskWillRun, TaskUnscheduled, TaskUndispatched, TaskDispatched, }
var TaskSystemFailureStatuses = []string{ TaskSystemFailed, TaskSystemUnresponse, TaskSystemTimedOut, }
TaskSystemFailureStatuses contains only system failure statuses used by the UI and event logs.
var TaskUnstartedStatuses = []string{ TaskInactive, TaskUndispatched, }
var UserTriggeredOrigins = []string{ UIPackage, RESTV2Package, GithubCheckRun, }
var ValidContainerArchitectures = []ContainerArch{ArchARM64, ArchAMD64}
ValidContainerArchitectures contains all recognized container CPU architectures.
var ValidContainerOperatingSystems = []ContainerOS{LinuxOS, WindowsOS}
ValidContainerOperatingSystems contains all recognized container operating systems.
var ValidEC2Tenancies = []EC2Tenancy{EC2TenancyDefault, EC2TenancyDedicated}
ValidEC2Tenancies represents valid EC2 tenancy values.
var ValidWindowsVersions = []WindowsVersion{Windows2016, Windows2019, Windows2022}
ValidWindowsVersions contains all recognized container Windows versions.
Functions ¶
func FindEvergreenHome ¶
func FindEvergreenHome() string
FindEvergreenHome finds the directory of the EVGHOME environment variable.
func GetDisplayNameForPermissionKey ¶
GetDisplayNameForPermissionKey gets the display name associated with a permission key
func IsCommitQueueRequester ¶
func IsDockerProvider ¶
IsDockerProvider returns true if the provider is docker.
func IsEc2Provider ¶
IsEc2Provider returns true if the provider is ec2.
func IsFailedTaskStatus ¶
func IsFinishedBuildStatus ¶
func IsFinishedTaskStatus ¶
func IsFinishedVersionStatus ¶
IsFinishedVersionStatus returns true if the version or patch is true.
func IsGitHubPatchRequester ¶
func IsGitTagRequester ¶
func IsGithubPRRequester ¶
func IsPatchRequester ¶
func IsSystemActivator ¶
IsSystemActivator returns true when the task activator is Evergreen.
func IsUnstartedTaskStatus ¶
func IsValidEC2Tenancy ¶
func IsValidEC2Tenancy(tenancy EC2Tenancy) bool
IsValidEC2Tenancy returns if the given EC2 tenancy is valid.
func IsValidTaskEndStatus ¶
func PermissionsDisabledForTests ¶
func PermissionsDisabledForTests() bool
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(ctx context.Context, theme BannerTheme) error
SetBannerTheme 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(ctx context.Context, flags ServiceFlags) error
SetServiceFlags sets whether each of the runner/API server processes is enabled.
func ShouldConsiderBatchtime ¶
func UpdateConfig ¶
UpdateConfig updates all evergreen settings documents in the DB.
func UserRequesterToInternalRequester ¶
func UserRequesterToInternalRequester(requester UserRequester) string
UserRequesterToInternalRequester translates a user-facing requester type to its equivalent internal requester type.
func ValidateSSHKey ¶
ValidateSSHKey errors if the given key does not start with one of the allowed prefixes.
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"` URL string `bson:"url" json:"url" yaml:"url"` }
APIConfig holds relevant log and listener settings for the API server.
func (*APIConfig) ValidateAndDefault ¶
type AWSClientType ¶
type AWSClientType string
AWSClientType represents the different types of AWS client implementations that can be used.
const ( // AWSClientTypeMock is the mock implementation of an AWS client for testing // purposes only. This should never be used in production. AWSClientTypeMock AWSClientType = "mock" )
type AWSConfig ¶
type AWSConfig struct { // EC2Keys stored as a list to allow for possible multiple accounts in the future. EC2Keys []EC2Key `bson:"ec2_keys" json:"ec2_keys" yaml:"ec2_keys"` Subnets []Subnet `bson:"subnets" json:"subnets" yaml:"subnets"` // 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"` // ParserProject is configuration for storing and accessing parser projects // in S3. ParserProject ParserProjectS3Config `bson:"parser_project" json:"parser_project" yaml:"parser_project"` // PersistentDNS is AWS configuration for maintaining persistent DNS names for hosts. PersistentDNS PersistentDNSConfig `bson:"persistent_dns" json:"persistent_dns" yaml:"persistent_dns"` DefaultSecurityGroup string `bson:"default_security_group" json:"default_security_group" yaml:"default_security_group"` AllowedRegions []string `bson:"allowed_regions" json:"allowed_regions" yaml:"allowed_regions"` // 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"` // Pod represents configuration for using pods in AWS. Pod AWSPodConfig `bson:"pod" json:"pod" yaml:"pod"` // ParameterStore represents configuration for using AWS SSM Parameter // Store. ParameterStore ParameterStoreConfig `bson:"parameter_store" json:"parameter_store" yaml:"parameter_store"` }
AWSConfig stores auth info for Amazon Web Services.
type AWSPodConfig ¶
type AWSPodConfig struct { // Role is the role to assume to make API calls that manage pods. Role string `bson:"role" json:"role" yaml:"role"` // Region is the region where the pods are managed. Region string `bson:"region" json:"region" yaml:"region"` // ECS represents configuration for using AWS ECS to manage pods. ECS ECSConfig `bson:"ecs" json:"ecs" yaml:"ecs"` // SecretsManager represents configuration for using AWS Secrets Manager // with AWS ECS for pods. SecretsManager SecretsManagerConfig `bson:"secrets_manager" json:"secrets_manager" yaml:"secrets_manager"` }
AWSPodConfig represents configuration for using pods backed by AWS.
func (*AWSPodConfig) Validate ¶
func (c *AWSPodConfig) Validate() error
Validate checks that the ECS configuration is valid.
type AWSVPCConfig ¶
type AWSVPCConfig struct { Subnets []string `bson:"subnets" json:"subnets" yaml:"subnets"` SecurityGroups []string `bson:"security_groups" json:"security_groups" yaml:"security_groups"` }
AWSVPCConfig represents configuration when using AWSVPC networking in ECS.
type AmboyConfig ¶
type AmboyConfig struct { Name string `bson:"name" json:"name" yaml:"name"` SingleName string `bson:"single_name" json:"single_name" yaml:"single_name"` 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"` LockTimeoutMinutes int `bson:"lock_timeout_minutes" json:"lock_timeout_minutes" yaml:"lock_timeout_minutes"` SampleSize int `bson:"sample_size" json:"sample_size" yaml:"sample_size"` Retry AmboyRetryConfig `bson:"retry" json:"retry" yaml:"retry"` NamedQueues []AmboyNamedQueueConfig `bson:"named_queues" json:"named_queues" yaml:"named_queues"` // SkipPreferredIndexes indicates whether or not to use the preferred // indexes for the remote queues. This is not a value that can or should be // configured in production, but is useful to explicitly set for testing // environments, where the required indexes may not be set up. SkipPreferredIndexes bool `bson:"skip_preferred_indexes" json:"skip_preferred_indexes" yaml:"skip_preferred_indexes"` }
func (*AmboyConfig) SectionId ¶
func (c *AmboyConfig) SectionId() string
func (*AmboyConfig) ValidateAndDefault ¶
func (c *AmboyConfig) ValidateAndDefault() error
type AmboyDBConfig ¶
type AmboyDBConfig struct { URL string `bson:"url" json:"url" yaml:"url"` Database string `bson:"database" json:"database" yaml:"database"` }
AmboyDBConfig configures Amboy's database connection.
func (*AmboyDBConfig) SectionId ¶
func (c *AmboyDBConfig) SectionId() string
func (*AmboyDBConfig) ValidateAndDefault ¶
func (c *AmboyDBConfig) ValidateAndDefault() error
type AmboyNamedQueueConfig ¶
type AmboyNamedQueueConfig struct { Name string `bson:"name" json:"name" yaml:"name"` Regexp string `bson:"regexp" json:"regexp" yaml:"regexp"` NumWorkers int `bson:"num_workers" json:"num_workers" yaml:"num_workers"` SampleSize int `bson:"sample_size" json:"sample_size" yaml:"sample_size"` LockTimeoutSeconds int `bson:"lock_timeout_seconds" json:"lock_timeout_seconds" yaml:"lock_timeout_seconds"` }
AmboyNamedQueueConfig represents configuration settings for particular named queues in the Amboy queue group.
type AmboyRetryConfig ¶
type AmboyRetryConfig struct { NumWorkers int `bson:"num_workers" json:"num_workers" yaml:"num_workers"` MaxCapacity int `bson:"max_capacity" json:"max_capacity" yaml:"max_capacity"` MaxRetryAttempts int `bson:"max_retry_attempts" json:"max_retry_attempts" yaml:"max_retry_attempts"` MaxRetryTimeSeconds int `bson:"max_retry_time_seconds" json:"max_retry_time_seconds" yaml:"max_retry_time_seconds"` RetryBackoffSeconds int `bson:"retry_backoff_seconds" json:"retry_backoff_seconds" yaml:"retry_backoff_seconds"` StaleRetryingMonitorIntervalSeconds int `` /* 140-byte string literal not displayed */ }
AmboyRetryConfig represents configuration settings for Amboy's retryability feature.
func (*AmboyRetryConfig) RetryableQueueOptions ¶
func (c *AmboyRetryConfig) RetryableQueueOptions() queue.RetryableQueueOptions
type AnnotationsSettings ¶
type AnnotationsSettings struct { // the endpoint that the user would like to send data to when the file ticket button is clicked FileTicketWebhook WebHook `mapstructure:"web_hook" bson:"web_hook" json:"web_hook" yaml:"file_ticket_webhook"` }
type AuthConfig ¶
type AuthConfig struct { Okta *OktaConfig `bson:"okta,omitempty" json:"okta" yaml:"okta"` Naive *NaiveAuthConfig `bson:"naive,omitempty" json:"naive" yaml:"naive"` Github *GithubAuthConfig `bson:"github,omitempty" json:"github" yaml:"github"` Multi *MultiAuthConfig `bson:"multi" json:"multi" yaml:"multi"` Kanopy *KanopyAuthConfig `bson:"kanopy" json:"kanopy" yaml:"kanopy"` AllowServiceUsers bool `bson:"allow_service_users" json:"allow_service_users" yaml:"allow_service_users"` 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) SectionId ¶
func (c *AuthConfig) SectionId() string
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
const ( Announcement BannerTheme = "ANNOUNCEMENT" Information BannerTheme = "INFORMATION" Warning BannerTheme = "WARNING" Important BannerTheme = "IMPORTANT" Empty BannerTheme = "" )
func IsValidBannerTheme ¶
func IsValidBannerTheme(input string) (bool, BannerTheme)
type BetaFeatures ¶
type BetaFeatures struct {
SpruceWaterfallEnabled bool `bson:"spruce_waterfall_enabled" json:"spruce_waterfall_enabled"`
}
BetaFeatures represents beta tests, which may be active or inactive.
type BucketConfig ¶
type BucketConfig struct { Name string `bson:"name" json:"name" yaml:"name"` Type BucketType `bson:"type" json:"type" yaml:"type"` DBName string `bson:"db_name" json:"db_name" yaml:"db_name"` }
BucketConfig represents the admin config for an individual bucket.
type BucketType ¶
type BucketType string
const ( BucketTypeGridFS BucketType = "gridfs" BucketTypeLocal BucketType = "local" BucketTypeS3 BucketType = "s3" )
type BucketsConfig ¶
type BucketsConfig struct { LogBucket BucketConfig `bson:"log_bucket" json:"log_bucket" yaml:"log_bucket"` // Credentials for accessing the buckets. Credentials S3Credentials `bson:"credentials" json:"credentials" yaml:"credentials"` }
BucketsConfig represents the admin config section for interally-owned Evergreen data bucket storage.
func (*BucketsConfig) SectionId ¶
func (*BucketsConfig) SectionId() string
func (*BucketsConfig) ValidateAndDefault ¶
func (c *BucketsConfig) ValidateAndDefault() error
type BuildBaronSettings ¶
type BuildBaronSettings struct { TicketCreateProject string `mapstructure:"ticket_create_project" bson:"ticket_create_project" json:"ticket_create_project" yaml:"ticket_create_project"` TicketCreateIssueType string `` /* 135-byte string literal not displayed */ TicketSearchProjects []string `` /* 127-byte string literal not displayed */ // 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" json:"bf_suggestion_server" yaml:"bf_suggestion_server"` BFSuggestionUsername string `` /* 127-byte string literal not displayed */ BFSuggestionPassword string `` /* 127-byte string literal not displayed */ BFSuggestionTimeoutSecs int `` /* 143-byte string literal not displayed */ BFSuggestionFeaturesURL string `` /* 143-byte string literal not displayed */ }
type CedarConfig ¶
type CedarConfig struct { BaseURL string `bson:"base_url" json:"base_url" yaml:"base_url"` GRPCBaseURL string `bson:"grpc_base_url" json:"grpc_base_url" yaml:"grpc_base_url"` RPCPort string `bson:"rpc_port" json:"rpc_port" yaml:"rpc_port"` User string `bson:"user" json:"user" yaml:"user"` APIKey string `bson:"api_key" json:"api_key" yaml:"api_key"` // Insecure disables TLS, this should only be used for testing. Insecure bool `bson:"insecure" json:"insecure" yaml:"insecure"` // SendToCedarDisabled disables sending perf results to cedar. This will be removed when Cedar no longer handles perf results. SendToCedarDisabled bool `bson:"send_to_cedar_disabled" json:"send_to_cedar_disabled" yaml:"send_to_cedar_disabled"` // SPSURL tells Evergreen where the SPS service is. SPSURL string `bson:"sps_url" json:"sps_url" yaml:"sps_url"` // SendRatioSPS is the ratio of perf results to send to SPS. This will be removed when Cedar no longer handles perf results as all results will go to SPS. SendRatioSPS int `bson:"send_ratio_sps" json:"send_ratio_sps" yaml:"send_ratio_sps"` }
func (*CedarConfig) SectionId ¶
func (*CedarConfig) SectionId() string
func (*CedarConfig) ValidateAndDefault ¶
func (c *CedarConfig) ValidateAndDefault() error
type ClientBinary ¶
type ClientConfig ¶
type ClientConfig struct { ClientBinaries []ClientBinary LatestRevision string S3URLPrefix string }
type CloudProviders ¶
type CloudProviders struct { AWS AWSConfig `bson:"aws" json:"aws" yaml:"aws"` Docker DockerConfig `bson:"docker" json:"docker" yaml:"docker"` }
CloudProviders stores configuration settings for the supported cloud host providers.
func (*CloudProviders) SectionId ¶
func (c *CloudProviders) SectionId() string
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"` BatchSize int `yaml:"batch_size" bson:"batch_size" json:"batch_size"` }
func (*CommitQueueConfig) SectionId ¶
func (c *CommitQueueConfig) SectionId() string
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(context.Context) error // Set upserts the section document into the DB Set(context.Context) 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 the registry in config_sections.go.
type ConfigSections ¶
type ConfigSections struct {
Sections map[string]ConfigSection
}
func NewConfigSections ¶
func NewConfigSections() ConfigSections
type ContainerArch ¶
type ContainerArch string
ContainerArch represents the CPU architecture necessary to run a container.
const ( ArchARM64 ContainerArch = "arm64" ArchAMD64 ContainerArch = "x86_64" )
func (ContainerArch) Validate ¶
func (c ContainerArch) Validate() error
Validate checks that the container CPU architecture is recognized.
type ContainerOS ¶
type ContainerOS string
ContainerOS denotes the operating system of a running container.
const ( LinuxOS ContainerOS = "linux" WindowsOS ContainerOS = "windows" )
func (ContainerOS) Validate ¶
func (c ContainerOS) Validate() error
Validate checks that the container OS is recognized.
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) 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) ValidateAndDefault ¶
func (c *ContainerPoolsConfig) ValidateAndDefault() error
type DBSettings ¶
type DBSettings struct { Url string `yaml:"url"` DB string `yaml:"db"` WriteConcernSettings WriteConcern `yaml:"write_concern"` ReadConcernSettings ReadConcern `yaml:"read_concern"` AWSAuthEnabled bool `yaml:"aws_auth_enabled"` }
type DockerConfig ¶
type DockerConfig struct {
APIVersion string `bson:"api_version" json:"api_version" yaml:"api_version"`
}
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"` // this can be removed after EVG-8284 is merged 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 EC2Tenancy ¶
type EC2Tenancy string
EC2Tenancy represents the physical hardware tenancy for EC2 hosts.
const ( EC2TenancyDefault EC2Tenancy = "default" EC2TenancyDedicated EC2Tenancy = "dedicated" )
type ECSArch ¶
type ECSArch string
ECSArch represents a CPU architecture that can run containers in ECS.
type ECSCapacityProvider ¶
type ECSCapacityProvider struct { // Name is the capacity provider name. Name string `bson:"name" json:"name" yaml:"name"` // OS is the kind of OS that the container instances in this capacity // provider can run. OS ECSOS `bson:"os" json:"os" yaml:"os"` // Arch is the type of CPU architecture that the container instances in this // capacity provider can run. Arch ECSArch `bson:"arch" json:"arch" yaml:"arch"` // WindowsVersion is the particular version of Windows that container // instances in this capacity provider run. This only applies if the OS is // Windows. WindowsVersion ECSWindowsVersion `bson:"windows_version" json:"windows_version" yaml:"windows_version"` }
ECSCapacityProvider represents a capacity provider in ECS.
func (*ECSCapacityProvider) Validate ¶
func (p *ECSCapacityProvider) Validate() error
Validate checks that the required settings are given for the capacity provider.
type ECSClusterConfig ¶
type ECSClusterConfig struct { // Name is the ECS cluster name. Name string `bson:"name" json:"name" yaml:"name"` // OS is the OS of the container instances supported by the cluster. OS ECSOS `bson:"os" json:"os" yaml:"os"` }
ECSClusterConfig represents configuration specific to a particular ECS cluster.
func (*ECSClusterConfig) Validate ¶
func (c *ECSClusterConfig) Validate() error
Validate checks that the ECS cluster configuration has the required fields and all fields are valid values.
type ECSConfig ¶
type ECSConfig struct { // MaxCPU is the maximum allowed CPU units (1024 CPU units = 1 vCPU) that a // single pod can use. MaxCPU int `bson:"max_cpu" json:"max_cpu" yaml:"max_cpu"` // MaxMemoryMB is the maximum allowed memory (in MB) that a single pod can // use. MaxMemoryMB int `bson:"max_memory_mb" json:"max_memory_mb" yaml:"max_memory_mb"` // TaskDefinitionPrefix is the prefix for the task definition families. TaskDefinitionPrefix string `bson:"task_definition_prefix" json:"task_definition_prefix" yaml:"task_definition_prefix"` // TaskRole is the IAM role that ECS tasks can assume to make AWS requests. TaskRole string `bson:"task_role" json:"task_role" yaml:"task_role"` // ExecutionRole is the IAM role that ECS container instances can assume to // make AWS requests. ExecutionRole string `bson:"execution_role" json:"execution_role" yaml:"execution_role"` // LogRegion is the region used by the task definition's log configuration. LogRegion string `bson:"log_region" json:"log_region" yaml:"log_region"` // LogGroup is the log group name used by the task definition's log configuration. LogGroup string `bson:"log_group" json:"log_group" yaml:"log_group"` // LogStreamPrefix is the prefix used to determine log group stream names. LogStreamPrefix string `bson:"log_stream_prefix" json:"log_stream_prefix" yaml:"log_stream_prefix"` // AWSVPC specifies configuration when ECS tasks use AWSVPC networking. AWSVPC AWSVPCConfig `bson:"awsvpc" json:"awsvpc" yaml:"awsvpc"` // Clusters specify the configuration of each particular ECS cluster. Clusters []ECSClusterConfig `bson:"clusters" json:"clusters" yaml:"clusters"` // CapacityProviders specify the available capacity provider configurations. CapacityProviders []ECSCapacityProvider `bson:"capacity_providers" json:"capacity_providers" yaml:"capacity_providers"` // ClientType represents the type of Secrets Manager client implementation // that will be used. This is not a value that can or should be configured // for production, but is useful to explicitly set for testing purposes. ClientType AWSClientType `bson:"client_type" json:"client_type" yaml:"client_type"` // AllowedImages specifies images that are allowed to be used. AllowedImages []string `bson:"allowed_images" json:"allowed_images" yaml:"allowed_images"` }
ECSConfig represents configuration for AWS ECS.
type ECSWindowsVersion ¶
type ECSWindowsVersion string
ECSWindowsVersion represents a particular Windows OS version that can run containers in ECS.
func (ECSWindowsVersion) Validate ¶
func (v ECSWindowsVersion) Validate() error
Validate checks that the Windows OS version is a valid one for running containers.
type Environment ¶
type Environment interface { // Settings returns the cached version of the admin settings as a settings object. // The settings object is not necessarily safe for concurrent access. // Use GetConfig() to access the settings object from the DB. Settings() *Settings Context() (context.Context, context.CancelFunc) Session() db.Session ContextSession(ctx context.Context) 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 // ParameterManager returns the parameter manager that stores sensitive // secrets. ParameterManager() *parameterstore.ParameterManager SetParameterManager(pm *parameterstore.ParameterManager) // 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(context.Context) 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 // GetGitHubSender provides a grip Sender configured with the given // owner and repo information. GetGitHubSender(owner string, repo string, createInstallationToken CreateInstallationTokenFunc) (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) // ShutdownSequenceStarted is true iff the shutdown sequence has been started ShutdownSequenceStarted() bool SetShutdown() // BuildVersion returns the ID of the Evergreen version that built the binary. // Returns an empty string if the version ID isn't provided on startup. BuildVersion() string }
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, versionID, clientS3Bucket string, db *DBSettings, tp trace.TracerProvider) (Environment, error)
NewEnvironment constructs an Environment instance and initializes all essential global state, including 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 set. If both are specified, the settings are read from the file.
type GitHubCheckRunConfig ¶
type GitHubCheckRunConfig struct { // CheckRunLimit is the number of check runs that Evergreen is willing to support for each patch created by GitHub PRs. CheckRunLimit int `bson:"check_run_limit" json:"check_run_limit" yaml:"check_run_limit"` }
GitHubCheckRunConfig configures settings for the GitHub Check Run API.
func (*GitHubCheckRunConfig) Get ¶
func (c *GitHubCheckRunConfig) Get(ctx context.Context) error
Get populates the config from the database.
func (*GitHubCheckRunConfig) SectionId ¶
func (c *GitHubCheckRunConfig) SectionId() string
SectionId returns the ID of this config section.
func (*GitHubCheckRunConfig) Set ¶
func (c *GitHubCheckRunConfig) Set(ctx context.Context) error
Set sets the document in the database to match the in-memory config struct.
func (*GitHubCheckRunConfig) ValidateAndDefault ¶
func (c *GitHubCheckRunConfig) ValidateAndDefault() error
ValidateAndDefault validates the check run configuration.
type GithubAuthConfig ¶
type GithubAuthConfig struct { AppId int64 `bson:"app_id" json:"app_id" yaml:"app_id"` ClientId string `bson:"client_id" json:"client_id" yaml:"client_id"` ClientSecret string `bson:"client_secret" json:"client_secret" yaml:"client_secret"` DefaultOwner string `bson:"default_owner" json:"default_owner" yaml:"default_owner"` DefaultRepo string `bson:"default_repo" json:"default_repo" yaml:"default_repo"` Organization string `bson:"organization" json:"organization" yaml:"organization"` Users []string `bson:"users" json:"users" yaml:"users"` }
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"` MaxTotalDynamicHosts int `bson:"max_total_dynamic_hosts" json:"max_total_dynamic_hosts" yaml:"max_total_dynamic_hosts"` }
HostInitConfig holds logging settings for the hostinit process.
func (*HostInitConfig) SectionId ¶
func (c *HostInitConfig) SectionId() string
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) SectionId ¶
func (c *HostJasperConfig) SectionId() string
func (*HostJasperConfig) ValidateAndDefault ¶
func (c *HostJasperConfig) ValidateAndDefault() error
type JIRANotificationsConfig ¶
type JIRANotificationsConfig struct {
CustomFields []JIRANotificationsProject `bson:"custom_fields"`
}
func (*JIRANotificationsConfig) Get ¶
func (c *JIRANotificationsConfig) Get(ctx context.Context) error
func (*JIRANotificationsConfig) SectionId ¶
func (c *JIRANotificationsConfig) SectionId() string
func (*JIRANotificationsConfig) Set ¶
func (c *JIRANotificationsConfig) Set(ctx context.Context) error
func (*JIRANotificationsConfig) ValidateAndDefault ¶
func (c *JIRANotificationsConfig) ValidateAndDefault() error
type JIRANotificationsProject ¶
type JIRANotificationsProject struct { Project string `bson:"project"` Fields []JIRANotificationsCustomField `bson:"fields"` Components []string `bson:"components"` Labels []string `bson:"labels"` }
type JiraBasicAuthConfig ¶
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"` Email string `yaml:"email" bson:"email" json:"email"` }
JiraConfig stores auth info for interacting with Atlassian Jira.
func (JiraConfig) Export ¶
func (c JiraConfig) Export() *send.JiraOptions
func (JiraConfig) GetHostURL ¶
func (c JiraConfig) GetHostURL() string
func (*JiraConfig) SectionId ¶
func (c *JiraConfig) SectionId() string
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 KanopyAuthConfig ¶
type KanopyAuthConfig struct { // HeaderName is the name of the header that contains the JWT with information about the user. HeaderName string `bson:"header_name" json:"header_name" yaml:"header_name"` // Issuer is the expected issuer of the JWT. JWT Validation fails if the JWT's issuer field // does not match the Issuer provided. Issuer string `bson:"issuer" json:"issuer" yaml:"issuer"` // KeysetURL is the URL for the remote keyset, or JWKS, used to validate the signing of the JWT. KeysetURL string `bson:"keyset_url" json:"keyset_url" yaml:"keyset_url"` }
KanopyAuthConfig configures the auth method that validates and consumes the JWT that Kanopy provides with information about the user. Kanopy deals with authentication so all we need to do is extract the information they provide about the user.
type LogBuffering ¶
type LogBuffering struct { UseAsync bool `bson:"use_async" json:"use_async" yaml:"use_async"` DurationSeconds int `bson:"duration_seconds" json:"duration_seconds" yaml:"duration_seconds"` Count int `bson:"count" json:"count" yaml:"count"` IncomingBufferFactor int `bson:"incoming_buffer_factor" json:"incoming_buffer_factor" yaml:"incoming_buffer_factor"` }
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"` RedactKeys []string `bson:"redact_keys" json:"redact_keys" yaml:"redact_keys"` }
func (LoggerConfig) Info ¶
func (c LoggerConfig) Info() send.LevelInfo
func (*LoggerConfig) SectionId ¶
func (c *LoggerConfig) SectionId() string
func (*LoggerConfig) ValidateAndDefault ¶
func (c *LoggerConfig) ValidateAndDefault() error
type ModificationAction ¶
type ModificationAction string
const ( RestartAction ModificationAction = "restart" SetActiveAction ModificationAction = "set_active" SetPriorityAction ModificationAction = "set_priority" AbortAction ModificationAction = "abort" )
type ModifySpawnHostSource ¶
type ModifySpawnHostSource string
ModifySpawnHostSource determines the originating source of a spawn host modification.
const ( // ModifySpawnHostManual means the spawn host is being modified manually // because a user requested it. ModifySpawnHostManual ModifySpawnHostSource = "manual" // ModifySpawnHostManual means the spawn host is being modified by the // automatic sleep schedule. ModifySpawnHostSleepSchedule ModifySpawnHostSource = "sleep_schedule" )
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) SectionId ¶
func (c *NewRelicConfig) SectionId() string
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"` SES SESConfig `bson:"ses" json:"ses" yaml:"ses"` }
NotifyConfig hold logging and email settings for the notify package.
func (*NotifyConfig) SectionId ¶
func (c *NotifyConfig) SectionId() string
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"` Scopes []string `bson:"scopes" json:"scopes" yaml:"scopes"` 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 ParameterStoreConfig ¶
type ParameterStoreConfig struct { // Prefix is the Parameter Store path prefix for the Evergreen application. Prefix string `bson:"prefix" json:"prefix" yaml:"prefix"` }
ParameterStoreConfig stores configuration for using SSM Parameter Store.
type ParserProjectS3Config ¶
type ParserProjectS3Config struct { S3Credentials `bson:",inline" yaml:",inline"` Prefix string `bson:"prefix" json:"prefix" yaml:"prefix"` // GeneratedJSONPrefix is the prefix to use for storing intermediate // JSON configuration for generate.tasks, which will update the parser // project. GeneratedJSONPrefix string `bson:"generated_json_prefix" json:"generated_json_prefix" yaml:"generated_json_prefix"` }
ParserProjectS3Config is the configuration options for storing and accessing parser projects in S3.
func (*ParserProjectS3Config) Validate ¶
func (c *ParserProjectS3Config) Validate() error
type ParserProjectStorageMethod ¶
type ParserProjectStorageMethod string
ParserProjectStorageMethod represents a means to store the parser project.
const ( // ProjectStorageMethodDB indicates that the parser project is stored as a // single document in a DB collection. ProjectStorageMethodDB ParserProjectStorageMethod = "db" // ProjectStorageMethodS3 indicates that the parser project is stored as a // single object in S3. ProjectStorageMethodS3 ParserProjectStorageMethod = "s3" )
type PermissionLevel ¶
func GetPermissionLevelsForPermissionKey ¶
func GetPermissionLevelsForPermissionKey(permissionKey string) []PermissionLevel
GetPermissionLevelsForPermissionKey gets all permissions associated with a permission key
type PersistentDNSConfig ¶
type PersistentDNSConfig struct { // HostedZoneID is the ID of the hosted zone in Route 53 where DNS names are // managed. HostedZoneID string `bson:"hosted_zone_id" json:"hosted_zone_id" yaml:"hosted_zone_id"` // Domain is the domain name of persistent DNS names. Domain string `bson:"domain" json:"domain" yaml:"domain"` }
PersistentDNSConfig is the configuration options to support persistent DNS names for hosts.
type PluginConfig ¶
PluginConfig holds plugin-specific settings, which are handled. manually by their respective plugins
type PodLifecycleConfig ¶
type PodLifecycleConfig struct { MaxParallelPodRequests int `bson:"max_parallel_pod_requests" json:"max_parallel_pod_requests" yaml:"max_parallel_pod_requests"` MaxPodDefinitionCleanupRate int `bson:"max_pod_definition_cleanup_rate" json:"max_pod_definition_cleanup_rate" yam:"max_pod_definition_cleanup_rate"` MaxSecretCleanupRate int `bson:"max_secret_cleanup_rate" json:"max_secret_cleanup_rate" yaml:"max_secret_cleanup_rate"` }
PodLifecycleConfig holds logging settings for the pod init process.
func (*PodLifecycleConfig) SectionId ¶
func (c *PodLifecycleConfig) SectionId() string
func (*PodLifecycleConfig) ValidateAndDefault ¶
func (c *PodLifecycleConfig) ValidateAndDefault() error
type ProjectCreationConfig ¶
type ProjectCreationConfig struct { // TotalProjectLimit is the total number of projects that Evergreen is willing to support TotalProjectLimit int `bson:"total_project_limit" json:"total_project_limit" yaml:"total_project_limit"` // RepoProjectLimit is the number of projects that Evergreen will allow each repo to have RepoProjectLimit int `bson:"repo_project_limit" json:"repo_project_limit" yaml:"repo_project_limit"` // RepoExceptions is a list of repos that can override the default repo-project limit but not the total project limit RepoExceptions []OwnerRepo `bson:"repo_exceptions,omitempty" json:"repo_exceptions" yaml:"repo_exceptions"` // JiraProject is the project that will be used to create Jira tickets to request S3 credentials JiraProject string `bson:"jira_project,omitempty" json:"jira_project" yaml:"jira_project"` }
func (*ProjectCreationConfig) IsExceptionToRepoLimit ¶
func (c *ProjectCreationConfig) IsExceptionToRepoLimit(owner, repo string) bool
IsExceptionToRepoLimit returns bool if the given owner repo combination has been specified as an exception in admin settings
func (*ProjectCreationConfig) SectionId ¶
func (*ProjectCreationConfig) SectionId() string
func (*ProjectCreationConfig) ValidateAndDefault ¶
func (c *ProjectCreationConfig) ValidateAndDefault() error
type ReadConcern ¶
type ReadConcern struct {
Level string `yaml:"level"`
}
func (ReadConcern) Resolve ¶
func (rc ReadConcern) Resolve() *readconcern.ReadConcern
type RepoTrackerConfig ¶
type RepoTrackerConfig struct { NumNewRepoRevisionsToFetch int `bson:"revs_to_fetch" json:"revs_to_fetch" yaml:"revs_to_fetch"` MaxRepoRevisionsToSearch int `bson:"max_revs_to_search" json:"max_revs_to_search" yaml:"max_revs_to_search"` MaxConcurrentRequests int `bson:"max_con_requests" json:"max_con_requests" yaml:"max_concurrent_requests"` }
RepoTrackerConfig holds settings for polling project repositories.
func (*RepoTrackerConfig) SectionId ¶
func (c *RepoTrackerConfig) SectionId() string
func (*RepoTrackerConfig) ValidateAndDefault ¶
func (c *RepoTrackerConfig) ValidateAndDefault() error
type RuntimeEnvironmentsConfig ¶
type RuntimeEnvironmentsConfig struct { BaseURL string `yaml:"base_url" bson:"base_url" json:"base_url"` APIKey string `yaml:"api_key" bson:"api_key" json:"api_key"` }
func (*RuntimeEnvironmentsConfig) Get ¶
func (c *RuntimeEnvironmentsConfig) Get(ctx context.Context) error
func (*RuntimeEnvironmentsConfig) SectionId ¶
func (*RuntimeEnvironmentsConfig) SectionId() string
func (*RuntimeEnvironmentsConfig) Set ¶
func (c *RuntimeEnvironmentsConfig) Set(ctx context.Context) error
func (*RuntimeEnvironmentsConfig) ValidateAndDefault ¶
func (c *RuntimeEnvironmentsConfig) 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 SESConfig ¶
type SESConfig struct {
SenderAddress string `bson:"sender_address" json:"sender_address" yaml:"sender_address"`
}
SESConfig configures the SES email sender.
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"` HostAllocatorRoundingRule string `bson:"host_allocator_rounding_rule" json:"host_allocator_rounding_rule" mapstructure:"host_allocator_rounding_rule"` HostAllocatorFeedbackRule string `bson:"host_allocator_feedback_rule" json:"host_allocator_feedback_rule" mapstructure:"host_allocator_feedback_rule"` HostsOverallocatedRule string `bson:"hosts_overallocated_rule" json:"hosts_overallocated_rule" mapstructure:"hosts_overallocated_rule"` FutureHostFraction 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"` GenerateTaskFactor int64 `bson:"generate_task_factor" json:"generate_task_factor" mapstructure:"generate_task_factor"` NumDependentsFactor float64 `bson:"num_dependents_factor" json:"num_dependents_factor" mapstructure:"num_dependents_factor"` StepbackTaskFactor int64 `bson:"stepback_task_factor" json:"stepback_task_factor" mapstructure:"stepback_task_factor"` }
SchedulerConfig holds relevant settings for the scheduler process.
func (*SchedulerConfig) SectionId ¶
func (c *SchedulerConfig) SectionId() string
func (*SchedulerConfig) ValidateAndDefault ¶
func (c *SchedulerConfig) ValidateAndDefault() error
type SecretsManagerConfig ¶
type SecretsManagerConfig struct { // SecretPrefix is the prefix for secret names. SecretPrefix string `bson:"secret_prefix" json:"secret_prefix" yaml:"secret_prefix"` // ClientType represents the type of Secrets Manager client implementation // that will be used. This is not a value that can or should be configured // for production, but is useful to explicitly set for testing purposes. ClientType AWSClientType `bson:"client_type" json:"client_type" yaml:"client_type"` }
SecretsManagerConfig represents configuration for AWS Secrets Manager.
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"` PodInitDisabled bool `bson:"pod_init_disabled" json:"pod_init_disabled"` LargeParserProjectsDisabled bool `bson:"large_parser_projects_disabled" json:"large_parser_projects_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"` CheckBlockedTasksDisabled bool `bson:"check_blocked_tasks_disabled" json:"check_blocked_tasks_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"` TaskReliabilityDisabled bool `bson:"task_reliability_disabled" json:"task_reliability_disabled"` CommitQueueDisabled bool `bson:"commit_queue_disabled" json:"commit_queue_disabled"` HostAllocatorDisabled bool `bson:"host_allocator_disabled" json:"host_allocator_disabled"` PodAllocatorDisabled bool `bson:"pod_allocator_disabled" json:"pod_allocator_disabled"` UnrecognizedPodCleanupDisabled bool `bson:"unrecognized_pod_cleanup_disabled" json:"unrecognized_pod_cleanup_disabled"` BackgroundReauthDisabled bool `bson:"background_reauth_disabled" json:"background_reauth_disabled"` BackgroundCleanupDisabled bool `bson:"background_cleanup_disabled" json:"background_cleanup_disabled"` CloudCleanupDisabled bool `bson:"cloud_cleanup_disabled" json:"cloud_cleanup_disabled"` GlobalGitHubTokenDisabled bool `bson:"global_github_token_disabled" json:"global_github_token_disabled"` SleepScheduleDisabled bool `bson:"sleep_schedule_disabled" json:"sleep_schedule_disabled"` SystemFailedTaskRestartDisabled bool `bson:"system_failed_task_restart_disabled" json:"system_failed_task_restart_disabled"` CPUDegradedModeDisabled bool `bson:"cpu_degraded_mode_disabled" json:"cpu_degraded_mode_disabled"` ParameterStoreDisabled bool `bson:"parameter_store_disabled" json:"parameter_store_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(ctx context.Context) (*ServiceFlags, error)
func (*ServiceFlags) SectionId ¶
func (c *ServiceFlags) SectionId() string
func (*ServiceFlags) ValidateAndDefault ¶
func (c *ServiceFlags) ValidateAndDefault() error
type Settings ¶
type Settings struct { Id string `bson:"_id" json:"id" yaml:"id"` Amboy AmboyConfig `yaml:"amboy" bson:"amboy" json:"amboy" id:"amboy"` AmboyDB AmboyDBConfig `yaml:"amboy_db" bson:"amboy_db" json:"amboy_db" id:"amboy_db"` Api APIConfig `yaml:"api" bson:"api" json:"api" id:"api"` AuthConfig AuthConfig `yaml:"auth" bson:"auth" json:"auth" id:"auth"` AWSInstanceRole string `yaml:"aws_instance_role" bson:"aws_instance_role" json:"aws_instance_role"` Banner string `bson:"banner" json:"banner" yaml:"banner"` BannerTheme BannerTheme `bson:"banner_theme" json:"banner_theme" yaml:"banner_theme"` Buckets BucketsConfig `bson:"buckets" json:"buckets" yaml:"buckets" id:"buckets"` Cedar CedarConfig `bson:"cedar" json:"cedar" yaml:"cedar" id:"cedar"` 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"` 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"` DisabledGQLQueries []string `yaml:"disabled_gql_queries" bson:"disabled_gql_queries" json:"disabled_gql_queries"` 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"` KanopySSHKeyPath string `yaml:"kanopy_ssh_key_path" bson:"kanopy_ssh_key_path" json:"kanopy_ssh_key_path"` 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"` PodLifecycle PodLifecycleConfig `yaml:"pod_lifecycle" bson:"pod_lifecycle" json:"pod_lifecycle" id:"pod_lifecycle"` PprofPort string `yaml:"pprof_port" bson:"pprof_port" json:"pprof_port"` ProjectCreation ProjectCreationConfig `yaml:"project_creation" bson:"project_creation" json:"project_creation" id:"project_creation"` Providers CloudProviders `yaml:"providers" bson:"providers" json:"providers" id:"providers"` RepoTracker RepoTrackerConfig `yaml:"repotracker" bson:"repotracker" json:"repotracker" id:"repotracker"` RuntimeEnvironments RuntimeEnvironmentsConfig `yaml:"runtime_environments" bson:"runtime_environments" json:"runtime_environments" id:"runtime_environments"` 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"` SleepSchedule SleepScheduleConfig `yaml:"sleep_schedule" bson:"sleep_schedule" json:"sleep_schedule" id:"sleep_schedule"` Splunk SplunkConfig `yaml:"splunk" bson:"splunk" json:"splunk" id:"splunk"` TaskLimits TaskLimitsConfig `yaml:"task_limits" bson:"task_limits" json:"task_limits" id:"task_limits"` 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"` ShutdownWaitSeconds int `yaml:"shutdown_wait_seconds" bson:"shutdown_wait_seconds" json:"shutdown_wait_seconds"` Tracer TracerConfig `yaml:"tracer" bson:"tracer" json:"tracer" id:"tracer"` GitHubCheckRun GitHubCheckRunConfig `yaml:"github_check_run" bson:"github_check_run" json:"github_check_run" id:"github_check_run"` }
Settings contains all configuration settings for running Evergreen. Settings with the "id" struct tag should implement the ConfigSection interface.
func GetConfig ¶
GetConfig returns the complete Evergreen configuration which is comprised of the shared configuration from the config database with overrides from the local ConfigCollection collection. Use GetSharedConfig to get a configuration that reflects only the shared configuration.
func GetSharedConfig ¶
GetSharedConfig returns only the Evergreen configuration which is shared among all instances reading from a single shared database. Use GetConfig to get a complete configuration that includes overrides from the local database.
func NewSettings ¶
NewSettings builds an in-memory representation of the given settings file.
func (*Settings) GetSender ¶
GetSender returns the global application-wide loggers. These are special universal loggers (distinct from other senders like the GitHub status sender or email notification sender) and will be used when grip is invoked to log messages in the application (e.g. grip.Info, grip.Error, etc). Because these loggers are the main way to send logs in the application, these are essential to monitoring the application and therefore have to be set up very early during application startup.
func (*Settings) Set ¶
Set saves the global fields in the configuration (i.e. those that are not ConfigSections).
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"` Name string `bson:"name" json:"name" yaml:"name"` }
func (*SlackConfig) SectionId ¶
func (c *SlackConfig) SectionId() string
func (*SlackConfig) ValidateAndDefault ¶
func (c *SlackConfig) ValidateAndDefault() error
type SleepScheduleConfig ¶
type SleepScheduleConfig struct {
PermanentlyExemptHosts []string `bson:"permanently_exempt_hosts" json:"permanently_exempt_hosts"`
}
SleepScheduleConfig holds relevant settings for unexpirable host sleep schedules.
func (*SleepScheduleConfig) SectionId ¶
func (c *SleepScheduleConfig) SectionId() string
func (*SleepScheduleConfig) ValidateAndDefault ¶
func (c *SleepScheduleConfig) 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) SectionId ¶
func (c *SpawnHostConfig) SectionId() string
func (*SpawnHostConfig) ValidateAndDefault ¶
func (c *SpawnHostConfig) ValidateAndDefault() error
type SplunkConfig ¶
type SplunkConfig struct {
SplunkConnectionInfo send.SplunkConnectionInfo `bson:",inline" json:"splunk_connection_info" yaml:"splunk_connection_info"`
}
func (*SplunkConfig) SectionId ¶
func (c *SplunkConfig) SectionId() string
func (*SplunkConfig) ValidateAndDefault ¶
func (c *SplunkConfig) ValidateAndDefault() error
type TaskLimitsConfig ¶
type TaskLimitsConfig struct { // MaxTasksPerVersion is the maximum number of tasks that a single version // can have. MaxTasksPerVersion int `bson:"max_tasks_per_version" json:"max_tasks_per_version" yaml:"max_tasks_per_version"` // MaxIncludesPerVersion is the maximum number of includes that a single // version can have. MaxIncludesPerVersion int `bson:"max_includes_per_version" json:"max_includes_per_version" yaml:"max_includes_per_version"` // MaxHourlyPatchTasks is the maximum number of patch tasks a single user can // schedule per hour. MaxHourlyPatchTasks int `bson:"max_hourly_patch_tasks" json:"max_hourly_patch_tasks" yaml:"max_hourly_patch_tasks"` // MaxPendingGeneratedTasks is the maximum number of tasks that can be created // by all generated task at once. MaxPendingGeneratedTasks int `bson:"max_pending_generated_tasks" json:"max_pending_generated_tasks" yaml:"max_pending_generated_tasks"` // MaxGenerateTaskJSONSize is the maximum size of a JSON file in MB that can be specified in the GenerateTasks command. MaxGenerateTaskJSONSize int `bson:"max_generate_task_json_size" json:"max_generate_task_json_size" yaml:"max_generate_task_json_size"` // MaxConcurrentLargeParserProjectTasks is the maximum number of tasks with parser projects stored in S3 that can be running at once. MaxConcurrentLargeParserProjectTasks int `` /* 146-byte string literal not displayed */ // MaxDegradedModeConcurrentLargeParserProjectTasks is the maximum number of tasks with parser projects stored in S3 that can be running at once during CPU degraded mode. MaxDegradedModeConcurrentLargeParserProjectTasks int `` /* 188-byte string literal not displayed */ // MaxDegradedModeParserProjectSize is the maximum parser project size in MB during CPU degraded mode. MaxDegradedModeParserProjectSize int `` /* 134-byte string literal not displayed */ // MaxParserProjectSize is the maximum allowed size in MB for parser projects that are stored in S3. MaxParserProjectSize int `bson:"max_parser_project_size" json:"max_parser_project_size" yaml:"max_parser_project_size"` // MaxExecTimeoutSecs is the maximum number of seconds a task can run and set their timeout to. MaxExecTimeoutSecs int `bson:"max_exec_timeout_secs" json:"max_exec_timeout_secs" yaml:"max_exec_timeout_secs"` // MaxTaskExecution is the maximum task (zero based) execution number. MaxTaskExecution int `bson:"max_task_execution" json:"max_task_execution" yaml:"max_task_execution"` // MaxDailyAutomaticRestarts is the maximum number of times a project can automatically restart a task within a 24-hour period. MaxDailyAutomaticRestarts int `bson:"max_daily_automatic_restarts" json:"max_daily_automatic_restarts" yaml:"max_daily_automatic_restarts"` }
TaskLimitsConfig holds relevant settings for Evergreen task limitations. These are usually protections against inputs that can cause issues like service instability.
func (*TaskLimitsConfig) SectionId ¶
func (c *TaskLimitsConfig) SectionId() string
func (*TaskLimitsConfig) ValidateAndDefault ¶
func (c *TaskLimitsConfig) ValidateAndDefault() error
type TracerConfig ¶
type TracerConfig struct { Enabled bool `yaml:"enabled" bson:"enabled" json:"enabled"` CollectorEndpoint string `yaml:"collector_endpoint" bson:"collector_endpoint" json:"collector_endpoint"` CollectorAPIKey string `yaml:"collector_api_key" bson:"collector_api_key" json:"collector_api_key"` CollectorInternalEndpoint string `yaml:"collector_internal_endpoint" bson:"collector_internal_endpoint" json:"collector_internal_endpoint"` }
TracerConfig configures the OpenTelemetry tracer provider. If not enabled traces will not be sent.
func (*TracerConfig) Get ¶
func (c *TracerConfig) Get(ctx context.Context) error
Get populates the config from the database.
func (*TracerConfig) SectionId ¶
func (c *TracerConfig) SectionId() string
SectionId returns the ID of this config section.
func (*TracerConfig) Set ¶
func (c *TracerConfig) Set(ctx context.Context) error
Set sets the document in the database to match the in-memory config struct.
func (*TracerConfig) ValidateAndDefault ¶
func (c *TracerConfig) ValidateAndDefault() error
ValidateAndDefault validates the tracer configuration.
type TriggerConfig ¶
type TriggerConfig struct {
GenerateTaskDistro string `bson:"generate_distro" json:"generate_distro" yaml:"generate_distro"`
}
func (*TriggerConfig) SectionId ¶
func (c *TriggerConfig) SectionId() string
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"` ParsleyUrl string `bson:"parsley_url" json:"parsley_url" yaml:"parsley_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 FileStreamingContentTypes []string `bson:"file_streaming_content_types" json:"file_streaming_content_types" yaml:"file_streaming_content_types"` // allowed content types for the file streaming route. LoginDomain string `bson:"login_domain" json:"login_domain" yaml:"login_domain"` // domain for the login cookie (defaults to domain of app) UserVoice string `bson:"userVoice" json:"userVoice" yaml:"userVoice"` BetaFeatures BetaFeatures `bson:"beta_features" json:"beta_features" yaml:"beta_features"` }
UIConfig holds relevant settings for the UI server.
func (*UIConfig) ValidateAndDefault ¶
type UserManagerInfo ¶
type UserManagerInfo struct { CanClearTokens 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 UserRequester ¶
type UserRequester string
UserRequester represents the allowed user-facing requester types.
const ( // User-facing requester types. These are equivalent in meaning to the above // requesters, but are more user-friendly. These should only be used for // user-facing functionality such as YAML configuration and expansions and // should be translated into the true internal requester types so they're // actually usable. PatchVersionUserRequester UserRequester = "patch" GithubPRUserRequester UserRequester = "github_pr" GitTagUserRequester UserRequester = "github_tag" RepotrackerVersionUserRequester UserRequester = "commit" TriggerUserRequester UserRequester = "trigger" MergeTestUserRequester UserRequester = "commit_queue" AdHocUserRequester UserRequester = "ad_hoc" GithubMergeUserRequester UserRequester = "github_merge_queue" )
func InternalRequesterToUserRequester ¶
func InternalRequesterToUserRequester(requester string) UserRequester
InternalRequesterToUserRequester translates an internal requester type to a user-facing requester type.
func (UserRequester) Validate ¶
func (r UserRequester) Validate() error
Validate checks that the user-facing requester type is valid.
type WindowsVersion ¶
type WindowsVersion string
WindowsVersion specifies the compatibility version of Windows that is required for the container to run.
const ( Windows2022 WindowsVersion = "2022" Windows2019 WindowsVersion = "2019" Windows2016 WindowsVersion = "2016" )
func (WindowsVersion) Validate ¶
func (w WindowsVersion) Validate() error
Validate checks that the container Windows version is recognized.
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_amboy.go
- config_amboy_db.go
- config_api.go
- config_auth.go
- config_bucket.go
- config_cedar.go
- config_cloud.go
- config_commitqueue.go
- config_containerpools.go
- config_db.go
- config_github_check_run.go
- config_hostinit.go
- config_jasper.go
- config_jira.go
- config_jira_notifications.go
- config_logger.go
- config_newrelic.go
- config_notify.go
- config_pod_lifecycle.go
- config_project_creation.go
- config_repotracker.go
- config_runtime_environments.go
- config_scheduler.go
- config_sections.go
- config_serviceflags.go
- config_slack.go
- config_sleep_schedule.go
- config_spawnhost.go
- config_splunk.go
- config_task_limits.go
- config_tracer.go
- config_triggers.go
- config_ui.go
- environment.go
- globals.go
- loggers_linux.go
Directories ¶
Path | Synopsis |
---|---|
Package agent runs tasks on differents runtime environments, such as hosts and containers.
|
Package agent runs tasks on differents runtime environments, such as hosts and containers. |
command
Package command defines the behavior of commands invoked by project configuration files.
|
Package command defines the behavior of commands invoked by project configuration files. |
internal/taskoutput
Task Output Directory
|
Task Output Directory |
util
Package util provides utility methods for the agent.
|
Package util provides utility methods for the agent. |
Package api provides common functions used by the service and graphql packages.
|
Package api provides common functions used by the service and graphql packages. |
Package apimodels provides models used across multiple packages by the REST API.
|
Package apimodels provides models used across multiple packages by the REST API. |
Package auth defines how Evergreen users authenticate to various authentication back ends.
|
Package auth defines how Evergreen users authenticate to various authentication back ends. |
Package cloud handles interactions with third-party cloud providers.
|
Package cloud handles interactions with third-party cloud providers. |
parameterstore
Package parameterstore provides interfaces to interact with parameters (including sensitive secrets) stored in AWS Systems Manager Parameter Store.
|
Package parameterstore provides interfaces to interact with parameters (including sensitive secrets) stored in AWS Systems Manager Parameter Store. |
parameterstore/fakeparameter
Package fakeparameter contains the data model and helpers for testing code that uses Parameter Store.
|
Package fakeparameter contains the data model and helpers for testing code that uses Parameter Store. |
cmd
|
|
make-tarball
Archive
|
Archive |
sign-executable
Module
|
|
Package db manages Evergreen's interaction with the database.
|
Package db manages Evergreen's interaction with the database. |
mgo
Package mgo provides support for Evergreen's remaining usages of the legacy MongoDB driver gopkg.in/mgo.v2.
|
Package mgo provides support for Evergreen's remaining usages of the legacy MongoDB driver gopkg.in/mgo.v2. |
mgo/bson
Package bson is an implementation of the BSON specification for Go:
|
Package bson is an implementation of the BSON specification for Go: |
mgo/internal/json
Package json implements encoding and decoding of JSON as defined in RFC 4627.
|
Package json implements encoding and decoding of JSON as defined in RFC 4627. |
Package graphql provides Evergreen's GraphQL back end.
|
Package graphql provides Evergreen's GraphQL back end. |
Package mock provides a mock environment for testing.
|
Package mock provides a mock environment for testing. |
Package model defines Evergreen's data model.
|
Package model defines Evergreen's data model. |
alertrecord
Package alertrecord contains complex alert types, like the first failure in a version.
|
Package alertrecord contains complex alert types, like the first failure in a version. |
annotations
Package annotations defines a data model for a feature that allows users to add metadata to tasks.
|
Package annotations defines a data model for a feature that allows users to add metadata to tasks. |
artifact
Package artifact models links to files created during task execution.
|
Package artifact models links to files created during task execution. |
build
Package build models a build, a set of tasks that run on a variant.
|
Package build models a build, a set of tasks that run on a variant. |
commitqueue
Package commitqueue models the commit queue, which merges code automatically after testing.
|
Package commitqueue models the commit queue, which merges code automatically after testing. |
distro
Package distro models an environment configuration for a host.
|
Package distro models an environment configuration for a host. |
event
Package event models events in the system, which trigger actions to occur.
|
Package event models events in the system, which trigger actions to occur. |
githubapp
Package githubapp contains the data model for GitHub app installation information and GitHub app credentials.
|
Package githubapp contains the data model for GitHub app installation information and GitHub app credentials. |
host
Package host models a single host managed by Evergreen's application server.
|
Package host models a single host managed by Evergreen's application server. |
log
Log Chunk
|
Log Chunk |
manifest
Package manifest records the git hashes of modules for versions.
|
Package manifest records the git hashes of modules for versions. |
notification
Package notification models notifications sent to users.
|
Package notification models notifications sent to users. |
patch
Package patch models an intent to patch test code in a particular state.
|
Package patch models an intent to patch test code in a particular state. |
pod
Package pod models a single pod (a group of containers), which can run container tasks.
|
Package pod models a single pod (a group of containers), which can run container tasks. |
pod/definition
Package definition contains the data model for the pod definition cache.
|
Package definition contains the data model for the pod definition cache. |
pod/dispatcher
Package dispatcher models a queue of tasks that are dispatched to a group of pods.
|
Package dispatcher models a queue of tasks that are dispatched to a group of pods. |
reliability
Package reliability models task reliability statistics.
|
Package reliability models task reliability statistics. |
task
Package task models the task, the simplest unit of execution for Evergreen.
|
Package task models the task, the simplest unit of execution for Evergreen. |
taskstats
Package taskstats provides functions to generate and query pre-computed and task statistics.
|
Package taskstats provides functions to generate and query pre-computed and task statistics. |
testresult
Package testresult models test results, which are posted by tasks during execution.
|
Package testresult models test results, which are posted by tasks during execution. |
user
Package user represents users of Evergreen.
|
Package user represents users of Evergreen. |
Package operations provides commands for the CLI, which is also the binary for the server and agent.
|
Package operations provides commands for the CLI, which is also the binary for the server and agent. |
Package plugin provides a handful of UI plugins that are not part of core Evergreen.
|
Package plugin provides a handful of UI plugins that are not part of core Evergreen. |
Package repotracker tracks GitHub repositories, listening for new commits and pull requests.
|
Package repotracker tracks GitHub repositories, listening for new commits and pull requests. |
Package rest provides an API for Evergreen users, as well as the GraphQL interface.
|
Package rest provides an API for Evergreen users, as well as the GraphQL interface. |
client
Package client provides a REST client for API requests to the server.
|
Package client provides a REST client for API requests to the server. |
data
Package data provides database access for API requests to the server.
|
Package data provides database access for API requests to the server. |
model
Package model maps database models to API models for REST requests to the server.
|
Package model maps database models to API models for REST requests to the server. |
route
Package route handles incoming REST requests to the server.
|
Package route handles incoming REST requests to the server. |
Package scheduler orders tasks in distro queues.
|
Package scheduler orders tasks in distro queues. |
Package service exposes core UI and API endpoints.
|
Package service exposes core UI and API endpoints. |
smoke
|
|
Package thirdparty defines interactions with third-party services but not cloud providers, which are in cloud.
|
Package thirdparty defines interactions with third-party services but not cloud providers, which are in cloud. |
Package trigger defines triggers that map events to notifications.
|
Package trigger defines triggers that map events to notifications. |
Package units contains amboy.Job definitions.
|
Package units contains amboy.Job definitions. |
Package util contains utility functions depended on by many other packages.
|
Package util contains utility functions depended on by many other packages. |
Package validator checks that project configuration files and distro settings are correct.
|
Package validator checks that project configuration files and distro settings are correct. |