Commit 48c5d86
authored
ai/live: Remote signer discovery (#3866)
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 -remoteDiscovery flag. 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, -extraNodes etc. Additionally, operators can tune the orchestrator refresh interval with the existing -liveAICapReportInterval flag.
* 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 the capabilities is a list of capabilities the orchestrator supports, eg live-video-to-video/streamdiffusion. There is also an optional caps query parameter to return only the subset of orchestrators matching the capability (exact string match). Multiple caps parameters can be included (OR).
### Remote Discovery Implementation
* Remote discovery builds on the existing DB discovery pool's orchestrator polling. The DB discovery pool periodically (via -liveAICapReportInterval) fetches orchestrator info from the network and updates the node's capability cache.
* The remote discovery pool lazily reads from this cache and builds a capability-indexed view for quick lookups.
* Price filtering happens during refresh, so it doesn't return orchestrators that will be later rejected by the remote signer due to price
### 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 IgnoreCapacityCheck flag (see below)
* To avoid returning capacity errors during the DB Discovery refresh call (it is capabilities we want), we need to thread through the IgnoreCapacityCheck flag 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 ExtraNodes field 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 LiveAICapReportInterval field was added to the LivepeerNode; this is just storing an existing flag so the remote signer node can use it.
* Bug fix in the broadcast price config to mitigate cross-test contamination due to the use of globals + inconsistent cleanup from other tests
* Tests, docs, etc.1 parent 8de5e30 commit 48c5d86
File tree
14 files changed
+987
-58
lines changed- cmd/livepeer/starter
- common
- core
- discovery
- doc
- server
14 files changed
+987
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
172 | 173 | | |
173 | 174 | | |
174 | 175 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
| 310 | + | |
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
| |||
429 | 431 | | |
430 | 432 | | |
431 | 433 | | |
| 434 | + | |
432 | 435 | | |
433 | 436 | | |
434 | 437 | | |
| |||
1635 | 1638 | | |
1636 | 1639 | | |
1637 | 1640 | | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
1638 | 1645 | | |
1639 | 1646 | | |
1640 | 1647 | | |
| |||
1648 | 1655 | | |
1649 | 1656 | | |
1650 | 1657 | | |
1651 | | - | |
| 1658 | + | |
1652 | 1659 | | |
1653 | 1660 | | |
1654 | 1661 | | |
| |||
1793 | 1800 | | |
1794 | 1801 | | |
1795 | 1802 | | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
1796 | 1809 | | |
1797 | 1810 | | |
1798 | 1811 | | |
| |||
1842 | 1855 | | |
1843 | 1856 | | |
1844 | 1857 | | |
1845 | | - | |
| 1858 | + | |
1846 | 1859 | | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
1847 | 1921 | | |
1848 | 1922 | | |
1849 | 1923 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| |||
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
41 | 64 | | |
42 | 65 | | |
43 | 66 | | |
| |||
46 | 69 | | |
47 | 70 | | |
48 | 71 | | |
49 | | - | |
| 72 | + | |
50 | 73 | | |
51 | | - | |
52 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
53 | 77 | | |
54 | 78 | | |
55 | 79 | | |
| |||
62 | 86 | | |
63 | 87 | | |
64 | 88 | | |
65 | | - | |
| 89 | + | |
66 | 90 | | |
67 | 91 | | |
68 | 92 | | |
| |||
152 | 176 | | |
153 | 177 | | |
154 | 178 | | |
155 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
156 | 192 | | |
157 | 193 | | |
158 | 194 | | |
| |||
303 | 339 | | |
304 | 340 | | |
305 | 341 | | |
| 342 | + | |
306 | 343 | | |
307 | 344 | | |
308 | 345 | | |
309 | 346 | | |
310 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
311 | 351 | | |
312 | 352 | | |
313 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
314 | 358 | | |
315 | | - | |
| 359 | + | |
316 | 360 | | |
317 | 361 | | |
318 | 362 | | |
| |||
323 | 367 | | |
324 | 368 | | |
325 | 369 | | |
326 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
327 | 373 | | |
328 | 374 | | |
329 | 375 | | |
| |||
361 | 407 | | |
362 | 408 | | |
363 | 409 | | |
364 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
365 | 415 | | |
366 | 416 | | |
| 417 | + | |
367 | 418 | | |
368 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
369 | 428 | | |
370 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
371 | 434 | | |
372 | 435 | | |
373 | 436 | | |
| |||
376 | 439 | | |
377 | 440 | | |
378 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
379 | 458 | | |
380 | 459 | | |
381 | 460 | | |
| |||
507 | 586 | | |
508 | 587 | | |
509 | 588 | | |
| 589 | + | |
510 | 590 | | |
511 | 591 | | |
512 | 592 | | |
| |||
0 commit comments