Guides users through deploying the TPC-H interactive dashboard (FastAPI + Chart.js) and Locust load test to Snowpark Container Services (SPCS).
Prerequisites
uvinstalled (Python package runner)- A Snowflake connection configured in
~/.snowflake/connections.toml - Role with privileges to create compute pools and services (e.g.
SYSADMINorACCOUNTADMIN) - Docker installed
- TPC-H tables already set up (run the
interactive-tpch-benchmarkskill's setup first)
Workflow
Step 1: Detect Intent
Ask the user what they want to do:
- Deploy dashboard — Deploy the FastAPI dashboard + Locust load test to SPCS
- Check status — Show SPCS service status and ingress URLs
- Update — Rebuild and redeploy without changing URLs
- Teardown — Remove SPCS services and compute pools
Route to the matching section below.
Deploy Dashboard to SPCS
Goal: Deploy the FastAPI + Chart.js dashboard and Locust load test to Snowpark Container Services.
Actions:
-
Ensure
.envexists intpc-h-sample-dashboard/:cp tpc-h-sample-dashboard/.env.example tpc-h-sample-dashboard/.env -
Ask the user for:
CONNECTION_NAME— Snowflake connectionSOLUTION_NAME— same as used for TPC-H setup (default:IW_TPCH)DEFAULT_SCALE— scale for the dashboard queries
-
Update
tpc-h-sample-dashboard/.envwith the values. -
Ensure
tpc-h-sample-dashboard/spcs/config.envexists (create from template if missing):cp tpc-h-sample-dashboard/spcs/config.env.template tpc-h-sample-dashboard/spcs/config.envThen review — key settings:
CONNECTION— Snowflake connection for SPCS deploymentROLE— role for creating SPCS objects (default:ACCOUNTADMIN)DEPLOY_WAREHOUSE— warehouse for deploy SQL sessionSOLUTION_NAME— must match the value intpc-h-sample-dashboard/.envDEFAULT_SCALE— must match the scale intpc-h-sample-dashboard/.env
-
Create the denormalized dashboard table:
cd <REPO_ROOT>/tpc-h-sample-dashboard/spcs && ./deploy.sh sql -
Deploy SPCS services (builds Docker images, pushes, creates compute pools and services):
cd <REPO_ROOT>/tpc-h-sample-dashboard/spcs && ./deploy.sh services
Services deployed:
DASHBOARD— browser UI + API (dashboard compute pool)DASHBOARD_API_LOCUST— isolated API copy for load testing (locust compute pool)DASHBOARD_LOCUST— Locust load generator (locust compute pool)
After deployment: The script prints ingress URLs. Open the dashboard URL in a browser (Snowflake login prompts on first visit).
Check Status
cd <REPO_ROOT>/tpc-h-sample-dashboard/spcs && ./status.sh
Options:
./status.sh --wait— poll until all services are READY./status.sh --urls-only— print only ingress URLs
Update Dashboard (rebuild without changing URLs)
cd <REPO_ROOT>/tpc-h-sample-dashboard/spcs && ./update.sh
Teardown
SPCS services (drops services, compute pools, image repo):
cd <REPO_ROOT>/tpc-h-sample-dashboard/spcs && ./teardown.sh
Stopping Points
- After detecting intent — confirm the action before proceeding
- After collecting configuration values — confirm
.envcontents before running setup - Before
deploy.sh services— warn that this builds Docker images and creates compute pools (cost implications) - Before teardown — confirm which resources to drop
Troubleshooting
| Issue | Solution |
|---|---|
uv: command not found |
Install uv: curl -LsSf https://astral.sh/uv/install.sh | sh |
| Docker build fails | Ensure Docker daemon is running; check docker info |
| Service stuck in PENDING | Run ./logs.sh to inspect container logs |
| Service FAILED | Check ./logs.sh; common cause is missing grants or network rules |
| Connection errors | Verify connection name exists in ~/.snowflake/connections.toml |
Output
- Running SPCS services with public ingress URLs for the dashboard and Locust UI