Closed
Description
Currently, all web requests are served from the same server that performs the crate builds. This has given us trouble in the past, since builds consume a lot of resources, driving up response times for web requests. It would be useful to instead have different servers for the website and builds.
Possible implementation:
- The web server continues having primary access to the database. Builders don't have access at all, but instead receive webhooks (or similar) telling them to start a build. When the build finishes, they report back to the main server.
- We have a 'heartbeat' mechanism similar to crater: if a build server doesn't send a message to the web server in 5 minutes, we mark it as crashed
- We have a new state for crates in the queue:
queued
,finished
, andassigned
, whereassigned
means there is a build server currently building that crate (Add crates to the database before building them #1011).
Benefits:
- We could build multiple crates at a time much more easily (alleviating some of the trouble from stop building crates on all targets #343) just by having more build servers. This requires Add crates to the database before building them #1011 first.
- We could potentially target more architectures without cross-compiling, by having build servers that are e.g. hosted on ARM.
- We could eventually share some build resources with crater.
@pietroalbini has experience with implementing this for crater and is helping a lot with the design aspect.