Design a CI/CD System
HardSystem design · Developer Tools
Design a CI/CD platform that runs builds, tests and deployments when developers push code. Pipelines are defined in the repository and executed on isolated runners.
In scope: trigger and pipeline planning as a job graph, scheduling and runner pools, isolation and secrets, caching, artifacts and logs, retries and flaky tests, and deployment gates. Out of scope: the source hosting system and the deployment targets' internals.
Requirements
- Support pipeline DAGs, dependencies, partial rerun and cancellation of superseded runs
- Treat all jobs as untrusted: ephemeral isolated runners, scoped short-lived secrets, no secrets for untrusted branches
- Cache dependencies by lockfile hash with trust-scoped caches
- Keep logs, artifacts, statuses and a deployment audit trail; promote the same artifact across environments