From aa917bd7cbf46fb5cab4aa8a45d374a9476738ac Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Sun, 23 Jul 2023 15:15:28 +0200 Subject: Add buildbot blog post --- _posts/2023-07-23-reconfig-buildbot.md | 60 ++++++++++++++++++++++++++++++++++ assets/buildbot.svg | 3 ++ 2 files changed, 63 insertions(+) create mode 100644 _posts/2023-07-23-reconfig-buildbot.md create mode 100644 assets/buildbot.svg diff --git a/_posts/2023-07-23-reconfig-buildbot.md b/_posts/2023-07-23-reconfig-buildbot.md new file mode 100644 index 0000000..2e97071 --- /dev/null +++ b/_posts/2023-07-23-reconfig-buildbot.md @@ -0,0 +1,60 @@ +--- +layout: post +title: Reconfiguring Buildbot / Buildbot short intro +date: 2023-07-23 14:49 +0200 +lang: en +categories: tech +--- + +Recently, I started moving my repositories from [Gitea](https://gitea.io/) +to [Gitolite](https://gitolite.com/). Main reason was that I forgot to +regularly update my Gitea instance, it's a program that constantly runs +in the background, and I wasn't using the Issues / Wiki / etc. features +anyway. Technically, a very simple bare repo would do the trick as well, +since I'm the only user. But why not try something out while I'm at it? + +(Gitea is a project / source management system, think of a self-hosted version +of Github. +Gitolite is a small program that gets called when you +`git fetch` or `git push` and determines if your ssh public key has +the permissions to perform the operation. It manages the repositories +and allows for pretty fine-grained access control.) + +Because I didn't look properly, I didn't find the `git_buildbot.py` script +anymore. (It's in the +[buildbot-contrib](https://github.com/buildbot/buildbot-contrib/blob/master/master/contrib/git_buildbot.py) +repo btw). Also, it annoyed me that buildbot created a build for every +single change (commit), even though I had the `collapseRequests` +config option set to `True`. (Spoiler alert. Turns out I had +the `treeStableTimer` of the `SingleBranchScheduler` set to `None`.) + +So I actually went through the documentation headings, noticed "Change Hooks" and +thought "Oh, surely this is the solution!". I only enabled the `base` +dialect and tried various curl requests, which resulted in changes being +submitted, but no builds being triggered. Clarification set in when I re-read +my `master.cfg` again and saw that the `SingleBranchScheduler` had +a filter set to only build on the master branch. After facepalming at myself, +the curl request + + curl -v "http://localhost:8010/change_hook?comments=force_build&author=uvok&branch=master" + +indeed triggered a build! Since I don't care about the actual +commit messages being shown in buildbot, this would be the perfect +solution! + +However, at this point I also discovered that the `treeStableTimer` was +set to `None` (see above), so I decided to keep using the provided +`git_buildbot.py` script. - Even though that means I have to install +`python3-twisted` globally on the system (since I don't wanna figure +out how to activate a venv from a git hook). + +Anyway, here's a very simplified diagram of the buildbot architecture: + +![Buildbot architecture](/assets/buildbot.svg) + +Note that the [Buildbot documentation](https://docs.buildbot.net/latest/manual/introduction.html) +has a far more detailed diagram. + +Morale of the story: Read the manual, even if it's frustrating if you just want to +get a single small thing done. ;) + diff --git a/assets/buildbot.svg b/assets/buildbot.svg new file mode 100644 index 0000000..ddab44c --- /dev/null +++ b/assets/buildbot.svg @@ -0,0 +1,3 @@ + + +
Change Source
Change Source
Changes
Changes
Master
Master
Build
Build
Scheduler
Scheduler
Worker
Worker
Change Hook
Change Hook
Text is not SVG - cannot display
\ No newline at end of file -- cgit v1.2.3