Elastic CI Stack v6 to v7 upgrade guide
Elastic CI Stack for AWS v7 upgrades the bundled Linux and Windows Buildkite agents from v3 to v4. This guide covers the stack-specific changes. Read the Agent v3 to v4 upgrade guide for changes that affect your pipelines, hooks, plugins, and custom agent configuration.
If you need Buildkite agent v3, remain on Elastic CI Stack v6. Elastic CI Stack v7 no longer supports agent v3 or the oldstable release channel.
Prepare the upgrade
-
Export your current stack parameters:
aws cloudformation describe-stacks \ --stack-name YOUR_STACK_NAME \ --query 'Stacks[0].Parameters' \ --output json > stack-parameters-backup.jsonSensitive parameters such as
BuildkiteAgentTokenappear as****in this output. Keep their original values available separately if you need to supply them again. Update your parameter files and deployment automation using Parameter changes. CloudFormation rejects parameter names that do not exist in the v7 template. Do not carry forward every v6 parameter unchanged.
If you set
ImageIdorImageIdParameter, rebuild your custom AMI from the v7 base AMI and update the image parameter in the same stack update. A v6-based AMI cannot boot under the v7 template.Review any settings supplied through
AgentEnvFileUrl. CloudFormation cannot validate those settings.Preview the update with a CloudFormation change set. Follow Updating your stack with your migrated parameters and the v7 template.
If you are upgrading from an earlier v6 release, also review the stack changelog for changes between your current version and v7.
Parameter changes
Update the following CloudFormation parameters before upgrading:
| v6 parameter | v7 replacement | Migration | |||
|---|---|---|---|---|---|
| v6 parameter | BuildkiteAgentTimestampLines |
v7 replacement | Removed | Migration | Remove the parameter. Agent v4 always emits ANSI timestamps. |
| v6 parameter | BuildkiteAgentTracingBackend |
v7 replacement | BuildkiteAgentOpenTelemetryTracing |
Migration | Replace an empty string with false, or opentelemetry with true. For datadog, follow Datadog tracing. |
| v6 parameter |
BuildkiteAgentCancelGracePeriod and BuildkiteAgentSignalGracePeriod
|
v7 replacement |
BuildkiteAgentCancelSignalTimeout and BuildkiteAgentCancelCleanupTimeout
|
Migration | Convert the values using Cancellation timing. These are not one-to-one renames. |
| v6 parameter | BuildkiteAgentRelease=oldstable |
v7 replacement |
BuildkiteAgentRelease=stable, beta, or edge
|
Migration | Use stable for the stable agent release. Remain on stack v6 if you need agent v3. |
Cancellation timing
Elastic CI Stack v7 separates cancellation into two timeouts:
-
BuildkiteAgentCancelSignalTimeoutcontrols how long the job process has to stop before it is forcibly terminated. -
BuildkiteAgentCancelCleanupTimeoutgives a stopping agent extra time to upload logs and artifacts.
The defaults are 10s for the signal timeout and 5s for cleanup on both platforms. The total default cancellation time changes from 60 to 15 seconds on Linux and from ten to 15 seconds on Windows.
To preserve the v6 defaults, set:
| Platform | BuildkiteAgentCancelSignalTimeout |
BuildkiteAgentCancelCleanupTimeout |
|||
|---|---|---|---|---|---|
| Platform | Linux | BuildkiteAgentCancelSignalTimeout |
59s |
BuildkiteAgentCancelCleanupTimeout |
1s |
| Platform | Windows | BuildkiteAgentCancelSignalTimeout |
9s |
BuildkiteAgentCancelCleanupTimeout |
1s |
The v6 cancellation parameters applied only to Linux. Windows used agent v3 defaults unless you overrode them through custom agent configuration.
For custom v6 Linux parameter values:
- If
BuildkiteAgentSignalGracePeriodwas-1, subtract one second fromBuildkiteAgentCancelGracePeriodfor the new signal timeout and use1sfor cleanup. - Otherwise, use the old signal grace period as the signal timeout. Set the cleanup timeout to the old cancel grace period minus the signal timeout.
For example, BuildkiteAgentCancelGracePeriod=120 and BuildkiteAgentSignalGracePeriod=30 become BuildkiteAgentCancelSignalTimeout=30s and BuildkiteAgentCancelCleanupTimeout=90s. The new parameters accept durations such as 30s and 1m30s.
Datadog tracing
Agent v4 sends traces using OpenTelemetry instead of the native Datadog backend. You can continue using your existing Datadog Agent. You do not need a separate OpenTelemetry collector.
- Enable OpenTelemetry Protocol (OTLP) ingestion on your Datadog Agent if it is not already enabled. OTLP ingestion is disabled by default, even if the Datadog Agent already receives traces through its native backend.
- Replace
BuildkiteAgentTracingBackend=datadogwithBuildkiteAgentOpenTelemetryTracing=truein your stack parameters. - Use
AgentEnvFileUrlto setOTEL_EXPORTER_OTLP_ENDPOINTto the OTLP endpoint on your Datadog Agent. SetOTEL_EXPORTER_OTLP_PROTOCOLto the matching protocol, such asgrpcorhttp/protobuf. Ensure the endpoint is reachable from the Buildkite agent. - If you set
BUILDKITE_TRACING_SERVICE_NAME, rename it toBUILDKITE_TELEMETRY_SERVICE_NAMEto preserve the service name.
Agent environment configuration
The AgentEnvFileUrl parameter still works. Its values configure the agent directly and can override the configuration generated by the stack. Review every custom setting against the Agent v3 to v4 upgrade guide, including:
- Remove
BUILDKITE_NO_ANSI_TIMESTAMPSandBUILDKITE_TIMESTAMP_LINES. - Replace
BUILDKITE_TRACING_BACKENDwithBUILDKITE_OPENTELEMETRY_TRACING, usingtrueorfalse, and configure the OTLP endpoint and protocol. - Rename
BUILDKITE_TRACING_SERVICE_NAMEtoBUILDKITE_TELEMETRY_SERVICE_NAMEand removeBUILDKITE_TRACING_PROPAGATE_TRACEPARENT. - Migrate any direct DogStatsD metrics configuration to OpenTelemetry as described in the agent observability changes.
- Replace
BUILDKITE_CANCEL_GRACE_PERIODandBUILDKITE_SIGNAL_GRACE_PERIOD_SECONDSwithBUILDKITE_CANCEL_SIGNAL_TIMEOUTandBUILDKITE_CANCEL_CLEANUP_TIMEOUT, using the timing conversion.
Also review any custom agent experiments before replacing your instances.