Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4efbeae
Update buildkite-agent to v3.115.4
renovate[bot] Jan 13, 2026
63c926a
Merge pull request #1699 from buildkite/renovate/buildkite-agent-3.x
scadu Jan 13, 2026
9f4503e
Update changelog to v6.53.0
scadu Jan 13, 2026
298e108
Merge pull request #1700 from buildkite/release/v6.53.0
scadu Jan 13, 2026
822445e
Install add'l python3.x versions
petetomasik Jan 15, 2026
8a4e285
Merge pull request #1702 from buildkite/SUP-5966-add-new-python-binaries
mcncl Jan 16, 2026
e14ba11
Update log messages during disk space checks/cleanup ops
petetomasik Jan 26, 2026
5b11e25
Merge pull request #1704 from buildkite/chore/revise-disk-space-clean…
mcncl Jan 26, 2026
75d7407
Add ScalerManagedPolicyARNs parameter for Lambda execution role
Mykematt Dec 10, 2025
ec72054
Update buildkite-agent to v3.116.0
renovate[bot] Jan 29, 2026
e7ef5f4
Merge pull request #1705 from buildkite/renovate/buildkite-agent-3.x
mcncl Jan 29, 2026
1def693
Update changelog for upcoming release v6.54.0
scadu Jan 29, 2026
8d2caf5
Update notes for v6.53.0
scadu Jan 29, 2026
ca9ccaa
Fix disk cleanup for multi-agent instances
petetomasik Jan 29, 2026
7b4906a
Update packer/linux/stack/conf/bin/bk-check-disk-space.sh
petetomasik Jan 30, 2026
020afed
Merge pull request #1707 from buildkite/SUP-4523-fix-disk-cleanup
petetomasik Jan 30, 2026
195907a
Update dependency go to v1.25.6
renovate[bot] Feb 1, 2026
79c77a0
Merge branch 'main' into release/v6.54.0
mcncl Feb 1, 2026
411afe7
Merge pull request #1708 from buildkite/renovate/go-1.x
mcncl Feb 1, 2026
ed4d8fd
Merge branch 'main' into release/v6.54.0
mcncl Feb 1, 2026
6ba0e17
Merge pull request #1706 from buildkite/release/v6.54.0
scadu Feb 1, 2026
0a1ecd7
Update session-manager-plugin to v1.2.764.0
renovate[bot] Feb 1, 2026
455d011
Merge pull request #1709 from buildkite/renovate/aws-session-manager-…
mcncl Feb 1, 2026
9bd28dd
Update scaler version to allow CI pass test
Feb 3, 2026
94b9bb9
Merge branch 'main' into Ola-SUP-2919
Mykematt Feb 3, 2026
9006091
Merge pull request #1683 from buildkite/Ola-SUP-2919
mcncl Feb 3, 2026
965b4ec
Update buildkite-agent to v3.117.0
renovate[bot] Feb 4, 2026
007cc1d
Merge pull request #1710 from buildkite/renovate/buildkite-agent-3.x
mcncl Feb 4, 2026
83efd0f
Add changelog for v6.55.0
scadu Feb 4, 2026
ff109b1
Move changelog update to internal
scadu Feb 4, 2026
4a1befc
Merge pull request #1711 from buildkite/release/v6.55.0
scadu Feb 5, 2026
bff4fb2
Bump golang.org/x/sys from 0.40.0 to 0.41.0 (#1712)
dependabot[bot] Feb 9, 2026
cfe2671
Bump agent scaler to v1.11.0
scadu Feb 10, 2026
82ed564
Merge pull request #1714 from buildkite/agent-scaler-1.11.0_SUP-6112
scadu Feb 10, 2026
d2218e2
Merge branch 'main' into controlshift-dev
anero Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,652 changes: 1,480 additions & 172 deletions CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/buildkite/elastic-ci-stack-for-aws/v6

go 1.23.6
go 1.24.0

toolchain go1.24.5
toolchain go1.25.6

require (
github.com/google/go-cmp v0.7.0
golang.org/x/sys v0.34.0
golang.org/x/sys v0.41.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
19 changes: 19 additions & 0 deletions packer/linux/base/scripts/versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# Centralized version definitions for Linux packer builds
# This file is sourced by installation scripts

# Core Tools
export AWS_CLI_LINUX_VERSION="2.31.32"
export SESSION_MANAGER_PLUGIN_VERSION="1.2.764.0"

# Development Tools
export GIT_LFS_VERSION="3.4.0"
export GOSS_VERSION="v0.4.9"

# Container Tools
export DOCKER_COMPOSE_V2_VERSION="2.40.3"
export DOCKER_BUILDX_VERSION="0.29.1"

# Buildkite Tools
export S3_SECRETS_HELPER_VERSION="2.7.0"
export LIFECYCLED_VERSION="v3.5.0"
32 changes: 30 additions & 2 deletions packer/linux/conf/bin/bk-check-disk-space.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ set -euo pipefail
DISK_MIN_AVAILABLE=${DISK_MIN_AVAILABLE:-5242880} # 5GB
DISK_MIN_INODES=${DISK_MIN_INODES:-250000} # docker needs lots

DOCKER_DIR="$(jq -r '."data-root" // "/var/lib/docker"' /etc/docker/daemon.json)"
DOCKER_DIR="$(jq -r '."data-root" // "/var/lib/docker"' /etc/docker/daemon.json || true)"
if [[ -z "$DOCKER_DIR" ]]; then
DOCKER_DIR="/var/lib/docker"
fi

disk_avail=$(df -k --output=avail "$DOCKER_DIR" | tail -n1)

Expand All @@ -15,7 +18,32 @@ if [[ $disk_avail -lt $DISK_MIN_AVAILABLE ]]; then
disk_min_human=$(numfmt --to=iec-i --suffix=B --from-unit=1024 "${DISK_MIN_AVAILABLE}")
disk_avail_human=$(numfmt --to=iec-i --suffix=B --from-unit=1024 "${disk_avail}")
echo "Not enough disk space free: ${disk_avail_human} (${disk_avail}KB) available, cutoff is ${disk_min_human} (${DISK_MIN_AVAILABLE}KB) 🚨" >&2
exit 1

# Last resort for clearing space with build directory cleanup (if enabled)
if [[ "${BUILDKITE_PURGE_BUILDS_ON_DISK_FULL:-false}" == "true" ]]; then
# Extract the agent-specific directory to avoid disrupting other agents on the same instance
AGENT_ORG_PIPELINE_DIR="${BUILDKITE_BUILD_CHECKOUT_PATH#"${BUILDKITE_BUILD_PATH}/"}"
AGENT_DIR="${AGENT_ORG_PIPELINE_DIR%%/*}"
if [[ -z "${AGENT_DIR}" ]]; then
echo "Unable to determine agent-specific build directory. Skipping purge to avoid deleting other agents' builds." >&2
exit 1
fi
AGENT_BUILD_DIR="${BUILDKITE_BUILD_PATH}/${AGENT_DIR}"

echo "Purging builds in ${AGENT_BUILD_DIR}"
rm -rf "${AGENT_BUILD_DIR:?}"/*

disk_avail=$(df -k --output=avail "$DOCKER_DIR" | tail -n1)
disk_avail_human=$(numfmt --to=iec-i --suffix=B --from-unit=1024 "${disk_avail}")
echo "Disk space free after build purge: ${disk_avail_human} (${disk_avail}KB)"
if [[ $disk_avail -lt $DISK_MIN_AVAILABLE ]]; then
echo "Insufficient disk space remaining after build purge." >&2
exit 1
fi
else
echo "Insufficient disk space. Build purge not enabled." >&2
exit 1
fi
fi

inodes_avail=$(df -k --output=iavail "$DOCKER_DIR" | tail -n1)
Expand Down
19 changes: 16 additions & 3 deletions packer/linux/conf/buildkite-agent/hooks/environment
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,17 @@ fi

echo "Checking disk space"
if ! /usr/local/bin/bk-check-disk-space.sh; then
echo "Cleaning up docker resources older than ${DOCKER_PRUNE_UNTIL:-4h}"
docker image prune --all --force --filter "until=${DOCKER_PRUNE_UNTIL:-4h}"
echo "~~~ :broom: Pruning docker resources to free disk space"
docker image prune --all --force --filter "until=${DOCKER_PRUNE_UNTIL:-4h}" || true

if [[ "${DOCKER_BUILDER_PRUNE_ENABLED:-false}" == "true" ]]; then
docker builder prune --all --force --filter "until=${DOCKER_PRUNE_UNTIL:-4h}" || true
fi

echo "Checking disk space again"
# Capture disk space output for potential error logging
if ! disk_check_output=$(/usr/local/bin/bk-check-disk-space.sh 2>&1); then
echo "--- :warning: Disk health checks failed."
echo "--- :warning: Insufficient disk space after cleanup."
echo "${disk_check_output}"

# Check if instance termination is enabled (default: false for backward compatibility)
Expand Down Expand Up @@ -101,6 +105,7 @@ done
if [[ -n "${BUILDKITE_SECRETS_BUCKET:-}" && "${SECRETS_PLUGIN_ENABLED:-}" == "1" ]]; then
export BUILDKITE_PLUGIN_S3_SECRETS_BUCKET="$BUILDKITE_SECRETS_BUCKET"
export BUILDKITE_PLUGIN_S3_SECRETS_REGION="$BUILDKITE_SECRETS_BUCKET_REGION"
export BUILDKITE_PLUGIN_S3_SECRETS_SKIP_SSH_KEY_NOT_FOUND_WARNING="${BUILDKITE_SECRETS_PLUGIN_SKIP_SSH_KEY_NOT_FOUND_WARNING:-false}"

# shellcheck source=/dev/null
source /usr/local/buildkite-aws-stack/plugins/secrets/hooks/environment
Expand All @@ -110,11 +115,19 @@ if [[ "${BUILDKITE_ECR_POLICY:-}" != "none" && "${ECR_PLUGIN_ENABLED:-}" == "1"
export BUILDKITE_PLUGIN_ECR_LOGIN=1
export BUILDKITE_PLUGIN_ECR_RETRIES=3

# Allow pipeline-level override, otherwise use CloudFormation parameter
set_unless_present "BUILDKITE_PLUGIN_ECR_CREDENTIAL_HELPER" "${ECR_CREDENTIAL_HELPER_ENABLED:-false}"

# map AWS_ECR_LOGIN_REGISTRY_IDS into the plugin list format
if [[ -n "${AWS_ECR_LOGIN_REGISTRY_IDS:-}" ]]; then
export BUILDKITE_PLUGIN_ECR_ACCOUNT_IDS_0="${AWS_ECR_LOGIN_REGISTRY_IDS}"
fi

# map AWS_ECR_LOGIN into the plugin format
if [[ -n "${AWS_ECR_LOGIN:-}" ]]; then
export BUILDKITE_PLUGIN_ECR_LOGIN="${AWS_ECR_LOGIN}"
fi

# shellcheck source=/dev/null
source /usr/local/buildkite-aws-stack/plugins/ecr/hooks/environment
fi
Expand Down
4 changes: 2 additions & 2 deletions packer/linux/conf/docker/scripts/docker-low-disk-gc
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ trap mark_instance_unhealthy ERR
## if we really need to

if ! /usr/local/bin/bk-check-disk-space.sh; then
echo "Cleaning up docker resources older than ${DOCKER_PRUNE_UNTIL}"
echo "Cleaning up docker resources older than ${DOCKER_PRUNE_UNTIL} to free disk space"
docker image prune --all --force --filter "until=${DOCKER_PRUNE_UNTIL}"
docker builder prune --all --force --filter "until=${DOCKER_PRUNE_UNTIL}"

if ! /usr/local/bin/bk-check-disk-space.sh; then
echo "Disk health checks failed" >&2 && false
echo "Insufficient disk space after cleanup." >&2 && false
exit 1
fi
fi
5 changes: 4 additions & 1 deletion packer/linux/scripts/install-buildkite-agent.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail

AGENT_VERSION="3.117.0"

case $(uname -m) in
x86_64) ARCH=amd64 ;;
aarch64) ARCH=arm64 ;;
Expand All @@ -15,7 +17,6 @@ sudo mkdir -p /var/lib/buildkite-agent/.aws
sudo cp /tmp/conf/aws/config /var/lib/buildkite-agent/.aws/config
sudo chown -R buildkite-agent:buildkite-agent /var/lib/buildkite-agent/.aws

AGENT_VERSION=3.103.0
echo "Downloading buildkite-agent v${AGENT_VERSION} stable..."
sudo curl -Lsf -o /usr/bin/buildkite-agent-stable \
"https://download.buildkite.com/agent/stable/${AGENT_VERSION}/buildkite-agent-linux-${ARCH}"
Expand Down Expand Up @@ -62,6 +63,8 @@ sudo cp /tmp/conf/buildkite-agent/systemd/buildkite-agent.service /etc/systemd/s
echo "Adding cloud-init failure safety check..."
sudo mkdir -p /etc/systemd/system/cloud-final.service.d/
sudo cp /tmp/conf/buildkite-agent/systemd/cloud-final.service.d/10-power-off-on-failure.conf /etc/systemd/system/cloud-final.service.d/10-power-off-on-failure.conf
sudo mkdir -p /etc/systemd/system/cloud-init.service.d/
sudo cp /tmp/conf/buildkite-agent/systemd/cloud-init.service.d/10-power-off-on-failure.conf /etc/systemd/system/cloud-init.service.d/10-power-off-on-failure.conf

echo "Adding termination scripts..."
sudo cp /tmp/conf/buildkite-agent/scripts/stop-agent-gracefully /usr/local/bin/stop-agent-gracefully
Expand Down
6 changes: 6 additions & 0 deletions packer/linux/scripts/install-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ sudo dnf install -yq \
python \
python-pip \
python-setuptools \
python3.11 \
python3.11-pip \
python3.12 \
python3.12-pip \
python3.13 \
python3.13-pip \
unzip \
wget \
zip
Expand Down
53 changes: 53 additions & 0 deletions packer/linux/stack/conf/buildkite-agent/hooks/pre-exit
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -eu -o pipefail

if [[ "${ENABLE_PRE_EXIT_DISK_CLEANUP:-false}" == "true" ]]; then
echo "Checking disk space"
if ! /usr/local/bin/bk-check-disk-space.sh; then
echo "~~~ :broom: Pruning docker resources to free disk space"
docker image prune --all --force --filter "until=${DOCKER_PRUNE_UNTIL:-4h}" || true

if [[ "${DOCKER_BUILDER_PRUNE_ENABLED:-false}" == "true" ]]; then
docker builder prune --all --force --filter "until=${DOCKER_PRUNE_UNTIL:-4h}" || true
fi

echo "Checking disk space again"
# Capture disk space output for potential error logging
if ! disk_check_output=$(/usr/local/bin/bk-check-disk-space.sh 2>&1); then
echo "--- :warning: Insufficient disk space after cleanup."
echo "${disk_check_output}"

# Check if instance termination is enabled (default: false for backward compatibility)
if [[ "${BUILDKITE_TERMINATE_INSTANCE_ON_DISK_FULL:-false}" == "true" ]]; then
echo "Terminating instance due to disk space issues."
export BUILDKITE_TERMINATE_INSTANCE_AFTER_JOB=true

if [[ -x /usr/local/bin/terminate-instance ]]; then
/usr/local/bin/terminate-instance
else
echo "terminate-instance script not found, falling back to exit 1" >&2
exit 1
fi

# Should not reach here if termination succeeds
exit 1
else
echo "Exiting job due to insufficient disk space (set BuildkiteTerminateInstanceOnDiskFull to true in CloudFormation Stack to terminate instance instead)."
exit 1
fi
fi
fi
fi

# clean up our temporary docker config
if [[ -n "${BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY:-}" && -d "$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY" ]]; then
rm -rf "$BUILDKITE_DOCKER_CONFIG_TEMP_DIRECTORY"
fi

if [[ -n "${BUILDKITE_SECRETS_BUCKET:-}" && "${SECRETS_PLUGIN_ENABLED:-}" == "1" ]]; then
export BUILDKITE_PLUGIN_S3_SECRETS_BUCKET="$BUILDKITE_SECRETS_BUCKET"

# shellcheck source=/dev/null
source /usr/local/buildkite-aws-stack/plugins/secrets/hooks/pre-exit
fi
17 changes: 17 additions & 0 deletions packer/windows/base/scripts/versions.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Centralized version definitions for Windows packer builds
# This file is sourced by installation scripts

# Core Tools
$AWS_CLI_WINDOWS_VERSION = "2.31.32"
$SESSION_MANAGER_PLUGIN_VERSION = "1.2.764.0"

# Development Tools
$GIT_VERSION = "2.39.1"

# Container Tools
$docker_compose_version = "2.40.3"
$ecr_cred_helper_version = "0.10.1"

# Buildkite Tools
$S3_SECRETS_HELPER_VERSION = "2.7.0"
$lifecycled_version = "v3.5.0"
15 changes: 8 additions & 7 deletions packer/windows/scripts/install-buildkite-agent.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Stop script execution when a non-terminating error occurs
$ErrorActionPreference = "Stop"

$AGENT_VERSION = "3.103.0"

$AGENT_VERSION = "3.117.0"

Write-Output "Creating bin dir..."
New-Item -ItemType directory -Path C:\buildkite-agent\bin
if (-not (Test-Path C:\buildkite-agent\bin)) { New-Item -ItemType Directory -Path C:\buildkite-agent\bin -Force }

Write-Output 'Updating PATH'
$env:PATH = "C:\buildkite-agent\bin;" + $env:PATH
Expand All @@ -21,19 +22,19 @@ buildkite-agent-beta.exe --version
If ($lastexitcode -ne 0) { Exit $lastexitcode }

Write-Output "Creating hooks dir..."
New-Item -ItemType directory -Path C:\buildkite-agent\hooks
if (-not (Test-Path C:\buildkite-agent\hooks)) { New-Item -ItemType Directory -Path C:\buildkite-agent\hooks -Force }

Write-Output "Copying custom hooks..."
Copy-Item -Path C:\packer-temp\conf\buildkite-agent\hooks\* -Destination C:\buildkite-agent\hooks

Write-Output "Creating builds dir..."
New-Item -ItemType directory -Path C:\buildkite-agent\builds
if (-not (Test-Path C:\buildkite-agent\builds)) { New-Item -ItemType Directory -Path C:\buildkite-agent\builds -Force }

Write-Output "Creating git-mirrors dir..."
New-Item -ItemType directory -Path C:\buildkite-agent\git-mirrors
if (-not (Test-Path C:\buildkite-agent\git-mirrors)) { New-Item -ItemType Directory -Path C:\buildkite-agent\git-mirrors -Force }

Write-Output "Creating plugins dir..."
New-Item -ItemType directory -Path C:\buildkite-agent\plugins
if (-not (Test-Path C:\buildkite-agent\plugins)) { New-Item -ItemType Directory -Path C:\buildkite-agent\plugins -Force }

Write-Output "Installing bk elastic stack bin files..."
Copy-Item -Path C:\packer-temp\conf\bin\bk-* -Destination C:\buildkite-agent\bin
Expand All @@ -43,5 +44,5 @@ Copy-Item -Path C:\packer-temp\conf\buildkite-agent\scripts\terminate-instance.p
Copy-Item -Path C:\packer-temp\conf\buildkite-agent\scripts\stop-agent-gracefully.ps1 -Destination C:\buildkite-agent\bin

Write-Output "Copying built-in plugins..."
New-Item -ItemType directory -Path "C:\Program Files\Git\usr\local\buildkite-aws-stack\plugins"
if (-not (Test-Path "C:\Program Files\Git\usr\local\buildkite-aws-stack\plugins")) { New-Item -ItemType Directory -Path "C:\Program Files\Git\usr\local\buildkite-aws-stack\plugins" -Force }
Copy-Item -Recurse -Path C:\packer-temp\plugins\* -Destination "C:\Program Files\Git\usr\local\buildkite-aws-stack\plugins\"
Loading
Loading