A D3.js + Svelte visualization app for root cause analysis, deployed as a Snowflake Native App with Snowpark Container Services (SPCS).
/query-ui/ panelnpm install
npm run dev
snow CLI configureddocker build --platform linux/amd64 -t decomp-tree:latest .
docker tag decomp-tree:latest <registry-url>/decomp-tree:latest
docker push <registry-url>/decomp-tree:latest
CREATE SERVICE DECOMP_TREE_SERVICE
IN COMPUTE POOL <pool_name>
FROM SPECIFICATION $$
spec:
containers:
- name: app
image: /<db>/<schema>/<repo>/decomp-tree:latest
env:
SNOWFLAKE_WAREHOUSE: COMPUTE_WH
endpoints:
- name: ui
port: 8080
public: true
$$;
If published as a Native App:
-- Install the app
CREATE APPLICATION DECOMP_TREE_APP
FROM APPLICATION PACKAGE DECOMP_TREE_PKG
USING VERSION V5;
-- Grant required privileges
GRANT USAGE ON COMPUTE POOL <pool_name> TO APPLICATION DECOMP_TREE_APP;
GRANT BIND SERVICE ENDPOINT ON ACCOUNT TO APPLICATION DECOMP_TREE_APP;
-- Start the service
CALL DECOMP_TREE_APP.APP_SCHEMA.START_SERVICE('<pool_name>');
-- Get the URL
SHOW ENDPOINTS IN SERVICE DECOMP_TREE_APP.SERVICE_SCHEMA.DECOMP_TREE_SERVICE;
├── src/ # Svelte frontend source
├── backend/ # FastAPI backend
├── query-ui/ # Snowflake query panel
├── native-app/ # Native App manifest and setup
├── Dockerfile # Multi-stage build
├── nginx.conf # Reverse proxy config
└── supervisord.conf # Process manager config
/query-ui/name, parent, value columnsSELECT 'Company' as name, NULL as parent, 1000000 as value
UNION ALL SELECT 'Sales', 'Company', 400000
UNION ALL SELECT 'Engineering', 'Company', 350000
UNION ALL SELECT 'Marketing', 'Company', 250000
MIT