Skip to content

feat(deploy): Docker stack + OpenMeter bootstrap + Railway CI (MVP 0)#22

Draft
eliteprox wants to merge 3 commits into
feat/scaffold-builder-sdk-examplefrom
feat/deploy-stack-railway
Draft

feat(deploy): Docker stack + OpenMeter bootstrap + Railway CI (MVP 0)#22
eliteprox wants to merge 3 commits into
feat/scaffold-builder-sdk-examplefrom
feat/deploy-stack-railway

Conversation

@eliteprox

Copy link
Copy Markdown
Collaborator

Summary

Reorders the clearinghouse MVP: deploy/ ships first, ahead of the /authorize webhook and adapter work from issue #2. This PR adds everything needed to run the three-container stack locally and push it to Railway via CI.

Stacked on #21 — until PR #21 merges, this diff includes #21's scaffolding. The new work (deploy/, scripts/, config/, @openmeter/sdk) is independent.

What's in this PR

deploy/ — Docker stack (no Apache DMZ, CLI port not exposed)

Service Image Notes
kafka redpanda:v24.2.4 KAFKA_ADVERTISED_ADDR env selects local vs. Railway private networking
remote-signer livepeer/go-livepeer:latest -cliAddr=127.0.0.1:4935 (loopback only); EXPOSE 8081 only
openmeter-collector ghcr.io/openmeterio/benthos-collector:latest collector.yaml from pymthouse PR #133 reference; http_client + OPENMETER_INGEST_URL

Local usage: pnpm stack:up / stack:down / stack:logs (requires deploy/.env from deploy/.env.example).

OpenMeter/Konnect bootstrap scripts

  • config/meters.json + scripts/lib/{meters,openmeter,konnect-metering}.ts — ported from auth0-livepeer PR Scaffold clearinghouse example repo consuming builder-sdk v0.4.1 #1
  • pnpm openmeter:bootstrap — provisions network_fee_usd_micros / signed_ticket_count meters and network_spend feature; Konnect-first, self-hosted OpenMeter fallback
  • New dependency: @openmeter/sdk@^1.0.0-beta.228 (used by the legacy self-hosted path)

Railway CI

  • deploy/*/railway.json — per-service manifests (builder=DOCKERFILE, watchPatterns, ON_FAILURE restart)
  • scripts/lib/railway-auth.shrailway_export_auth/railway_pe_flags/railway_retry; RAILWAY_PROJECT_ID is a required env/secret (no hardcoded default)
  • scripts/railway-deploy-from-manifest.sh — generic manifest-swap + railway up -s <service>
  • scripts/railway-deploy-stack.sh — orchestrates kafka → openmeter-collector → remote-signer
  • scripts/railway-apply-stack-env.sh — sets per-service vars with Railway private networking (kafka.railway.internal:9092)
  • .github/workflows/deploy-railway.ymloff by default (RAILWAY_AUTO_DEPLOY repo var); workflow_dispatch with environment input

Test plan

  • pnpm lint — zero warnings
  • pnpm typecheck — no errors
  • pnpm test — 2 tests pass
  • pnpm build — clean emit
  • cp deploy/.env.example deploy/.env + fill values → pnpm stack:up → confirm kafka healthy, signer on 8081, collector running; confirm port 4935 not published
  • OPENMETER_URL=... OPENMETER_API_KEY=kpat_... pnpm openmeter:bootstrap → meters + feature created in Konnect dashboard
  • Set RAILWAY_AUTO_DEPLOY=true + required secrets → push triggers Railway deploy

Closes / supersedes

Implements the "MVP 0" scope described in github.com/livepeer/clearinghouse/milestones:

🤖 Generated with Claude Code

…way CI

Reorders the clearinghouse MVP: the deploy/ stack lands first, before the
/authorize webhook (issue #2) and adapter work. All three Railway services
(kafka, openmeter-collector, remote-signer) are Dockerfile-based with
per-service railway.json manifests and a single deploy-railway workflow.

No Apache DMZ — go-livepeer runs directly in the remote-signer container.
The CLI/admin port (-cliAddr) is bound to 127.0.0.1 inside the container
and is never published, to docker-compose or Railway.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a new billing model with a `billable_usd_micros` meter and `billable_spend` feature, along with a default pay-per-use plan in `config/pricing.json`. Introduces the `provision:customer` script for creating Auth0 customers and subscriptions. Updates the OpenMeter/Konnect bootstrap process to include the new billing features and ensures compatibility with existing meters. Enhances documentation to reflect these changes.
@eliteprox eliteprox marked this pull request as draft June 17, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant