feat(live-runner): env-var fallback for register_runner provisioning fields#34
feat(live-runner): env-var fallback for register_runner provisioning fields#34rickstaa wants to merge 1 commit into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…fields Provisioning is an operator/deployment concern, not app logic. Today the app must read and forward connection, auth, pricing and capacity into register_runner() — pricing especially "feels strange" since the app just forwards an operator-set value. Let these be supplied via the environment when omitted, so an unchanged image can be provisioned at deploy time (env / compose / k8s) without forwarding them in code. An explicit argument always wins (env is the fallback, not an override): orchestrator_url -> LIVEPEER_ORCHESTRATOR_URL secret -> LIVEPEER_ORCH_SECRET runner_url -> LIVEPEER_RUNNER_URL price_per_unit -> LIVEPEER_PRICE_PER_UNIT (default 0) pixels_per_unit -> LIVEPEER_PIXELS_PER_UNIT (default 1) price_unit -> LIVEPEER_PRICE_UNIT (default "USD") capacity -> LIVEPEER_CAPACITY (default 1) App identity/behavior (app, mode, callbacks) intentionally stays in code. This is SDK ergonomics only — it does not change go-livepeer's trust model. Dynamic registration still reports the price to the orchestrator either way; env vs arg only changes where the operator configures it. Static remains the path for orchestrator-owned pricing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ue3DyejYHXX5HYmjxtJZbg
d4afe2b to
756654c
Compare
|
Env var fallback is a good idea at the application layer. Since this is a library I'm a little hesitant about injecting implicit / hidden state that may clash with the existing runtime environment. From what I can gather, library configuration via env vars is not really an encouraged practice either. If we ship a "runner executable" that shells out to some command then it would be fine to have env vars for that. For this library call though, I'm not so sure. |
Hey @j0sh I agree, we don't need to deal with this right now. This was just me doing some prototyping. Will clsoe for now. |
Why
@j0sh —I noted hello-world "feels a bit strange since it relies on the app to create the argument and forward it," and that pricing belongs with the runner (deployment), not in go-livepeer. This shows what "provisioning is deploy config, out of app code" looks like in the SDK.
What
register_runnerprovisioning fields fall back toLIVEPEER_*env vars when omitted; an explicit argument always wins.orchestrator_url/secret/runner_urlLIVEPEER_ORCHESTRATOR_URL/_ORCH_SECRET/_RUNNER_URLprice_per_unit/pixels_per_unit/price_unitLIVEPEER_PRICE_PER_UNIT/_PIXELS_PER_UNIT/_PRICE_UNITcapacityLIVEPEER_CAPACITYApp identity/behavior (
app,mode, callbacks) stays in code.Not a trust change — dynamic still reports the price either way; env vs arg only moves where the operator sets it. Static remains the orch-owned path.
+27/−7, one file, inline (matches the existing
CUDA_VISIBLE_DEVICESread).Open questions
LIVEPEER_*prefix ok?🤖 Generated with Claude Code
https://claude.ai/code/session_01Ue3DyejYHXX5HYmjxtJZbg