nayaread
HomeFavouritesTopicsSources
HomeFavouritesTopicsSources
NayaRead links to original engineering blogs. All copyright belongs to the respective authors.
Shopify Engineering·Jul 15, 2022·11 min read49

Spin Infrastructure Adventures: Containers, Systemd, and CGroups - Shopify

The Spin infrastructure team works hard at improving the stability of the system. In February 2022 we moved to Container Optimized OS (COS), the Google maintained operating system for their Kubernetes Engine SaaS offering. A month later we turned on multi-cluster to allow for increased scalability as more users came on board. Recently, we’ve increased default resources allotted to instances dramatically. However, with all these changes we’re still experiencing some issues, and for one of those, I wanted to dive a bit deeper in a post to share with you. Spin’s Basic Building Blocks First it's important to know the basic building blocks of Spin and how these systems interact. The Spin infrastructure is built on top of Kubernetes, using many of the same components that Shopify’s production applications use. Spin instances themselves are implemented via a custom resource controller that we install on the system during creation. Among other things, the controller transforms the Instance custom resource into a pod that’s booted from a special Isospin container image along with the configuration supplied during instance creation. Inside the container we utilize systemd as a process manager and workflow engine to initialize the environment, including installing dotfiles, pulling application source code, and running through bootstrap scripts. Systemd is vital because it enables a structured way to manage system initialization and this is used heavily by Spin. There’s definitely more to what makes Spin then what I’ve described, but from a high level and for the purposes of understanding the technical challenges ahead it's important to remember that: Spin is built on Kubernetes Instances are run in a container systemd is run INSIDE the container to manage the environment. First Encounter In February 2022, we had a serious problem with Pod relocations that we eventually tracked to node instability. We had several nodes in our Kubernetes clusters that would randomly fail and require either a reboot or to be replaced entirely. Google had decent automation for this that would

DockerKubernetes
Read original on shopify.engineering

Score breakdown

  • Technical depth84
  • Practical value30
  • Originality85
  • Writing quality97
  • Source reputation0
  • Recency0
  • External engagement0
  • On-site engagement0

NayaRead shows a summary and links to the original article. The full article is hosted on shopify.engineering.

More like this

The Cloudflare Blog

The next generation of MCP

Matt Carey·Aug 6, 2026·10 min read
The Cloudflare Blog

Our container platform is in production. It has GPUs. Here’s an early look

Sep 27, 2024·26 min read
Shopify Engineering

The Story Behind Shopify’s Isospin Tooling - Shopify

Jul 5, 2022·11 min read
Shopify Engineering

How Shopify Governs Containers at Scale with Grafeas and Kritis - Shopify

Oct 12, 2017·5 min read