greentic-demo
Thin bootstrap that wires environment variables into greentic-runner-host. All runtime logic (pack resolution, caching, hot reload, telemetry, secrets, routing) happens inside the runner; this crate simply loads .env, builds a stable RunnerConfig, and calls runner_shim::run(cfg) so future runner releases can drop in without churn.
Quickstart
- Copy the defaults and edit as needed:
Make surePACKS_DIRpoints to a directory where each tenant has abindings.yamlfile. - Start the runner with your packs/index:
make runsources.env, then runscargo +nightly run --locked --bin greentic-demoso you always test the same dependency graph as CI. - Update
.envwhenever you switch pack backends, cache directories, refresh intervals, or tenant routing strategies.dotenvyloads the file automatically at startup.
Docker Image
The multi-stage Dockerfile builds a MUSL binary and copies it into gcr.io/distroless/static:nonroot, keeping the final image around 25–30 MB. Targets cover the common flow:
docker-run reads the current .env file and publishes ${PORT:-8080} by default.
Cloudflared Tunnel
Expose a local instance through Cloudflare Tunnel without poking firewall holes:
This target checks for cloudflared, sources .env, and runs cloudflared tunnel --url http://127.0.0.1:$PORT. See Cloudflare's docs for installing the CLI and authenticating your account.
Configuration Surface
cmd/greentic-demo/main.rs converts env vars into a stable RunnerConfig. The key knobs are:
| Variable | Description | Default |
|---|---|---|
PACKS_DIR |
Directory containing per-tenant bindings.yaml files |
./packs |
PORT |
HTTP listener exposed by the runner host | 8080 |
SECRETS_BACKEND |
Hint for which secrets backend to bootstrap (env, aws, gcp, azure) |
env |
PACK_SOURCE |
Resolver scheme (fs, http, oci, s3, gcs, azblob) |
fs |
PACK_INDEX_URL |
Local path or URL to index.json |
./examples/index.json |
PACK_CACHE_DIR |
Content-addressed cache root | .packs |
PACK_REFRESH_INTERVAL |
Human-friendly interval (e.g. 30s, 5m) for hot-reload polling |
30s |
TENANT_RESOLVER |
Routing strategy: host, header, jwt, or env |
host |
PACK_PUBLIC_KEY |
Optional Ed25519 key to verify signed packs | unset |
Additional runner features (telemetry presets, secrets bootstrap, admin APIs) will be surfaced directly through this config once the corresponding runner PRs land; the shim already has placeholders so the eventual cut-over is a one-liner re-export.
Development Notes
make fmt/make testrun againstcargo +nightlybecause the crate targets Rust 2024 edition..envis ignored by Git;make runautomatically creates it from.env.examplethe first time.- Historical NATS bridge utilities (
config,nats_bridge, etc.) remain available undersrc/for reference, but new demos should run entirely through the runner host via this bootstrap. - See
docs/deploy.mdfor the Terraform + GitHub Actions deployment flow, required OIDC identities, and how to trigger theDeployworkflow.