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.
Windows Test Agent Setup¶
- Create the user "testbot" on the machine. The password should be the password of ddevtestbot@gmail.com (available in lastpass)
- In admin PowerShell,
wsl --install
- In admin PowerShell,
Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "RemoteSigned"
- In admin PowerShell, download and run windows_buildkite_start.ps1 (Use
curl <url> -O windows_buildkite_start.ps1
) - After restart, in administrative git-bash window,
Rename-Computer <testbot-win10(home|pro)-<description>-1
and thenexport BUILDKITE_AGENT_TOKEN=<token>
- Now download and run
windows_buildkite-testmachine_setup.sh
- Download and run windows_postinstall.sh
- Launch Docker. It may require you to take further actions.
- Log into Chrome with the user ddevtestbot@gmail.com and enable Chrome Remote Desktop.
- Enable gd, fileinfo, and curl extensions in /c/tools/php*/php.ini
- If a laptop, set the "lid closing" setting in settings to do nothing.
- 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 the "require a password to log in".
-
The buildkite/hooks/environment.bat file must be updated to contain the docker pull credentials:
-
Set the buildkite-agent service 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 can access NFS, has testbot git config, etc).
git config --global --add safe.directory '*'
- Manually run
testbot_maintenance.sh
,curl -sL -O https://raw.githubusercontent.com/drud/ddev/master/.buildkite/testbot_maintenance.sh && bash testbot_maintenance.sh
- Run
.buildkite/sanetestbot.sh
to check your work. - Reboot the machine and do a test run. (On windows the machine name only takes effect on reboot.
- Verify that go, ddev, git-bash are 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 latest kernel.
Additional Windows setup for WSL2 testing¶
- Do not set up buildkite-agent on the Windows side, or disable it.
- Open WSL2 and check out ddev
- Install buildkite-agent in WSL2 and configure it. It needs the same changes as macOS, but tags
tags="os=wsl2,architecture=amd64,dockertype=dockerforwindows"
and build-path should be in~/tmp/buildkite-agent
- As root user, run
.github/workflows/linux-setup.sh
- As root user, add sudo capability with
echo "ALL ALL=NOPASSWD: ALL" >/etc/sudoers.d/all && chmod 440 /etc/sudoers.d/all
- Test from PowerShell that
wsl -d Ubuntu buildkite-agent start
succeeds and starts listening. Set up Windows to automatically start WSL2 buildkite-agent: Use task scheduler to create a simple task that runsC:\Windows\System32\wsl.exe -d Ubuntu buildkite-agent start
at login. - Install homebrew,
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Manually run
testbot_maintenance.sh
,curl -sL -O https://raw.githubusercontent.com/drud/ddev/master/.buildkite/testbot_maintenance.sh && bash testbot_maintenance.sh
git config --global --add safe.directory '*'
-
The buildkite/hooks/environment file must be updated to contain the docker pull credentials:
macOS Test Agent Setup (works for M1 as well)¶
- Create the user "testbot" on the machine. The password should be the password of ddevtestbot@gmail.com.
- Change the name of the machine to something in keeping with current style. Maybe
testbot-macstadium-macos-3
. - Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install golang/git/docker with
brew install buildkite/buildkite/buildkite-agent bats-core colima composer drud/ddev/ddev git golang jq mariadb mkcert netcat p7zip && brew install --cask docker iterm2 google-chrome nosleep ngrok
- Run
ngrok config add-authtoken <token>
with token for free account. mkcert -install
- Run Docker manually and go through its configuration routine.
- Run iTerm. On Mojave and higher it may prompt for requiring full disk access permissions, follow through with that.
- Set up nfsd by running
macos_ddev_nfs_setup.sh
git config --global --add safe.directory '*'
- Edit the buildkite-agent.cfg in
/usr/local/etc/buildkite-agent/buildkite-agent.cfg
or/opt/homebrew/etc/buildkite-agent/buildkite-agent.cfg
to add- the agent token
- Tags, like
"os=macos,architecture=arm64,osvariant=monterrey,dockertype=dockerformac"
build-path="~/tmp/buildkite-agent/builds"
-
The buildkite/hooks/environment file must be updated to contain the docker pull credentials
-
brew services start buildkite-agent
- Manually run
testbot_maintenance.sh
,curl -sL -O https://raw.githubusercontent.com/drud/ddev/master/.buildkite/testbot_maintenance.sh && bash testbot_maintenance.sh
- Enable nosleep using its shortcut in the Mac status bar.
- In nosleep Preferences, enable "Never sleep on AC Adapter", "Never sleep on Battery", and "Start nosleep utility on system startup".
sudo chown testbot /usr/local/bin
- Set up Mac to automatically log in on boot.
- Try checking out ddev and running
.buildkite/sanetestbot.sh
to check your work. - Log into Chrome with the user ddevtestbot@gmail.com and enable Chrome Remote Desktop.
- Set the timezone properly (US MT)
- Start the agent with
brew services start buildkite-agent