What are Runners in CI/CD?

In the world of DevOps and Continuous Integration (CI/CD), Runners (also called Agents or Workers) are the machines or processes that actually execute the steps defined in your pipeline. If the pipeline is the "instruction manual," the Runner is the "mechanic" that does the work.

runners in ci cd

1. How Runners Work

When you push code to a repository (like GitHub or GitLab), the system triggers a job. A Runner picks up that job, performs the actions, and reports the results back.

  • Pick up: The runner polls the server for available jobs.
  • Execute: It runs commands like npm install, pytest, or docker build.
  • Report: it sends the logs and exit status (Success/Fail) back to the UI.

2. Types of Runners

Runners can exist in different environments depending on your project needs:

  • Shell Runners: Executes commands directly on the host machine's terminal.
  • Docker Runners: Runs each job inside a fresh, isolated container. This is the most common for modern web dev.
  • Kubernetes Runners: Automatically scales runners up and down as pods within a cluster.

3. Hosted vs. Self-Hosted

Feature Cloud-Hosted (e.g., GitHub Actions) Self-Hosted
MaintenanceManaged by the provider (Zero effort)Managed by YOU (Security, OS updates)
PerformanceStandard specs, might be slowerCan use high-end hardware/GPUs
SecurityClean environment for every runAccess to your private local network
CostPay per minute or limited free tierCost of your own server/electricity

Knowledge Check

1. What is the primary job of a Runner?
A) To store the code | B) To execute the commands in a pipeline | C) To design the UI

2. Why would a company choose a "Self-Hosted" runner?
A) It's always free | B) To use specific hardware or access private networks | C) Because they don't have internet

3. Which runner type provides the best isolation between jobs?
A) Shell Runner | B) Docker Runner | C) Manual Runner