Deployment
The examples need no deployment of their own: each picks its backend by a
context name near its top, "demo" (the shared cluster) by default. See
Getting Started. This page
covers the two ways to run a backend yourself. Both live in standalone
repositories:
| Repo | Use for |
|---|---|
virtufin/deploy-local |
The complete backend on your machine (dapr run, Redis in Docker) |
virtufin/helm |
Kubernetes Helm chart |
virtufin/docker-compose is retired and archived; use deploy-local instead.
Local (deploy-local)
deploy-local builds the API Gateway, WorkManager and WorkManager Runtime
(which runs the WebSocketFeed workers) from source and starts them with dapr run, configured the
way the helm chart configures the cluster. Its README lists the prerequisites
and the source repos it expects next to it.
cd deploy-local
./scripts/deploy.sh # build and start everything, wait until healthy
./scripts/undeploy.sh # stop everything (Redis data is kept)
Redis runs in deploy-local's own container on localhost:6380 (not 6379, so
an existing Redis keeps running). All ports are in deploy-local/.env.
Point an example at it with a local context (api_host = "localhost",
api_port = 5002, tls = false in contexts.toml) and "local" as the
context name at the top of the example. The examples reach WorkManager (and
the WebSocketFeed workers it runs) through the gateway, so the gateway is the only address they
need.
Flushing the state store
To start from a clean slate, flush deploy-local's Redis container. The script
refuses to touch anything but that container, and asks for --yes:
deploy-local/scripts/flush_redis.sh --yes
Restart the services afterwards: the flush also drops the state store's query index, which Dapr creates only when a sidecar starts.
Kubernetes (Helm)
The virtufin/helm chart
deploys the services on a cluster with Dapr installed. The state store and
pub/sub are Redis (the chart's stateStore / pubsub values; see the chart
README for why Redis and not Valkey). Its README has the prerequisites and the
install steps.
From outside the cluster, the examples reach it through its ingress with a
context like demo (api_host the ingress host, api_port = 443,
tls = true, and an api_key); demo is this setup.