Company
Date Published
Oct. 31, 2024
Author
Serena Shah-Simpson, Jacob Hands, Natalie Rogers
Word count
2817
Language
English
Hacker News points
None

Summary

The Cloudflare platform has launched a new feature called Workers Builds, which integrates Continuous Integration and Delivery (CI/CD) workflow into its Workers platform. This allows users to build and deploy full-stack applications and simple static websites with minimal developer overhead. The system is built on top of the Workers platform using Durable Objects, Hyperdrive, Workers Logs, and Smart Placement. The design problem was how to pick up a commit from GitHub or GitLab and start a containerized job that can clone the repo, build the project, and deploy a Worker. The solution uses a Client Worker to connect to a PostgreSQL database, a Build Management Worker to run and monitor builds, and Durable Objects to manage individual builds. Alarms are used to check for healthy startup and terminate builds that run longer than 20 minutes. Smart Placement and location hints reduce latency costs by serving requests close to the database. Workers Logs provide fast and easy-to-use logs directly within the Cloudflare dashboard, while JavaScript-native RPC enables almost no boilerplate code. The system has been tested using Vitest and workerd for unit tests and cross-worker integration tests. It is expected to be released soon with build caching, which will speed up customer builds by avoiding redownloading dependencies from NPM or rebuilding projects from scratch.