Separate the web UI from the build engine (buildbot multi-master)
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- build-system, ci-cd, devops
調査の方向性
master.cfg と提案された master_role から始め、続いてローカルの Crossbar プロトタイプと、2 つ目の basedir、Consul への登録、監視、liveness probing に必要な psf-salt の作業を確認します。engine が利用できない場合に webhook の変更が暗黙に破棄されないことを検証し、本番環境の分離と systemd による監視によって、OOM のケースと inactive-router のケースの両方から復旧できることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Followup from the Europython discussions.
buildbot.python.org is one Twisted process that serves both the web UI and talks to all workers, so web load and build scheduling are competing. #755 demonstrates the issue with that, ~34 requests/second from crawlers, and it was OOM-killed twice, each time needing a manual restart. python/psf-salt#644 reduced the traffic but this proposal may help resolve the problem at its core I think.
Proposal
Use buildbot's multi-master support to run two masters against the shared database: an engine (workers, builders, schedulers, reporters, janitor) and a ui (web server, change hooks, dashboards, force scheduler).
The same-host split doesn't need DNS or load-balancer changes, buildbot.python.org already goes through HAProxy, and workers connect straight to the host via buildbot-api.python.org, which stays with the engine. And multi-master does not reduce database load but it multiplies the scheduling queries per engine, so two engines is I think the proper way on the current 2 vCPU / 4 GB Postgres (btw is it possible to upgrade the host?).
Risks
A webhook can be accepted and then never built as the split introduces this so if it's merged it must not go to production until it is fixed.
The hook runs on the ui master and the schedulers on the engine. If the engine is down when a webhook arrives:
- the ui stores the change and answers 200, so GitHub does not retry
- the event goes onto a transient queue with nobody listening, so it is dropped
- the engine never recovers it on restart, because schedulers only re-scan changes they had already classified
Today the hook and the schedulers share one process, so a restart gives GitHub an error and a retry instead of a silent loss.
The likely fix is to run the branch schedulers on the ui master next to the hook: buildrequests are recovered at startup, changes are not.
Losing the router can hang the masters. Buildbot's documentation says a master stops when it loses its connection to the router. Tested that scenario and the master does not stop, it closes its ports and marks itself inactive, but the process stays alive, so restarting on exit does not cover this situation.
Upstream calls multi-master experimental, the WAMP queue has no authentication so it needs to stay on loopback, and a possible split across hosts needs shared storage for /data/www/buildbot/test-results/.
A rough plan
- master_role in master.cfg, defaulting to today's behaviour.
- Local prototype against crossbar, which I've already done and it works.
- psf-salt: crossbar, second basedir, Consul registration, supervision with a liveness probe, replacing the current make update-master and @reboot path.
- Engine/ui split in production, once the webhook gap is resolved.
Points 3 and 4 will need psf-salt work.
Also the master should run under a systemd unit as now it starts from a @reboot cron entry, so when it was OOM-killed in #755 nothing restarted it. A unit with Restart= fixes could fix that but if the split happens, the unit also needs a liveness check that probes the port, because losing the router leaves the process alive but not serving.
- 主要言語
- Python
- スター
- 61
- フォーク
- 61
- 平均マージ
- 23時間 44分
- マージ済み PR(30日)
- 12
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/buildmaster-config のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
python/buildmaster-config#654 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
python/buildmaster-config#631 · コメント 1 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
python/buildmaster-config#566 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
python/buildmaster-config#454 · コメント 7 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
python/buildmaster-config#70 ·
python/buildmaster-config の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
CSCfi/sd-search-api#39 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
StevenBlack/hosts#3255 ·