SPCS Dev Container

Open a browser. Start coding inside Snowflake.

VS Code, a web terminal and persistent storage on Snowflake Container Services.

Kevin Keller ยท kevinkeller.org

Why it matters

SPCS is not just for production

It is a fully managed container runtime with compute pools, persistent storage, network isolation and auto-suspend. That makes it a surprisingly good development platform.

Think of it as IaaS powered by Snowflake.

What you get

A complete toolbox in one container

ComponentPurpose
OpenVSCode ServerVS Code in the browser
ttydWeb terminal
supervisord (Go)Restarts crashed services
Pixi and asdfPython, Node, Rust and 600+ plugins
GitHub CLIPull requests and issues

Access

Two endpoints, both behind Snowflake authentication

  • One URL for VS Code, one for the terminal
  • Only users with the right role can reach them
  • No local Docker, no SSH keys, no port forwarding

The idea

You are already inside Snowflake's network

Query data, manage objects and test UDFs with no VPN, no firewall rules and no connection strings to the internet.

Setup

Four steps to a running IDE

  1. Build and push the image (linux/amd64)
  2. Create the database, image repository and compute pool
  3. Deploy the service from its specification
  4. Get your URLs with SHOW ENDPOINTS

Persistence

Your home directory lives on a Snowflake stage

PersistsDoes not persist
Pixi and asdf toolsapt-installed packages
Code in ~/workspace/tmp files
Dotfiles and historyRunning processes
VS Code extensionsEnvironment variables

Cost

When the pool is suspended, cost is zero

  • Auto-suspend after 1 hour of inactivity by default
  • Shorten it, for example AUTO_SUSPEND_SECS = 900
  • Pay only for compute time; stage storage costs pennies

Customisation

Bigger, tighter or richer, without losing data

  • More power: switch the instance family
  • Tighter network: egress rules for named hosts only
  • More tools: add packages to the Dockerfile
  • Safe updates: rebuilding the image keeps the volume

The takeaway

A compute pool with auto-suspend and a stage is a full development platform.

Read the full article

Code: github.com/sfc-gh-kkeller/spcs-devcontainer (MIT)