Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Slack Engineering 12 min read Case study mediumAdept

Advancing Our Chef Infrastructure

Slack evolved its Chef setup for tens of thousands of EC2 instances from a single stack, where every cookbook change hit all environments at once on the hour, into multiple sharded Chef stacks with versioned cookbook rollouts. New nodes are assigned to shards via Route53 weighted CNAMEs. Chef search for node discovery was replaced with Consul lookups run inside ruby_block resources and lazy evaluation, which breaks a circular dependency on the Nebula overlay network. A fan-out search service (Shearch) and a Go Knife replacement (Gnife) restore fleet-wide queries, and a new Chef Librarian service uploads timestamp-versioned cookbooks to all stacks and promotes them environment by environment, with state tracked in DynamoDB.

Assumes: Chef cookbooks and rolesAWS EC2/S3/SQSservice discovery basics

Related posts

  • Advancing Our Chef Infrastructure: Safety Without Disruption

    Slack Engineering mediumAdept

    Slack split its single production Chef environment into six AZ-mapped environments (prod-1 to prod-6) so newly provisioned nodes no longer pull a possibly bad config from one shared source during scale-outs. prod-1 acts as an hourly canary taking the latest cookbook artifact, while prod-2 through prod-6 advance on a release train where a new version starts only after the previous one reaches prod-6. Because rollout timing is now variable, fixed cron-scheduled Chef runs were replaced by Chef Summoner, an on-node service that polls S3 signals written by Chef Librarian, applies a configurable splay, and still forces a run every 12 hours for compliance. The tradeoff is slower fleet-wide propagation in exchange for a smaller blast radius per AZ. Slack chose this over migrating to Chef Policyfiles to avoid making dozens of teams rewrite their cookbooks.

  • Shipyard: How We Built Slack’s Next-Generation EC2 Platform

    Slack Engineering mediumAdept

    Shipyard is Slack's EC2 platform that replaces continuously Chef-converged, long-lived instances with immutable, layered AMIs deployed through progressive, metric-gated rollouts. A shared hardened base image, slack-zero, is built with AWS Image Builder and published via SSM parameters, and EventBridge and Lambda trigger rebuilds of service images layered on top. Heavy work happens at bake time and only secrets and environment config are applied at boot, so instances come up in seconds. The Gondola orchestrator rolls out AMI plus versioned Chef artifacts through ASG Instance Refresh or Karpenter executors with automatic rollback. Instances are short-lived and regularly rotated, secrets refresh via Consul Template from Vault, and a Peekaboo inventory built on EventBridge, OpenSearch and Lambda gives near real-time fleet visibility.

  • BuildRock: A Build Platform at Slack

    Slack Engineering mediumAdept

    Slack consolidated its sprawling, hand-managed "snowflake" Jenkins clusters into BuildRock, a build-as-a-service platform. Jenkins controllers run statelessly on Kubernetes, configured through the Configuration-as-Code (casc) plugin and Jinja2 templates, and every change flows through GitOps, so a cluster can be rebuilt identically from Git. State such as build history lives on EFS with automated backups, plugins come from central storage, vulnerability scanning runs on every build, and test and pre-staging clusters catch problems before production. Rollout was incremental: controllers moved to Kubernetes before agents, with static EC2 agents alongside ephemeral pods, and old clusters were kept on standby for fast rollback under a shared ownership model with service teams.

  • How We Use Terraform At Slack

    Slack Engineering mediumAdept

    Slack runs roughly 1,400 Terraform state files across AWS, GCP, DigitalOcean and NS1, split per account, region and large service so each change touches fewer resources. State lives in a versioned S3 backend with DynamoDB locking and is deployed by Jenkins plan/apply pipelines chained through sandbox and dev before production, while engineers plan safely from read-only "Ops" boxes. After a painful quarter-long 0.11→0.12 upgrade, the team built a wrapper that installs multiple Terraform and provider versions and picks one per state file from versions.tf. They also wrote a Go-based upgrade tool that checks remote-state dependencies and plans after upgrading. Modules moved from relative paths and git refs to an internal S3-backed catalog of versioned tarballs, which state files pin via vendored_modules.

  • Infrastructure Observability for Changing the Spend Curve

    Slack Engineering mediumAdept

    Slack bent the growth curve of its webapp CI spend, which had been rising about 10% month over month, by using observability (dashboards, metrics and tracing) to drive three changes. Adaptive capacity standardized instance types and oversubscribed executors per instance after profiling vCPU and executor-count combinations, cutting costs about 70% and error rates about 50% while targeting 50% busy executors at peak. Circuit breakers in the Checkpoint orchestrator defer or cancel CI work when downstream services such as Jenkins, Vitess, Flannel or Search degrade, which stops cascading failures. Tracing the Cypress test runtime exposed runtime variables tied to flakiness, which had been burning roughly 90k compute hours a week.

The quest for software engineering knowledge.

Look:
Layout: