Skip to content

Instantly share code, notes, and snippets.

@aslushnikov
Last active July 23, 2020 18:36
Show Gist options
  • Save aslushnikov/a0bd658b575022e198443f856b5185e7 to your computer and use it in GitHub Desktop.
Save aslushnikov/a0bd658b575022e198443f856b5185e7 to your computer and use it in GitHub Desktop.

Setting up new Ubuntu 20.04 buildbot on Azure

Recording of my steps to setup Ubuntu 20.04 buildbot VM on July 22, 2020. The bot is responsible for WebKit builds.

  1. Update apt-get & install clang-9 to be consistent with Ubuntu 18.04 bot.
~$ sudo apt-get update
~$ sudo apt-get install clang-9
~$ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
~$ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100
  1. Azure VM has /mnt that belongs to root. Create a cron folder that will hold all our cron-based processing
~$ cd /mnt
/mnt$ sudo mkdir cron
/mnt$ sudo chown azureuser:azureuser cron
  1. Clone Playwright into cron directory
/mnt$ cd /mnt/cron
/mnt/cron$ git clone https://github.com/microsoft/playwright
  1. Install NVM to manage Node.js + NPM versions. Instructions generally live at NVM official readme. As of July 2020, I did the following:
/mnt/cron$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
/mnt/cron$ source ~/.bashrc # to get updated bin paths
  1. Install Node.js + Npm using NVM
/mnt/cron$ nvm install stable
  1. Just in case, install all dependencies for Playwright project
/mnt/cron$ cd /mnt/cron/playwright
/mnt/cron/playwright$ npm install
  1. Prepare checkout for WebKit.
/mnt/cron/playwright$ ./browser_patches/prepare_checkout.sh webkit
  1. Install WebKit dependencies
/mnt/cron/playwright$ ./browser_patches/webkit/checkout/Tools/gtk/install-dependencies
/mnt/cron/playwright$ ./browser_patches/webkit/checkout/Tools/wpe/install-dependencies
  1. Build WebKit
/mnt/cron/playwright$ ./browser_patches/webkit/build.sh

Build completed successfully, so browser toolchain is operational. 🎉

  1. Install Azure CLI using official docs
/mnt/cron/playwright$ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
  1. Setup crontab to run buildbot scripts. Important parts here are:
    • MAILTO="" to disable mail spam
    • PATH="..." has to be copied from the actual azureuser path, since cron jobs run with a very basic PATH.
MAILTO=""
PATH="/home/azureuser/.nvm/versions/node/v14.6.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
AZ_ACCOUNT_KEY="<KEY>"
AZ_ACCOUNT_NAME="<NAME>"
TELEGRAM_BOT_KEY="<TG_KEY>"
*/5 * * * * /mnt/cron/playwright/browser_patches/buildbots/buildbot-ubuntu-20.04.sh >/tmp/buildbot-ubuntu-20.04-cronjob.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment