summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_posts/2023-07-23-reconfig-buildbot.md60
-rw-r--r--assets/buildbot.svg3
2 files changed, 63 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" style="background-color: rgb(255, 255, 255);" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="701px" height="221px" viewBox="-0.5 -0.5 701 221"><defs/><g><rect x="354" y="0" width="146" height="220" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><path d="M 120 110 L 143.63 110" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 148.88 110 L 141.88 113.5 L 143.63 110 L 141.88 106.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="0" y="80" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 110px; margin-left: 1px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Change Source</div></div></div></foreignObject><text x="60" y="114" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Change Source</text></switch></g><rect x="150" y="80" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><rect x="160" y="90" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><path d="M 290 130 L 373.63 130" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 378.88 130 L 371.88 133.5 L 373.63 130 L 371.88 126.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="170" y="100" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 130px; margin-left: 171px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Changes</div></div></div></foreignObject><text x="230" y="134" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Changes</text></switch></g><rect x="354" y="0" width="146" height="30" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 144px; height: 1px; padding-top: 15px; margin-left: 355px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Master</div></div></div></foreignObject><text x="427" y="19" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Master</text></switch></g><path d="M 460 130 L 573.63 130" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 578.88 130 L 571.88 133.5 L 573.63 130 L 571.88 126.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 1px; height: 1px; padding-top: 130px; margin-left: 520px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); "><div style="display: inline-block; font-size: 11px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; background-color: rgb(255, 255, 255); white-space: nowrap;">Build</div></div></div></foreignObject><text x="520" y="133" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="11px" text-anchor="middle">Build</text></switch></g><rect x="380" y="80" width="80" height="100" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 78px; height: 1px; padding-top: 130px; margin-left: 381px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Scheduler</div></div></div></foreignObject><text x="420" y="134" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Scheduler</text></switch></g><rect x="580" y="100" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 130px; margin-left: 581px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Worker</div></div></div></foreignObject><text x="640" y="134" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Worker</text></switch></g><path d="M 120 190 L 140 190 L 140 140 L 130 140 L 130 125 L 143.63 125" fill="none" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 148.88 125 L 141.88 128.5 L 143.63 125 L 141.88 121.5 Z" fill="rgb(0, 0, 0)" stroke="rgb(0, 0, 0)" stroke-miterlimit="10" pointer-events="all"/><rect x="0" y="160" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 190px; margin-left: 1px;"><div style="box-sizing: border-box; font-size: 0px; text-align: center;" data-drawio-colors="color: rgb(0, 0, 0); "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Change Hook</div></div></div></foreignObject><text x="60" y="194" fill="rgb(0, 0, 0)" font-family="Helvetica" font-size="12px" text-anchor="middle">Change Hook</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.drawio.com/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg> \ No newline at end of file