Design a CI/CD System

Access ControlQueues OpenAI

Design a CI system like GitHub Actions. When code is pushed, workflows defined in the repository run jobs on build machines, stream their logs live, and report pass or fail back on the commit.

Functional:

  • Trigger workflows on push, pull request, schedule, or manually.
  • Run each workflow's jobs on fresh runners, respecting dependencies between jobs.
  • Stream logs live and keep them for 90 days; store build artifacts.
  • Give jobs secrets (deploy keys, tokens) without exposing them in logs or to untrusted forks.
  • Report status on the commit and let users cancel or re-run.

Non-functional:

  • A job starts within 30 seconds of being runnable at p95.
  • One organization cannot use the whole runner fleet.
  • A runner crash marks its job failed or retries it; jobs never hang forever.
  • 2 million workflow runs a day, 8 million jobs; peaks after the workday starts in each timezone.
  • 50,000 concurrent jobs at peak, each in its own VM.
  • Logs average 2 MB per job; artifacts 200 MB per run.

The build tools themselves, the code review UI, and billing.

System design
Loading editor...