Conversation
d63d90f to
8b60101
Compare
This requires threading through an additional field for each of the discovery types to pass into the OrchestratorInfo request. The behavior for non-discovery gateways should remain the same.
This reverts commit 555ab44.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3866 +/- ##
===================================================
+ Coverage 32.56835% 32.79594% +0.22759%
===================================================
Files 170 171 +1
Lines 41700 41993 +293
===================================================
+ Hits 13581 13772 +191
- Misses 27094 27189 +95
- Partials 1025 1032 +7
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This also involves adding ExtraOrchestrators support to DB Discovery
leszko
left a comment
There was a problem hiding this comment.
Skimmed through the PR and it looks good. Saying that, I won't be able to review it in detail.
eliteprox
left a comment
There was a problem hiding this comment.
Changes LGTM, tested remote signer capability discovery with single orch. Approved with one small nit.
server/remote_signer.go
Outdated
| // Register the remote signer endpoints | ||
| ls.HTTPMux.Handle("POST /sign-orchestrator-info", http.HandlerFunc(ls.SignOrchestratorInfo)) | ||
| ls.HTTPMux.Handle("POST /generate-live-payment", http.HandlerFunc(ls.GenerateLivePayment)) | ||
| if ls.LivepeerNode.OrchestratorPool != nil { |
There was a problem hiding this comment.
Should we gate the handler with ls.LivepeerNode.RemoteDiscovery?
There was a problem hiding this comment.
Good spot, yes that would have been a bug. Fixed in 7d31811
Broadcaster capability max-price state is a global, and unit test cleanup which calls SetCapabilityMaxPrice(..., nil) can leave a "default" entry with a nil value. The new remote discovery tests read that shared capability pricing and previously dereferenced the nil default, causing intermittent panics and cross-test coupling. Fix by adding a nil guard in getCapabilityMaxPrice() Switch SetCapabilityMaxPrice() to a write lock to correctly synchronize global state updates.
|
Pushed a number of small cleanups to remote discovery and one bona fide fix. Fix in 58a3374 :
|
This adds an optional remote discovery feature to the remote signer node. Client using the remote signer can now discover orchestrators and their supported capabilities on the network. The remote discovery endpoint is compatible with the existing orchestrator webhook, making it usable by go-livepeer as well as local gateway SDKs.
Usage
Remote signer node gets a
-remoteDiscoveryflag. This is only usable in remote signer mode for now and is opt-in. All the other gateway-side orchestrator configuration flags are supported here:-orchWebhookUrl,-orchAddr,-orchBlocklist,-extraNodesetc. Additionally, operators can tune the orchestrator refresh interval with the existing-liveAICapReportIntervalflag.If the gateway is using a remote signer (via
-remoteSignerUrl) and has no other orchestrator sources (eg, webhook, orchestrator list) then it will fall back to using the remote signer's discovery endpoint.The discovery endpoint is
GET /discover-orchestrators. It returns a JSON list of [{"address":...,"capabilities":[...]}] where the address is the URI the orchestrator can be reached at, and thecapabilitiesis a list of capabilities the orchestrator supports, eglive-video-to-video/streamdiffusion. There is also an optionalcapsquery parameter to return only the subset of orchestrators matching the capability (exact string match). Multiplecapsparameters can be included (OR).Remote Discovery Implementation
-liveAICapReportInterval) fetches orchestrator info from the network and updates the node's capability cache.Supporting Changes
DB Discovery pool and Webhook Discovery pool are updated to use a "builder pattern" of config structs + initializer, matching the regular orchestrator pool. The existing constructor interfaces are left untouched, but the plumbing underneath uses the new builder pattern. This is done to support the
IgnoreCapacityCheckflag (see below)To avoid returning capacity errors during the DB Discovery refresh call (it is capabilities we want), we need to thread through the
IgnoreCapacityCheckflag a couple places from the webhook, DB discovery, etc. Note that this flag is only in enabled when the node is in remote signer mode, so this change should not affect other modes such as the gateway.DB Discovery cache refreshes now incorporate the
ExtraNodesfield in order to fully traverse the orchestrators available on the network.To support price filtering during remote discovery, the PriceInfo field is added to
OrchNetworkCapabilities.The
LiveAICapReportIntervalfield was added to the LivepeerNode; this is just storing an existing flag so the remote signer node can use it.Tests, docs, etc.