Buildkite Test Agent Setup¶
We are using Buildkite for Windows and macOS testing. The build machines and buildkite-agent must be set up before use.
Git Mirrors (all platforms)¶
Set git-mirrors-path in buildkite-agent.cfg on every agent. Buildkite keeps a local bare mirror of the repository there, so a wiped or first-time build directory does an incremental fetch from the mirror instead of a fresh clone against GitHub — this avoids the exposure to transient network failures that a full clone has. See Buildkite’s Git mirrors docs.
buildkite-agent.cfg doesn’t expand $HOME-style variables, only a leading ~. Point git-mirrors-path at a sibling of that agent’s own build-path, matching whichever form (~ or absolute) build-path already uses. To check or fix an existing agent, run the matching one-liner below (idempotent — safe to run again) and restart the agent afterward:
-
macOS/Pi,
build-path="~/tmp/buildkite-agent/builds": -
Linux/WSL2 package default,
build-path="/var/lib/buildkite-agent/builds": -
Windows,
build-path=C:\Users\testbot\tmp\buildkite(Git Bash):
Windows agents provisioned with the package default build-path=C:\buildkite-agent\builds instead use git-mirrors-path="C:\buildkite-agent\git-mirrors" — check build-path in the file first.
Remote Access with Tailscale¶
Maintainers reach test runners with SSH and screen sharing over a dedicated Tailscale tailnet. Chrome Remote Desktop stays set up on the runners as a fallback until every runner has been moved over. The tailnet carries only human access: buildkite-agent and the GitHub runners connect out to their services as before and don’t depend on it.
Runners are tagged tag:ddev-runner. The access policy lets the maintainers’ group connect to runners but not the reverse, because runners execute pull request code.
Access Policy¶
In the Tailscale admin console under Access controls:
{
"groups": {
"group:ddev-admins": ["<github-username>@github"],
},
"tagOwners": {
"tag:ddev-runner": ["group:ddev-admins"],
},
"grants": [
{
"src": ["group:ddev-admins"],
"dst": ["tag:ddev-runner"],
"ip": ["tcp:22", "tcp:3389", "tcp:5900"],
},
],
"ssh": [
{
"action": "accept",
"src": ["group:ddev-admins"],
"dst": ["tag:ddev-runner"],
"users": ["autogroup:nonroot"],
},
],
}
- A group member must be the login name exactly as the admin console Users page shows it. For a GitHub identity that is
<github-username>@github, not an email address. An email address leaves the group empty, so no rule matches and the runner sees no peers. - Use a group, not
autogroup:admin, as thesshrule source. - The
sshblock applies only to runners using Tailscale SSH (macOS). It has no effect on Windows. iplists SSH (22), RDP for Windows (3389), and Screen Sharing for macOS (5900). The tailnet silently drops other ports, so a working SSH login doesn’t show that the screen sharing port is allowed.- The Preview rules tab shows what a policy allows before you save it.
Joining as a Maintainer¶
Install Tailscale and sign in with GitHub to the runner tailnet, ddev.org.github, using the login listed in group:ddev-admins.
On Linux, run sudo systemctl enable --now tailscaled first, because some distributions, such as Arch, don’t enable the service on install. Then sign in with sudo tailscale up --operator=$USER so later tailscale commands and the tailscale systray tray app work without sudo. tailscale login instead starts a new profile without the operator setting and fails with “checkprefs access denied”.
Joining a Runner¶
Save tagOwners before a runner advertises the tag, or the tag is silently refused. Install Tailscale, then join the tailnet and tag the device:
- macOS:
sudo tailscale up --ssh --advertise-tags=tag:ddev-runner - Windows, in admin PowerShell:
tailscale up --advertise-tags=tag:ddev-runner(Tailscale SSH isn’t supported on Windows)
“Tailscale SSH enabled, but access controls don’t allow anyone to access this device” means the policy doesn’t match anyone yet; it clears once the policy is correct.
With --ssh, Tailscale answers every SSH connection that arrives over the tailnet, and the runner’s own OpenSSH never sees it. A device that isn’t tagged tag:ddev-runner matches no ssh rule, so plain ssh fails along with tailscale ssh, with “tailnet policy does not permit you to SSH to this node”. Tag the device, or run tailscale set --ssh=false to hand port 22 back to OpenSSH.
To join without a browser login, create a reusable, pre-approved auth key with tag:ddev-runner selected under Settings → Keys in the admin console, then run tailscale up --auth-key=<key>, adding --ssh on macOS. A device joined with a tagged key gets the tag without --advertise-tags. Tagged devices have key expiry disabled, which unattended runners need. Treat the key as a secret.
macOS Runners¶
- SSH works through Tailscale SSH and through regular Remote Login (step 7 of macOS setup).
- For screen sharing, turn on Remote Management in System Settings → General → Sharing, then run macos_screen_sharing.sh with
sudoto givetestbotevery Remote Management privilege. Connect tovnc://<runner-name>with the built-in Screen Sharing app. Remote Management owns port 5900 and rejects a user without the Observe and Control privileges as if the password were wrong.dscl . -read /Users/testbot naprivsshows-1073741569when the user has every privilege. - On Linux with KDE, connect with KRDC using
vnc. It needs its optionallibvncserverdependency; without it KRDC rejects every address with “The entered address does not have the required form”.
Windows Runners¶
RDP requires Windows Pro, Enterprise, or Education. In admin PowerShell, run windows_remote_access.ps1, which installs the OpenSSH server, enables RDP, and adds SSH keys:
- Keys go in
C:\ProgramData\ssh\administrators_authorized_keys, becausesshdignores~\.ssh\authorized_keysfor members of the Administrators group. - Connect with Microsoft’s Windows App using
<runner-name>as the PC name. RDP takes over the console session and leaves it locked when you disconnect. On Linux with KDE, use KRDC withrdpand its optionalfreerdpdependency. - Debug with
ssh -vand the Event Viewer log under Applications and Services Logs → OpenSSH → Operational. - Once key login works, set
PasswordAuthentication noinC:\ProgramData\ssh\sshd_configand runRestart-Service sshd. Confirm a new session can still log in before closing the current one.
Checking Access¶
From a maintainer’s machine signed in to the runner tailnet (tailscale switch <account> if you use more than one):
tailscale statuslists the runner, and the admin console Machines page shows it withtag:ddev-runner. If it lists only your own machine, your login isn’t ingroup:ddev-admins, andsshto a runner can’t resolve its name or times out.tailscale ping <runner-name>reports a direct path. A path “via DERP” is relayed; it works but is slow for screen sharing.ssh <user>@<runner-name>logs in.- check_runner_access.sh
<runner-name> macos|windowschecks each port. “No answer” means the access policy or the runner’s firewall drops it; “refused” means nothing is listening on the runner.
Runners with a Public IP¶
Joining the tailnet doesn’t close ports already open on a public interface. For a runner with a public IP:
- Keep an out-of-band path, such as the hosting provider’s console, in case of lockout.
- Block inbound traffic on the public interface with the provider’s firewall or
pfon macOS, allowing 22 and 5900 only from the tailnet range100.64.0.0/10. The macOS application firewall works per application, so it isn’t a substitute. - Allow SSH keys only, and turn off the legacy VNC password option on macOS.
- From a machine outside the tailnet,
nmap -Pn <public-ip>should show 22 and 5900 closed or filtered.
Windows Test Agent Setup¶
- Create the user “testbot” on the machine. Use the password for
ddevtestbot@gmail.com, available in 1Password. - In admin PowerShell,
wsl --install. - (WSL2/Docker Desktop and traditional Windows only): Install either Docker Desktop for Windows (from the release notes page, which is best maintained) or Rancher Desktop. With Rancher Desktop, turn off Kubernetes. (Rancher Desktop on Windows appears to be too unreliable to use at this point in its history.)
- In admin PowerShell,
Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "Unrestricted". - In admin PowerShell, download and run windows_buildkite_start.ps1 with
curl <url> -O windows_buildkite_start.ps1. -
Install items as needed with
wingetas the testbot user. Everything butmkcertis only required for a traditional Windows test machine, which also needsnc.exe(netcat) on thePATH; it has nowingetpackage. Don’t use Chocolatey, which needs an administrator for upgrades that the unprivileged test jobs can’t do. Don’t install DDEV either: the test jobs build and use the DDEV under test. -
After restart, in administrative Git Bash window,
Rename-Computer <testbot-win10(home|pro)-<description>-1and thenexport BUILDKITE_AGENT_TOKEN=<token>. - (Traditional Windows test runner only): Download and run windows_buildkite_setup.sh.
- If using Rancher Desktop, adjust the /c/buildkite-agent/buildkite-agent.cfg file to set
rancher-desktop=truein the tags instead ofdocker-desktop. If using Docker Desktop, setdocker-desktop=true. While editing that file, also addgit-mirrors-path(see Git Mirrors):echo 'git-mirrors-path="C:\buildkite-agent\git-mirrors"' >> /c/buildkite-agent/buildkite-agent.cfg. - (Traditional Windows test runner only): Download and run windows_postinstall.sh.
- (Traditional Windows or Docker Desktop WSL2 Only) Launch Docker. It may require you to take further actions.
- Check “Start Docker Desktop when you sign in” or the equivalent with Rancher Desktop.
- Check “Add the *.docker.internal names to the host’s /etc/hosts file”
- Uncheck “SBOM Indexing”
- Under “Resources” uncheck “Resource Saver” — important: Docker Desktop may re-enable this after a full restart. Verify it is unchecked after any Docker Desktop upgrade or manual restart. When Resource Saver is active, Docker Desktop pauses the Linux VM when no containers are running;
docker psand WSL2 integration fail until it is un-paused, causing spurious test failures.
- After starting Docker Desktop or Rancher Desktop, set the correct Docker context in the Git Bash window with
docker context use desktop-linux(Docker Desktop) ordocker context use default(Rancher Desktop). - Set up remote access with Tailscale, including the OpenSSH server. As a fallback, log into Chrome with the user
ddevtestbot@gmail.comand enable Chrome Remote Desktop. - (Traditional Windows test runner only): Enable
gd,fileinfo, andcurlextensions in/c/tools/php*/php.ini. - Set the “Sleep after time” setting in settings to never.
- Install winaero tweaker and “Enable user autologin checkbox”. Set up the machine to automatically log in on boot. Then run netplwiz, provide the password for the main user, uncheck “require a password to log in”.
- (Traditional Windows test runner only): Set the
buildkite-agentservice to run as the testbot user and use delayed start: Choose “Automatic, delayed start” and on the “Log On” tab in the services widget it must be set up to log in as the testbot user, so it inherits environment variables and home directory (and has testbot Git config, etc). - (Traditional Windows test runner only):
git config --global --add safe.directory '*'. - (Traditional Windows test runner only): Manually run
testbot_maintenance.sh,curl -sL -O https://raw.githubusercontent.com/ddev/ddev/main/.buildkite/testbot_maintenance.sh && bash testbot_maintenance.sh. - (Traditional Windows test runner only): Run
.buildkite/sanetestbot.shto check your work. - (Traditional Windows test runner only): Reboot the machine and do a test run. (On Windows, the machine name only takes effect on reboot.)
- (Traditional Windows test runner only): Verify that
go,git-bash, and%USERPROFILE%\go\binare in the path. - In “Advanced Windows Update Settings” enable “Receive updates for other Microsoft products” to make sure you get WSL2 kernel upgrades. Make sure to run Windows Update to get the latest kernel.
- Turn off the settings that cause the “windows experience” prompts after new upgrades:

- In PowerShell:
wsl.exe --update. Watch for the elevation to complete, it may require elevation.
Both Docker Desktop/WSL2 and Docker-ce/WSL2¶
- The Ubuntu distro should be set up with the user
buildkite-agentand the password used forddevtestbot@gmail.com. - Stop Docker Desktop if it is running.
- Set up remote access with Tailscale on the Windows host. As a fallback, log into Chrome with the user
ddevtestbot@gmail.comand enable Chrome Remote Desktop. - Windows Terminal should be installed. Set “Ubuntu” (or this distro) as the default and have it start on Windows startup. Enable “copy on select” in behaviors.
nc.exe -L -p 9003on Windows to trigger and allow Windows Defender.-
For a docker-ce/WSL2 runner (
BUILDKITE_DOCKER_TYPE=wsl2below), Mirrored Mode is normal: edit~/.wslconfigon Windows to add the WSL2 settings below. A Docker Desktop runner (BUILDKITE_DOCKER_TYPE=dockerforwindows) keeps the default NAT networking instead, so skip this step for it. -
Before running the setup script, configure mkcert CAROOT on Windows (PowerShell as the testbot user). This must happen first so that
mkcert -installin WSL2 installs the Windows CA (not a separate Linux-local one) into the Linux trust store: -
In the Ubuntu distro:
export BUILDKITE_AGENT_TOKEN=<token>with the token from 1PasswordBUILDKITE_AGENT_TOKEN.export BUILDKITE_DOCKER_TYPE=dockerforwindowsorexport BUILDKITE_DOCKER_TYPE=wsl2— this also picks theos=agent tag the setup script writes:wsl2-mirroredforwsl2(docker-ce), plainwsl2fordockerforwindows, matching step 6 above.- Optionally
export NGROK_TOKEN=<token>with theNGROK_TOKENfrom 1Password ngrok.comnopaidaccount. - Run the script wsl2-test-runner-setup.sh in the Ubuntu distro. This script reads
CAROOTfrom the Windows registry viapowershell.exe, exports it before callingmkcert -install, and then creates/etc/buildkite-agent/hooks/environmentto repeat this for every buildkite-agent job (since systemd does not propagateWSLENV). It also setsgit-mirrors-path="/var/lib/buildkite-agent/git-mirrors"in/etc/buildkite-agent/buildkite-agent.cfg(see Git Mirrors).
- Restart the distro with
wsl.exe -t Ubuntuand then restart it by opening the Ubuntu window. - If using Docker Desktop, start Docker Desktop.
- In
~/workspace/ddev/.buildkite, run./testbot_maintenance.sh. - In
~/workspace/ddev/.buildkite, run./sanetestbot.shto check your work.
Windows Installer Test Distros¶
The Windows GUI installer tests run in their own dedicated Buildkite pipeline (windows-installer, driven by .buildkite/windows-installer.yml + .buildkite/installer-test.sh), separate from the traditional Windows suite. Each matrix case is a parallel job that installs DDEV into a dedicated WSL2 distro using a specific Docker provider.
These tests need a Windows-native (os=windows) buildkite-agent — the same kind of agent as the traditional Windows runner — because they drive wsl.exe, reg.exe, and the installer .exe. The matrix spreads its jobs across all available os=windows agents, so adding more such machines increases parallelism.
One os=windows agent per machine
An installer run mutates global Windows state (registry CAROOT/WSLENV and the machine-wide mkcert CA root). Two installer jobs must never run on the same machine at the same time. A Buildkite agent runs one job at a time, so running exactly one os=windows agent per physical machine guarantees this; the jobs then only overlap across separate machines.
The test does not create distros — it resets and reuses them. Provision the six named instances once per runner (the normal install handles user creation; complete first-run with the testbot user, which is the default user the test harness expects):
wsl --install Ubuntu --name ddev-test-ubuntu-ce
wsl --install Ubuntu --name ddev-test-ubuntu-desktop
wsl --install Ubuntu-24.04 --name ddev-test-ubuntu2404-ce
wsl --install Ubuntu-24.04 --name ddev-test-ubuntu2404-desktop
wsl --install Debian --name ddev-test-debian-ce
wsl --install Debian --name ddev-test-debian-desktop
For the *-desktop instances only, enable Docker Desktop’s WSL integration for that instance (Docker Desktop → Settings → Resources → WSL integration). Otherwise the docker-desktop cases skip gracefully. The base distro names above (Ubuntu, Ubuntu-24.04, Debian) must be available in the WSL catalog; verify with wsl -l -o.
Remove unattended-upgrades from all test instances. Ubuntu 24.04 in particular runs it on boot and holds the dpkg lock while the installer is trying to run apt-get, causing intermittent failures. It serves no purpose in these short-lived test distros:
foreach ($d in @("ddev-test-ubuntu-ce","ddev-test-ubuntu-desktop","ddev-test-ubuntu2404-ce","ddev-test-ubuntu2404-desktop","ddev-test-debian-ce","ddev-test-debian-desktop")) {
wsl -d $d -u root apt-get remove -y unattended-upgrades 2>$null
}
Install wsl-fix-interop in all test instances and configure it to run on every distro boot. WSL interop (binfmt_misc) loses its WSLInterop entry whenever docker-ce is removed — the package’s post-remove scripts clear binfmt_misc entries. Without it, any Windows .exe called from within WSL fails with “Exec format error”, causing mkcert.exe failures and TLS test failures.
First install the script and sudoers entry:
foreach ($d in @("ddev-test-ubuntu-ce","ddev-test-ubuntu-desktop","ddev-test-ubuntu2404-ce","ddev-test-ubuntu2404-desktop","ddev-test-debian-ce","ddev-test-debian-desktop")) {
wsl -d $d -u root bash -c "cd /tmp && curl -fsSL https://raw.githubusercontent.com/rfay/wsl-fix-interop/main/wsl-fix-interop -o wsl-fix-interop && curl -fsSL https://raw.githubusercontent.com/rfay/wsl-fix-interop/main/install.sh -o install.sh && bash install.sh testbot"
}
Then wire it into /etc/wsl.conf in each distro so it re-registers automatically on every distro boot (including after docker-ce removal clears binfmt_misc):
foreach ($d in @("ddev-test-ubuntu-ce","ddev-test-ubuntu-desktop","ddev-test-ubuntu2404-ce","ddev-test-ubuntu2404-desktop","ddev-test-debian-ce","ddev-test-debian-desktop")) {
wsl -d $d -u root bash -c "grep -q 'wsl-fix-interop' /etc/wsl.conf 2>/dev/null || printf '\n[boot]\ncommand = /usr/local/sbin/wsl-fix-interop\n' >> /etc/wsl.conf"
}
To run a single case manually (e.g. for debugging), select it by instance name, which is also the Go subtest name:
WSL2 install-script tests¶
The ddev-windows-installer pipeline also tests the manual WSL2 install PowerShell scripts (scripts/install_ddev_wsl2_docker_inside.ps1 and scripts/install_ddev_wsl2_docker_desktop.ps1) against current Ubuntu, as the ps1-docker-inside and ps1-docker-desktop matrix cases. These run only when a ps1 script (or its test/plumbing) changes, plus on main and manual builds.
They reuse the two Ubuntu instances above — no extra provisioning. The scripts now accept a -Distro parameter so the test passes the distro name directly without changing the system default:
ps1-docker-inside→ddev-test-ubuntu-ce, which must have Docker Desktop WSL integration disabled (the script aborts if/mnt/wsl/docker-desktopexists). This is the same state the docker-ce installer case wants.ps1-docker-desktop→ddev-test-ubuntu-desktop, which must have Docker Desktop running with WSL integration enabled.mkcert.exemust be on the Windows PATH (already installed withwingetabove).
Run one manually with:
Icinga2 monitoring setup for WSL2 instances¶
- Icinga Director web UI, configure the host on
monitor.ddev.com, normally making a copy of an existing identical item. - Deploy the new host using Icinga Director.
-
sudo icinga2 node wizardto configure the agent, see docs.buildkite-agent@tb-wsldd-16:~$ sudo icinga2 node wizard Welcome to the Icinga 2 Setup Wizard! We will guide you through all required configuration details. Please specify if this is an agent/satellite setup ('n' installs a master setup) [Y/n]: Starting the Agent/Satellite setup routine... Please specify the common name (CN) [tb-wsldd-16.localdomain]: tb-wsldd-16 Please specify the parent endpoint(s) (master or satellite) where this node should connect to: Master/Satellite Common Name (CN from your master/satellite node): monitor.ddev.com Do you want to establish a connection to the parent node from this node? [Y/n]: y Please specify the master/satellite connection information: Master/Satellite endpoint host (IP address or FQDN): monitor.ddev.com Master/Satellite endpoint port [5665]: Add more master/satellite endpoints? [y/N]: Parent certificate information: Version: 3 Subject: CN = monitor.ddev.com Issuer: CN = Icinga CA Valid From: Feb 22 22:34:09 2026 GMT Valid Until: Mar 26 22:34:09 2027 GMT Serial: 02:0e:20:7e:a1:a9:f0:b4:8d:07:63:49:46:fb:d7:90:29:fd:c4:bc Signature Algorithm: sha256WithRSAEncryption Subject Alt Names: monitor.ddev.com Fingerprint: 4A 99 90 F6 F4 F7 F9 20 1B DD 9D 51 EE 86 50 C7 BB 38 09 9B B0 40 4A E0 52 C9 52 2D A1 B8 72 D5 Is this information correct? [y/N]: y Please specify the request ticket generated on your Icinga 2 master (optional). (Hint: # icinga2 pki ticket --cn 'tb-wsldd-16'): c5b9fa649792abcde3941862a664be0fe8d126 Please specify the API bind host/port (optional): Bind Host []: Bind Port []: Accept config from parent node? [y/N]: y Accept commands from parent node? [y/N]: y Reconfiguring Icinga... Local zone name [tb-wsldd-16]: Parent zone name [master]: Default global zones: global-templates director-global Do you want to specify additional global zones? [y/N]: Do you want to disable the inclusion of the conf.d directory [Y/n]: Disabling the inclusion of the conf.d directory... Done. Now restart your Icinga 2 daemon to finish the installation! buildkite-agent@tb-wsldd-16:~$ sudo systemctl restart icinga2 -
Restart
sudo systemctl restart icinga2 - On
monitor.ddev.comedit/usr/local/bin/check_buildkite_agents.shto include the hostname of the new instance.
macOS Docker Desktop Test Agent Setup (Apple Silicon)¶
- Create the user “testbot” on the machine. Use the password for
ddevtestbot@gmail.com, available in 1Password. - Change the name of the machine to something in keeping with current style, perhaps
testbot-macos-arm64-8. This is done in Settings → General → About → Name and in Sharing → Computer Name and in Sharing → Local Hostname. - Set up remote access with Tailscale, including Screen Sharing. When this is done, most other tasks can be done remotely. As a fallback, install Chrome and log the browser into the account used for test runners, which picks up the Chrome Remote Desktop setup, and configure Chrome Remote Desktop to serve.
- The machine should be on the correct network and have a static IP handed out by DHCP. IP addresses are listed in /etc/hosts on
pi.ddev.site, so this one should be added. - Power should be set up as in
. On a MacBook those settings don’t stop it sleeping when the lid closes; sudo pmset -a disablesleep 1does, takes effect without a reboot, and persists.pmset -g | grep SleepDisabledshould show1. Use it only on a machine that stays on AC power, since a closed MacBook that never sleeps gets hot. - Auto login should be set up as in
, see automatically log in on boot. - Remote login should be enabled as in
. - Automatic updates should be set to mostly security only as in
. - Set the time zone to US MT (nearest city: Denver, Colorado).
sudo mkdir -p /usr/local/bin && sudo chown -R testbot /usr/local/bin- Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - After installing Homebrew follow the instructions it gives you at the end to add brew to your PATH.
- Install everything you’ll need with
brew install buildkite/buildkite/buildkite-agent@4 bats-core composer docker docker-buildx docker-compose docker-credential-helper git golang jq mysql-client@8.0 mkcert netcat p7zip && brew install --cask docker-desktop iterm2 ngrok && brew link --force mysql-client. Colima, Lima, and Podman need the HomebrewdockerCLI even where Docker Desktop isn’t installed. Thedocker-desktopcask needssudo, so run it in a terminal on the machine rather than over a non-interactive SSH command. - Run
ngrok authtoken <token>with token for free account from 1Password. - Run
mkcert -install. - If Docker Desktop will be deployed, run Docker manually and go through its configuration routine.
- If OrbStack will be deployed, install it from orbstack.dev.
- Install with Docker only.
- Click “Sign in” in the lower left to sign in with OrbStack credentials (normal test runner gmail address; it will receive an email with a login code).
- Configure it to automatically start and download updates, see
.
- If Rancher Desktop will be deployed, install it.
- Turn off kubernetes.
- Set virtualization to VZ
- Set mount type to VirtioFS
- Run iTerm. You may need to allow full disk access permissions.
- Run
mkdir ~/workspace && cd ~/workspace && git clone https://github.com/ddev/ddev. git config --global --add safe.directory '*'.- Edit
/usr/local/etc/buildkite-agent/buildkite-agent.cfgor/opt/homebrew/etc/buildkite-agent/buildkite-agent.cfgto add- the agent
token(from agents tab, “Reveal Agent Token”). - the agent
name(the name of the machine). tags, like"os=macos,architecture=arm64,osvariant=sonoma,dockertype=dockerformac,rancher-desktop=true,orbstack=true,docker-desktop=true"build-path="~/tmp/buildkite-agent/builds"git-mirrors-path="~/tmp/buildkite-agent/git-mirrors"(see Git Mirrors)
- the agent
- Run
brew services start buildkite-agent@4. - Run
bash ~/workspace/ddev/.buildkite/testbot_maintenance.sh. - Run
bash ~/workspace/ddev/.buildkite/sanetestbot.shto check your work. - The
testbotuser’s SSH account is used for monitoring, sossh-keygenand then add the public keyid_testbotfrom 1Password to~/.ssh/authorized_keysandchmod 600 ~/.ssh/authorized_keys. - Add the new machine to Icinga by copying an existing Icinga service to the new one. This is done in Icinga Director → Services → Single Services → Select a Service → Clone → Deploy. The new service has to have
by-ssh-addressset to the name of the test runner, and that address needs to be added topi.ddev.site’s/etc/hostsfile. -
If
zshis the shell configured, add/etc/zshenvso that/usr/local/bin/dockerwill be picked up: -
In macOS Settings visit “full disk access” and grant access to
buildkite-agent,docker,iterm,orbstack. This may prevent startup modal dialogs that preventbuildkite-agentordockerfrom continuing properly.
Turn Off Spotlight (all macOS runners)¶
Every macOS runner, whatever Docker provider it uses, should have Spotlight indexing turned off:
Otherwise Spotlight indexes the files every test run creates. Together with fseventsd, it can take several CPU cores and gigabytes of memory, which slows the tests. If fseventsd stays high afterward, sudo killall fseventsd restarts it.
Additional Colima macOS setup¶
brew install colimacolima start vz --cpu 4 --memory 6 --disk 60 --vm-type=vz --mount-type=virtiofs --dns=1.1.1.1colima stop vz
Then the Buildkite agent must be configured with tags colima_vz=true.
Additional Lima macOS setup¶
limactl create --name=lima-vz --vm-type=vz --mount-type=virtiofs --mount-writable --mount="~/:w" --memory=6 --cpus=4 --disk=60 template:dockerlimactl start lima-vzlimactl startprints the context command but doesn’t run it, so create the context:docker context create lima-lima-vz --docker "host=unix://$(limactl list lima-vz --format '{{.Dir}}')/sock/docker.sock"docker --context lima-lima-vz run --rm alpine echo ok, thenlimactl stop lima-vz
Then the Buildkite agent must be configured with tags lima=true.
Additional Podman Rootless macOS Setup¶
Podman rootless on macOS runs containers in a lightweight VM managed by podman machine.
- Follow the instructions for Podman on macOS to install Podman and set up a rootless Podman machine with 6GB of memory. On a testbot whose machine was created with the 2GB default, resize it with
podman machine stop && podman machine set --memory 6144. - Verify connectivity:
docker context use podman-rootless && docker psshould return an empty container list. - Stop the machine when done with initial setup:
podman machine stop
Note
Rootless containers cannot bind to ports below 1024. test.sh handles this automatically by setting DDEV_XDG_CONFIG_HOME to an isolated config directory and configuring router-http-port=8080 and router-https-port=8443 via ddev config global.
Then configure the Buildkite agent with tag podman-rootless=true in addition to the standard macOS tags:
The test.sh script uses podman machine start and docker context use podman-rootless to activate the provider, then stops the machine in the cleanup trap on exit.
Additional Apple Container (socktainer) macOS Setup¶
socktainer serves the Docker API on top of Apple’s container, which runs each container in its own lightweight VM. It needs macOS 26 or later on Apple Silicon.
brew install container socktainercontainer system start --enable-kernel-installto install the recommended kernel once, thencontainer system stop.- Don’t run either as a
brew servicesservice; test jobs start and stop them like the other providers. -
Verify:
container system start socktainer & docker --context socktainer run --rm alpine echo ok kill %1 && container system stopsocktainer creates the
socktainerDocker context the first time it runs. -
Over Screen Sharing, publish a port and request it, so macOS asks whether
container-runtime-linuxmay access the local network, and click Allow:container system start container run -d --name ptest -p 18089:80 nginx:alpine curl -sS -o /dev/null -w '%{http_code}\n' http://127.0.0.1:18089 container rm -f ptest && container system stopcurlmust print200. Until someone clicks Allow, every published port resets (“Connection reset by peer”) and containers can’t reach the host, so nearly every networking test fails. On a testbot nobody sees the prompt: a test job raises it and leaves it waiting on the screen. If it was dismissed, turncontainer-runtime-linuxon in System Settings → Privacy & Security → Local Network.The prompt comes back after every upgrade of
container, because macOS treats each new build as a new program. There is no command-line or MDM way to pre-approve it. Runbrew pin containersotestbot_maintenance.sh’sbrew upgradeskips it, and upgrade on purpose while someone is on Screen Sharing:brew unpin container && brew upgrade container && brew pin container, then repeat this step.Don’t do this step, or start Apple Container at all, over SSH. An SSH session can’t show the prompt, and
container system startrun from one registers the service in theuser/<uid>launchd domain, where a later test job reuses it instead of starting its own.To tell from the command line whether a prompt is waiting, look for Local Network checks of the forwarder in the system log. Each blocked connection to a container logs one:
log show --last 10m --style compact --predicate 'process != "log" AND eventMessage CONTAINS "LocalNetwork: found bundle id com.apple.container.container-runtime-linux"'Any output means a test job’s published ports are being blocked: allow
container-runtime-linuxover Screen Sharing. The same failures appear in the Apple Container log asbackend - connect failed: ... No route to host (errno: 65).
Then the Buildkite agent must be configured with tag socktainer=true.
Troubleshooting socktainer Testbots¶
Start from what the build shows. Most socktainer failures on a testbot come from the machine’s state, not from the code under test.
Dozens of tests fail with connection reset by peer or EOF on host ports, often with “ddev-router is running, but nothing answers on host port(s)” from the first project start, while containers answer requests from inside. A Local Network prompt for container-runtime-linux is waiting on that testbot’s desktop.
- Over SSH, run the
log showcommand from step 5 above. Any output confirms it. - Over Screen Sharing, click Allow on the prompt, or turn
container-runtime-linuxon in System Settings → Privacy & Security → Local Network. Severalcontainer-runtime-linuxentries are normal: each build ofcontainergets its own. - Rerun the published-port check from step 5 over Screen Sharing, or rebuild the failed build from the Buildkite UI. Nothing else needs restarting.
This usually follows an upgrade of container, and it hits every socktainer testbot at once unless someone answered the prompt on some of them. One testbot passing while the others fail with the same versions points here too: the Local Network setting is stored separately on each machine.
Apple Container started by hand is gone by the time a job runs. Expected: a test job for any other provider stops Apple Container and socktainer before it starts its own provider, and a socktainer job starts them again. Don’t rely on leaving them running between jobs.
launchctl print user/$(id -u) lists com.apple.container.apiserver. Someone ran container system start over SSH, and the next socktainer job reuses that service instead of starting its own. When no job is running on the testbot, stop it with container system stop. The next socktainer job starts it in the desktop session’s gui/<uid> domain.
Rerunning only socktainer. Rebuild the failed build from the Buildkite UI. Any push to a pull request starts new builds that cancel the ones still running for it, even a push with [skip ci]. Wait for a build you need to finish before pushing to its branch.
Claude Code Self-Hosted Runner (macOS)¶
One macOS runner also runs a Claude Code self-hosted runner, so maintainers can start claude.ai sessions on it. It runs as testbot, from the LaunchAgent ~/Library/LaunchAgents/com.anthropic.claude-self-hosted-runner.plist with RunAtLoad and KeepAlive. Its ProgramArguments are:
/opt/homebrew/bin/claude self-hosted-runner \
--environment-secret-file /Users/testbot/.config/claude-runner/environment-secret \
--base-dir /Users/testbot/claude-runner --client-label macos-claude \
--use-anthropic-git-proxy --configure-git --remove-session-state \
--release-idle-session-min 30 --push-outcome-on-release --health-port 0 \
--log-file /Users/testbot/Library/Logs/claude-self-hosted-runner.log \
--hooks-dir /Users/testbot/.config/claude-runner/hooks
launchd doesn’t expand ~, so the plist uses absolute paths. After changing it, reload the agent while no session is running, because reloading ends the running session:
launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/com.anthropic.claude-self-hosted-runner.plist
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.anthropic.claude-self-hosted-runner.plist
Every session runs as testbot, whoever started it, and gets anything testbot has. So keep testbot free of personal identity and setup:
-
No SSH key that GitHub accepts, in
~/.ssh, in the keychain, or behind an agent such as 1Password’s. Never connect to the runner withssh -A, because sessions could then sign with your keys. Keep~/.ssh/configneutral, sosshignores any agent: -
No personal dotfiles, commit signing setup such as
~/.ssh/allowed_signers, or password manager signed in. - No
gh auth login, and noGH_TOKENorGITHUB_TOKENthat can write or that belongs to a person. - Only generic instructions and skills in
~/.claude. Every session loads~/.claude/CLAUDE.mdand~/.claude/skills, so personal ones apply to everyone. Instructions to useghfail there, as described below.
Sessions reach GitHub as the person who started them: HTTPS Git through Anthropic’s proxy, and the GitHub MCP tools. Each maintainer connects GitHub on claude.ai under Settings → Connectors → GitHub, and picks a repository when starting a session. A session started without a repository gets no clone and no GitHub tools. To push to a fork, the session attaches the fork with push access instead of using SSH.
gh in a session is /opt/homebrew/bin/gh, which isn’t logged in, so it doesn’t work. Sessions have no GitHub search either, which Claude Code offers only through gh api. On self-hosted runners, Claude Code routes only Git through the session’s proxy, and gh is the machine’s own CLI, although the runner log reports gh_path_shim=true. To give sessions gh for reading and searching, set GH_TOKEN for testbot to a fine-grained token of a GitHub machine user, with read-only access to public repositories. Writes still go only through the session’s own account.
The runner clones each repository to ~/claude-runner/<owner>/<repo> and reuses that checkout for the next session, whoever starts it. A post-session hook cleans it with claude-runner-sweep from the Coder runner template. The sweep stashes uncommitted changes in the runner’s clones, removes worktrees, deletes extra clones that hold nothing unpushed, and moves the others to ~/.local/state/claude-runner-rescue/. The runner clears the stash list between sessions, so the sweep keeps each stash under a ref. Install it with the hook:
mkdir -p ~/.local/bin ~/.config/claude-runner/hooks
curl -fsSL https://raw.githubusercontent.com/ddev/coder-ddev/main/modules/claude-self-hosted-runner/files/claude-runner-sweep -o ~/.local/bin/claude-runner-sweep
chmod +x ~/.local/bin/claude-runner-sweep
printf '#!/bin/bash\nexec "$HOME/.local/bin/claude-runner-sweep" "$HOME/claude-runner"\n' > ~/.config/claude-runner/hooks/post-session
chmod +x ~/.config/claude-runner/hooks/post-session
To add --hooks-dir to the LaunchAgent, append to its arguments, then reload it as above:
/usr/libexec/PlistBuddy -c "Add :ProgramArguments: string --hooks-dir" -c "Add :ProgramArguments: string /Users/testbot/.config/claude-runner/hooks" ~/Library/LaunchAgents/com.anthropic.claude-self-hosted-runner.plist
To find work a session left uncommitted, run git for-each-ref refs/runner-rescue in the checkout, and git stash apply <ref> to restore one. ~/.local/state/claude-runner-rescue/log lists everything the sweep did. Rescues are kept for 30 days. Every later session can read them, whoever started it, which is fine for maintainers’ open-source work. They are local refs, so a plain git push doesn’t send them.
Check testbot over SSH:
ssh-keygen -F github.com >/dev/null || curl -fsSL https://api.github.com/meta | jq -r '.ssh_keys[] | "github.com " + .' >> ~/.ssh/known_hosts
ssh -T git@github.com
# Expect "Permission denied (publickey)"
ssh -G github.com | grep -i identityagent
# Expect "identityagent none"
gh auth status
# Expect "You are not logged into any GitHub hosts", unless you set a read-only GH_TOKEN
Then start a session with a repository selected, and ask Claude to run whoami, ssh -T git@github.com, git ls-remote origin HEAD and git status, and to call the GitHub MCP tool get_me. Expect testbot, the same SSH refusal, a commit hash, a clean checkout, and the GitHub login of the person who started the session.
macOS Disk Space Cleanup¶
Each provider on a shared macOS testbot keeps its own VM disk, which grows to its high-water mark and keeps every image it has pulled. Two things keep this in check:
testbot_maintenance.sh, run around every job, removes dangling images, returns freed blocks to the host withfstrim, deletes orphaned Mutagen caches and oldbuildxrefs, and prunes all unused images when less thanLOW_DISK_GB(40) GB is free.testbot_disk_cleanup.sh, run weekly by thetestbot-disk-cleanup.ymlpipeline, starts each provider in turn, removes everything it holds, and recreates a Podman or Lima VM whose container storage is still more than 70% full. It also prunes Apple Container’s own storage with thecontainerCLI.
To target one machine, the scheduled pipeline needs a testbot=<hostname> tag on each agent, for example tags="...,testbot=tb-macos-arm64-5". The nightly perf-*.yml pipelines use the same tag to run each leg on one machine. wsl2-test-runner-setup.sh adds it on WSL2 testbots; add it by hand on macOS and Windows. Configure the pipeline in the Buildkite dashboard pointed at .buildkite/testbot-disk-cleanup.yml, with a weekly Scheduled Build.
Performance Benchmark Harness Prerequisites¶
The nightly performance benchmark harness (perf/, see perf/README.md) needs Node.js on every testbot, for the Puppeteer-driven Drupal install metric (perf/metrics/03-drupal-install/). On Linux, Puppeteer’s downloaded Chrome build also needs a handful of OS shared libraries a bare testbot image doesn’t ship with.
WSL2 / Linux testbots (docker-ce or Docker Desktop’s WSL2 backend)¶
-
Install Node.js 22, matching the version
perf-linux.ymluses: -
Install Chrome’s runtime shared library dependencies. A bare Ubuntu 24.04 image is missing all of these; without them Puppeteer fails the first time it tries to launch Chrome, with an error like
error while loading shared libraries: libatk-1.0.so.0(or any of the others below, one at a time as each is fixed):sudo apt-get install -y \ libatk1.0-0t64 libatk-bridge2.0-0t64 libcups2t64 libasound2t64 \ libxkbcommon0 libgbm1 libx11-6 libxext6 libxcb1 libcairo2 \ libpango-1.0-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ libatspi2.0-0The
t64suffix on some of these is Ubuntu 24.04-specific: it renamed several packages during the 64-bittime_tABI transition (libatk1.0-0→libatk1.0-0t64, etc.). Older or non-Ubuntu distros use the un-suffixed names. This list was derived by runninglddagainst the actual downloaded Chrome binary (~/.cache/puppeteer/chrome/linux-*/chrome-linux64/chrome); if a future Chrome version needs more,ldd <path-to-chrome> | grep "not found"shows what’s still missing.
macOS testbots¶
Add node to the brew install list in step 13 of the macOS setup above.
Traditional (native) Windows testbots¶
Install Node.js with winget install -e OpenJS.NodeJS.LTS (see step 6 of Windows Test Agent Setup above). Confirmed working, including headless Chrome launching from the NSSM-installed buildkite-agent service context.
Running Targeted Builds on Specific Pipelines¶
To test a branch against only selected pipelines (e.g. WSL2 only) or to run a subset of tests without waiting for the full matrix:
- Push your branch to upstream.
- In the Buildkite dashboard, open the pipeline you want (e.g. “wsl2-mirrored”).
- Click New Build and set the branch to your branch name.
-
Expand Environment Variables and add:
Adjust the
-runpattern to match the tests you want. Use a common prefix where possible. If you need|for alternation, wrap the regular expression in single quotes so the shell does not interpret the pipe as a pipeline operator:TESTARGSdefaults to-failfastwhen not set, so include-failfastexplicitly if you want it. -
Click Create Build.
Use [skip ci] in your commit message to prevent all pipelines from triggering automatically when you push, then manually trigger only the pipelines you need. To skip that manual step, put [only <pipeline> ...] in the commit subject instead, such as [only macos-socktainer], and only the named pipelines run their tests. See Running Only Some Buildkite Pipelines.