This document explains how to deploy the project to the cloud.
The focus is practical deployment, not vendor-specific marketing.
ThreatGraph has two essential runtime pieces:
- the Streamlit app
- the SurrealDB data layer
There is also one important optional piece:
- LangSmith tracing
The fastest cloud deployment is a single VM or single container host.
Run:
- the app
- file-backed SurrealDB storage
- the local data directory
- fewest moving parts
- easiest to debug
- easiest to demo
Internet
|
Reverse proxy / HTTPS
|
App container / VM
|
Streamlit app + file-backed SurrealDB data path
- demo deployment
- hackathon submission
- quick preview links
- app and DB are coupled
- not ideal for scale
The cleaner design separates app and DB.
Browser
|
HTTPS / load balancer
|
Streamlit app container
|
SurrealDB service with persistent volume
Runs:
- Python
- Streamlit
- app code
Runs:
- SurrealDB
- persistent volume
Useful for:
- backups
- exported screenshots
- future artifacts
At minimum:
SURREALDB_URL=...
SURREALDB_NS=threatgraph
SURREALDB_DB=main
SURREALDB_USER=...
SURREALDB_PASS=...Optional:
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
NVD_API_KEY=...
LANGSMITH_API_KEY=...
LANGCHAIN_TRACING_V2=true
LANGCHAIN_PROJECT=threatgraphUse the existing Dockerfile or a Python container image.
Do not use in-memory mode in the cloud.
Use:
- file-backed storage
- or a dedicated SurrealDB server deployment
Before exposing the app:
python3 ingest.pyThis should either:
- run once as an initialization job
- or run as a separate bootstrap step
streamlit run app.py --server.address 0.0.0.0 --server.port 8501Use a reverse proxy or platform TLS termination.
- one instance
- one DB
- one volume
- okay for judges and demos
- separate app and DB
- backups
- secrets management
- monitoring
- dedicated auth
- tenant isolation
- ingestion jobs
- operational alerting
- role-based controls
You need persistence for:
- SurrealDB graph data
- investigation history
- checkpoint data
- NVD cache
Recommended:
- persistent DB volume
- persistent app storage or mounted volume for
.contextcache if you want cache retention
Simple CI/CD path:
- push to GitHub
- run tests
- build image
- deploy app
- run ingest/bootstrap if needed
For the hackathon, keep this simple.
The important thing is reproducibility, not enterprise release engineering.
Do not hardcode:
- API keys
- DB passwords
Use environment variables or a secrets manager.
If the DB is separate, do not expose it publicly.
Only the app should be public.
Use HTTPS in front of the app.
Avoid logging secrets or raw API keys.
You do not need to fully deploy live during the demo.
But you should be able to explain:
- where SurrealDB lives
- where the app lives
- where persistence happens
- how tracing is enabled
- how ingest/bootstrap happens
That is enough for a strong technical explanation.
For the hackathon, the best story is:
- local or single-host deployment for demo reliability
- file-backed SurrealDB persistence
- Streamlit app on a public URL
- optional LangSmith tracing enabled
That keeps the story tight and reduces failure risk during judging.