Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add -pricePerGateway and deprecate -pricePerBroadcaster #3056

Merged
merged 8 commits into from
May 19, 2024

Conversation

rickstaa
Copy link
Contributor

@rickstaa rickstaa commented May 16, 2024

What does this pull request do? Explain your changes. (required)

This pull request adds the pricePerGateway flag and deprecates the pricePerBroadcaster flag per core team decision (details: https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004). It adds the new -pricePerGateway flag while maintaining support for -pricePerBroadcaster with a deprecation warning on startup. This change does not address refactoring associated with variable names and types, which will be addressed in a later change.

Specific updates (required)

  • Updates starter.go and livepeer.go to include the -pricePerGateway flag
  • Updates the getBroadcasters function to parse the gateways property instead of the broadcasters property.
  • Adds deprecation warnings to startup and cli help
W0516 11:37:39.563931   97531 starter.go:785] -PricePerBroadcaster flag is deprecated and will be removed in a future release. Please use -PricePerGateway instead

How did you test each of these updates (required)

  • Started a on-chain orchestrator node using the -pricePerGateway flag
  • Started a on-chain orchestrator node using the -pricePerBroadcaster flag, noted deprecation warning
  • Started a on-chain orchestrator node while using the broadcasters property in the config specified in the -pricePerGateway flag, noted deprecation warning.

Does this pull request close any open issues?

AI-LIV-358

Checklist:

  • Read the contribution guide
  • make runs successfully
  • All tests in ./test.sh pass
    • The TestSubmitSegment_HttpPostError server test does fails on my system but I don't think it is related to my changes
  • README and other documentation updated
  • Pending changelog updated
Test Logs
--- FAIL: TestSubmitSegment_HttpPostError (0.00s)
    segment_rpc_test.go:1708:
                Error Trace:    /home/ricks/development/work/livepeer/ai_spe/go-livepeer/server/segment_rpc_test.go:1708
                Error:          "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>" does not contain "connection refused"
                Test:           TestSubmitSegment_HttpPostError
    segment_rpc_test.go:1722:
                Error Trace:    /home/ricks/development/work/livepeer/ai_spe/go-livepeer/server/segment_rpc_test.go:1722
                Error:          "<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>" does not contain "connection refused"
                Test:           TestSubmitSegment_HttpPostError
    segment_rpc_test.go:1723:
                Error Trace:    /home/ricks/development/work/livepeer/ai_spe/go-livepeer/server/segment_rpc_test.go:1723
                Error:          Should have called with given arguments
                Test:           TestSubmitSegment_HttpPostError
                Messages:       Expected "Credit" to have been called with:
                                [5/1]
                                but actual calls were:
                                        [0/1 0/1]
I0516 11:25:12.911218   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:34711 Submitting segment bytes=0 orch=https://127.0.0.1:34711 timeout=8s uploadTimeout=2s segDur=0
E0516 11:25:12.914238   52957 segment_rpc.go:517] orchSessionID=bar orchestrator=https://127.0.0.1:34711 Error submitting segment code=500 orch=https://127.0.0.1:34711 err="Server error\n"
I0516 11:25:12.914462   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:34711 Submitting segment bytes=0 orch=https://127.0.0.1:34711 timeout=8s uploadTimeout=2s segDur=0
E0516 11:25:12.914745   52957 segment_rpc.go:517] orchSessionID=bar orchestrator=https://127.0.0.1:34711 Error submitting segment code=500 orch=https://127.0.0.1:34711 err="Server error\n"
I0516 11:25:12.915276   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43067 Submitting segment bytes=0 orch=https://127.0.0.1:43067 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:12.918022   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43067 Uploaded segment orch=https://127.0.0.1:43067 dur=2.725044ms
E0516 11:25:12.918049   52957 segment_rpc.go:547] orchSessionID=bar orchestrator=https://127.0.0.1:43067 Unable to parse response for segment orch=https://127.0.0.1:43067 err="proto:\u00a0cannot parse invalid wire-format data"
I0516 11:25:12.918272   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43067 Submitting segment bytes=0 orch=https://127.0.0.1:43067 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:12.918462   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43067 Uploaded segment orch=https://127.0.0.1:43067 dur=174.831µs
E0516 11:25:12.918485   52957 segment_rpc.go:547] orchSessionID=bar orchestrator=https://127.0.0.1:43067 Unable to parse response for segment orch=https://127.0.0.1:43067 err="proto:\u00a0cannot parse invalid wire-format data"
I0516 11:25:12.919131   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:41209 Submitting segment bytes=0 orch=https://127.0.0.1:41209 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:12.921861   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:41209 Uploaded segment orch=https://127.0.0.1:41209 dur=2.709865ms
E0516 11:25:12.921889   52957 segment_rpc.go:559] orchSessionID=bar orchestrator=https://127.0.0.1:41209 Transcode failed for segment orch=https://127.0.0.1:41209 err="TranscodeResult error"
I0516 11:25:12.922110   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:41209 Submitting segment bytes=0 orch=https://127.0.0.1:41209 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:12.922289   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:41209 Uploaded segment orch=https://127.0.0.1:41209 dur=163.199µs
E0516 11:25:12.922314   52957 segment_rpc.go:559] orchSessionID=bar orchestrator=https://127.0.0.1:41209 Transcode failed for segment orch=https://127.0.0.1:41209 err="TranscodeResult error"
I0516 11:25:12.922824   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=8s uploadTimeout=2s segDur=0.05
I0516 11:25:12.924557   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Uploaded segment orch=https://127.0.0.1:37551 dur=1.714229ms
I0516 11:25:12.924579   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:37551 dur=17.904µs
I0516 11:25:12.924677   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=200ms uploadTimeout=100ms segDur=0.05
E0516 11:25:13.025117   52957 segment_rpc.go:498] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Unable to submit segment orch=https://127.0.0.1:37551 orch=https://127.0.0.1:37551 uploadDur=100.414966ms err="Post \"https://127.0.0.1:37551/segment\": context canceled"
I0516 11:25:13.025248   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=200ms uploadTimeout=100ms segDur=0.05
I0516 11:25:13.075494   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Uploaded segment orch=https://127.0.0.1:37551 dur=50.231763ms
I0516 11:25:13.075522   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:37551 dur=21.12µs
I0516 11:25:13.075619   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=200ms uploadTimeout=100ms segDur=0.05
I0516 11:25:13.075762   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Uploaded segment orch=https://127.0.0.1:37551 dur=128.954µs
E0516 11:25:13.275808   52957 segment_rpc.go:536] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Unable to read response body for segment orch=https://127.0.0.1:37551 err="context deadline exceeded"
I0516 11:25:13.275975   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=200ms uploadTimeout=100ms segDur=0.05
I0516 11:25:13.276271   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Uploaded segment orch=https://127.0.0.1:37551 dur=275.552µs
I0516 11:25:13.276304   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:37551 dur=28.134µs
I0516 11:25:13.276436   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=1s uploadTimeout=100ms segDur=0
I0516 11:25:13.276650   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Uploaded segment orch=https://127.0.0.1:37551 dur=191.734µs
I0516 11:25:13.776831   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:37551 dur=500.16207ms
I0516 11:25:13.777007   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=1s uploadTimeout=100ms segDur=-0.01
I0516 11:25:13.777283   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Uploaded segment orch=https://127.0.0.1:37551 dur=256.867µs
I0516 11:25:14.277364   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:37551 dur=500.049988ms
I0516 11:25:14.277537   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=1s uploadTimeout=100ms segDur=0.01
I0516 11:25:14.277839   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Uploaded segment orch=https://127.0.0.1:37551 dur=282.846µs
I0516 11:25:14.777906   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:37551 dur=500.045339ms
I0516 11:25:14.778077   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Submitting segment bytes=0 orch=https://127.0.0.1:37551 timeout=40ms uploadTimeout=100ms segDur=0.01
I0516 11:25:14.778326   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Uploaded segment orch=https://127.0.0.1:37551 dur=232.811µs
E0516 11:25:14.818109   52957 segment_rpc.go:536] orchSessionID=bar orchestrator=https://127.0.0.1:37551 Unable to read response body for segment orch=https://127.0.0.1:37551 err="context deadline exceeded"
I0516 11:25:14.818821   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=1024 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:14.922630   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=103.782918ms
I0516 11:25:14.922672   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:43311 dur=27.462µs
I0516 11:25:14.922814   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=1024 orch=https://127.0.0.1:43311 timeout=20s uploadTimeout=2.5s segDur=5
I0516 11:25:15.023352   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.519222ms
I0516 11:25:15.023396   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:43311 dur=27.792µs
I0516 11:25:15.023490   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=1024 orch=https://127.0.0.1:43311 timeout=40s uploadTimeout=5s segDur=10
I0516 11:25:15.123756   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.249021ms
I0516 11:25:15.123801   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:43311 dur=32.411µs
I0516 11:25:15.123911   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=1024 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0.5
I0516 11:25:15.224246   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.318522ms
I0516 11:25:15.224279   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:43311 dur=25.688µs
I0516 11:25:15.224399   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=1024 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0.5
I0516 11:25:15.324825   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.403794ms
I0516 11:25:15.324876   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName= seqNo=0 orch=https://127.0.0.1:43311 dur=39.495µs
I0516 11:25:15.325043   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=3 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:15.425445   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.382464ms
I0516 11:25:15.425480   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName=foo seqNo=0 orch=https://127.0.0.1:43311 dur=24.497µs
I0516 11:25:15.425642   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=3 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:15.525970   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.307711ms
I0516 11:25:15.526032   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName=foo seqNo=0 orch=https://127.0.0.1:43311 dur=46.739µs
I0516 11:25:15.526401   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=3 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:15.627296   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.866411ms
I0516 11:25:15.627350   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName=foo seqNo=0 orch=https://127.0.0.1:43311 dur=39.314µs
I0516 11:25:15.627594   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=3 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:15.727966   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.351675ms
I0516 11:25:15.728025   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName=foo seqNo=0 orch=https://127.0.0.1:43311 dur=39.134µs
I0516 11:25:15.728404   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=3 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:15.828851   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.422889ms
I0516 11:25:15.828920   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName=foo seqNo=0 orch=https://127.0.0.1:43311 dur=44.735µs
I0516 11:25:15.829336   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=3 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:15.929677   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.316568ms
I0516 11:25:15.929729   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName=foo seqNo=0 orch=https://127.0.0.1:43311 dur=34.215µs
I0516 11:25:15.930003   52957 segment_rpc.go:492] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Submitting segment bytes=3 orch=https://127.0.0.1:43311 timeout=8s uploadTimeout=2s segDur=0
I0516 11:25:16.030328   52957 segment_rpc.go:528] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Uploaded segment orch=https://127.0.0.1:43311 dur=100.307993ms
I0516 11:25:16.030376   52957 segment_rpc.go:609] orchSessionID=bar orchestrator=https://127.0.0.1:43311 Successfully transcoded segment segName=foo seqNo=0 orch=https://127.0.0.1:43311 dur=32.151µs
W0516 11:25:16.032082   52957 selection_algorithm.go:52] No Orchestrators passed min performance score filter, not using the filter
W0516 11:25:16.032119   52957 selection_algorithm.go:52] No Orchestrators passed min performance score filter, not using the filter
W0516 11:25:16.032152   52957 selection_algorithm.go:75] No Orchestrators passed max price filter, not using the filter
I0516 11:25:16.072877   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:16.072907   52957 broadcast.go:363] [PublicLogs] Swapping from orch=transcoder2 to orch=[transcoder1] for manifestID=test
I0516 11:25:16.072918   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:16.072925   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 2
I0516 11:25:16.073134   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:16.073143   52957 broadcast.go:363] [PublicLogs] Swapping from orch=transcoder2 to orch=[transcoder1] for manifestID=test
I0516 11:25:16.073157   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:16.073164   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:16.073603   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:16.073668   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:16.077030   52957 broadcast.go:258] [PublicLogs] Reusing orchestrator reason=performance: segments in flight, latency score of 0 < 1
I0516 11:25:16.077105   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:16.077126   52957 broadcast.go:258] [PublicLogs] Reusing orchestrator reason=performance: segments in flight, latency score of 0 < 1
I0516 11:25:16.077149   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:17.677374   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:17.677432   52957 broadcast.go:363] [PublicLogs] Swapping from orch=transcoder2 to orch=[transcoder1] for manifestID=test
I0516 11:25:17.677461   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:18.677563   52957 broadcast.go:258] [PublicLogs] Reusing orchestrator reason=performance: segments in flight, latency score of 0 < 1
I0516 11:25:18.677639   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.277711   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.277760   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.277769   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 2
I0516 11:25:20.278154   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.278174   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.278180   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.278195   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.278202   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.278207   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.278214   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.278220   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:20.278227   52957 broadcast.go:232] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:21.078470   52957 broadcast.go:258] [PublicLogs] Reusing orchestrator reason=performance: segments in flight, latency score of 0 < 1
I0516 11:25:21.078511   52957 broadcast.go:258] [PublicLogs] Reusing orchestrator reason=performance: segments in flight, latency score of 0 < 1
I0516 11:25:21.078519   52957 broadcast.go:258] [PublicLogs] Reusing orchestrator reason=performance: segments in flight, latency score of 0 < 1
I0516 11:25:21.878608   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:21.878646   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:21.878652   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 1
I0516 11:25:21.878657   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 2
I0516 11:25:21.878661   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 2
I0516 11:25:21.878665   52957 broadcast.go:269] [PublicLogs] Swapping Orchestrator, reason=performance: no segments in flight, latency score of 0 < 2
FAIL
coverage: 31.5% of statements
FAIL    github.com/livepeer/go-livepeer/server  24.791s
ok      github.com/livepeer/go-livepeer/verification    3.478s  coverage: 3.7% of statements

@rickstaa rickstaa force-pushed the deprecate_priceperbroadcaster_flag branch from 5f80ee7 to c6b9662 Compare May 16, 2024 09:21
Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 61.53846% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 57.40400%. Comparing base (304e47f) to head (569dbad).

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3056         +/-   ##
===================================================
+ Coverage   57.39517%   57.40400%   +0.00883%     
===================================================
  Files             92          92                 
  Lines          15740       15755         +15     
===================================================
+ Hits            9034        9044         +10     
- Misses          6104        6109          +5     
  Partials         602         602                 
Files Coverage Δ
cmd/livepeer/livepeer.go 50.98039% <100.00000%> (+0.32250%) ⬆️
cmd/livepeer/starter/starter.go 7.90514% <60.00000%> (+0.79091%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 304e47f...569dbad. Read the comment docs.

Files Coverage Δ
cmd/livepeer/livepeer.go 50.98039% <100.00000%> (+0.32250%) ⬆️
cmd/livepeer/starter/starter.go 7.90514% <60.00000%> (+0.79091%) ⬆️

@rickstaa rickstaa marked this pull request as draft May 16, 2024 10:32
@rickstaa rickstaa marked this pull request as ready for review May 16, 2024 10:46
@thomshutt
Copy link
Contributor

Looks good, could you check why the test suite is failing before merging though please

This commit adds the `pricePerGateway` flag and deprecates the `pricePerBroadcaster` flag
per core team decision (details:
https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).
This commit removes the `PricePerBroadcaster` deprecation comment since
this is already clear from the glog warning below.
This commit ensures that the deprecation condition for the `pricePerBroadcaster`
flag properly handles the default empty string value.
This commit ensures that the `pricePerGateway` is correctly used instead
of the `pricePerBroadcaster` when it is set.
…of 'gateways'

This commit updates the configuration to replace the `broadcasters` property
specified under the `pricePerGateway` flag with `gateways`. Additionally, it
ensures that a warning is issued when the deprecated property is still used.
@rickstaa rickstaa force-pushed the deprecate_priceperbroadcaster_flag branch from 6c1df80 to 74fa79e Compare May 16, 2024 18:08
This commit ensures that the TestParseGetBroadcasterPrices function uses
the new getGatewayPrices function.
This commit updates the `TestParseGetBroadcasterPrices` function to
`TestParseGetGatewayPrices` to align with the new node naming convention.
@rickstaa
Copy link
Contributor Author

rickstaa commented May 19, 2024

@thomshutt

I reviewed the test errors on my local machine and compared them with those in the GitHub Action.

On my local system, the following test fails:

Segment RPC Test

I checked out the latest stable release (v0.7.5), and the same error occurs locally:

Error Trace:	/home/ricks/development/work/livepeer/ai_spe/go-livepeer/server/segment_rpc_test.go:1723
Error:      	Should have called with given arguments
Test:       	TestSubmitSegment_HttpPostError
Messages:   	Expected "Credit" to have been called with:
	            	[5/1]
	            	but actual calls were:
	            	        [0/1 0/1]

This happens because the SubmitSegment function throws the following error:

E0519 22:07:08.094493 2971643 segment_rpc.go:517] orchSessionID=bar orchestrator=https://127.0.0.1 Error submitting segment code=404 orch=https://127.0.0.1 err="<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"

Strangely, the end-to-end test that fails in the action is successful on my local machine. 🤔

I believe we are good to merge since these issues are not caused by my code. Can you merge this pull request if you agree?

@rickstaa
Copy link
Contributor Author

@thomshutt

I reviewed the test errors on my local machine and compared them with those in the GitHub Action.

On my local system, the following test fails:

Segment RPC Test

I checked out the latest stable release (v0.7.5), and the same error occurs locally:

Error Trace:	/home/ricks/development/work/livepeer/ai_spe/go-livepeer/server/segment_rpc_test.go:1723
Error:      	Should have called with given arguments
Test:       	TestSubmitSegment_HttpPostError
Messages:   	Expected "Credit" to have been called with:
	            	[5/1]
	            	but actual calls were:
	            	        [0/1 0/1]

This happens because the SubmitSegment function throws the following error:

E0519 22:07:08.094493 2971643 segment_rpc.go:517] orchSessionID=bar orchestrator=https://127.0.0.1 Error submitting segment code=404 orch=https://127.0.0.1 err="<html>\r\n<head><title>404 Not Found</title></head>\r\n<body>\r\n<center><h1>404 Not Found</h1></center>\r\n<hr><center>nginx/1.18.0 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n"

Strangely, the end-to-end test that fails in the action is successful on my local machine. 🤔

I believe we are good to merge since these issues are not caused by my code. Can you merge this pull request if you agree?

The local error was easy to fix. I discovered that an Nginx server was running on my machine, automatically starting at boot. Shutting it down resolved the issue, allowing the tests for this pull request to succeed on my local machine 👍🏻.

@rickstaa rickstaa merged commit b739f35 into master May 19, 2024
18 checks passed
@rickstaa rickstaa deleted the deprecate_priceperbroadcaster_flag branch May 19, 2024 21:12
@rickstaa
Copy link
Contributor Author

Merged as all tests were successful 👍🏻.

eliteprox pushed a commit to eliteprox/go-livepeer that referenced this pull request Jul 27, 2024
…vepeer#3056)

* refactor: add -pricePerGateway and deprecate -pricePerBroadcaster

This commit adds the `pricePerGateway` flag and deprecates the `pricePerBroadcaster` flag
per core team decision (details:
https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* refactor: remove redundant deprecation comment

This commit removes the `PricePerBroadcaster` deprecation comment since
this is already clear from the glog warning below.

* fix: correct the `pricePerBroadcaster` flag check

This commit ensures that the deprecation condition for the `pricePerBroadcaster`
flag properly handles the default empty string value.

* fix: ensure 'pricePerGateway' is used

This commit ensures that the `pricePerGateway` is correctly used instead
of the `pricePerBroadcaster` when it is set.

* refactor: deprecate 'pricePerGateway' broadcasters property in favor of 'gateways'

This commit updates the configuration to replace the `broadcasters` property
specified under the `pricePerGateway` flag with `gateways`. Additionally, it
ensures that a warning is issued when the deprecated property is still used.

* test: fix TestParseGetBroadcasterPrices test

This commit ensures that the TestParseGetBroadcasterPrices function uses
the new getGatewayPrices function.

* test: rename TestParseGetBroadcasterPrices to reflect Gateway naming

This commit updates the `TestParseGetBroadcasterPrices` function to
`TestParseGetGatewayPrices` to align with the new node naming convention.
rickstaa added a commit that referenced this pull request Aug 7, 2024
* eth,eth/watcher: Create Chainlink price feed watcher (#2972)

* eth/watchers: Create PriceFeed watcher

Makefile: Use mockgen binary from tool dependencies

eth/contracts: Add chainlink interfaces source

Makefile: Generate Chainlink contracts ABI

tools: Add abigen tool to repo

eth/contracts: Generate chainlink bindings

Makefile: Fix abigen bindings generation

Revert everything abigen

Turns out there's already bindings exported from the Chainlink lib.

go.mod: Add chainlink library

eth/watchers: Add pricefeed watcher

eth/watchers: Clean-up event watching code

eth/watchers: Improve price tracking

Revert "go.mod: Add chainlink library"

This reverts commit ac415bd.

Revert "Revert everything abigen"

This reverts commit b7c40b1.

eth/contracts: Gen bindings for proxy iface

eth/watchers: Use local bindings for contracts

eth/watchers: Simplify event subs logic

eth/watchers: Simplify&optimize truncated ticker

eth/watchers: Update decimals on fetch

eth/watchers: Improve handling of decimals

eth/watchers: Fix price rat creation

eth/watchers: Make sure we use UTC on truncated timer

eth/contracts/chainlink: Generate only V3 contract bindings

eth/watchers: Watch PriceFeed only with polling

eth/watchers: Add a retry logic on price update

eth/watchers: Use clog instead of fmt.Printf

* eth: Create separate pricefeed client unit

This will make the code more testable.

* eth: Add tests for pricefeed client

* eth/watchers: Add tests to the truncated ticker

Gosh that was much harder than I thought

* eth/watchers: Add tests for pricefeedwatcher

* eth: Add comments to the new components

* go fmt

* eth: Address minor review comments

* eth,eth/watchers: Improve pricefeed watcher interface

* eth/watchers: Remove truncated ticker tests

* cmd/livepeer: Use price feed watcher for dynamic pricePerPixel (#2981)

* eth/watchers: Create PriceFeed watcher

Makefile: Use mockgen binary from tool dependencies

eth/contracts: Add chainlink interfaces source

Makefile: Generate Chainlink contracts ABI

tools: Add abigen tool to repo

eth/contracts: Generate chainlink bindings

Makefile: Fix abigen bindings generation

Revert everything abigen

Turns out there's already bindings exported from the Chainlink lib.

go.mod: Add chainlink library

eth/watchers: Add pricefeed watcher

eth/watchers: Clean-up event watching code

eth/watchers: Improve price tracking

Revert "go.mod: Add chainlink library"

This reverts commit ac415bd.

Revert "Revert everything abigen"

This reverts commit b7c40b1.

eth/contracts: Gen bindings for proxy iface

eth/watchers: Use local bindings for contracts

eth/watchers: Simplify event subs logic

eth/watchers: Simplify&optimize truncated ticker

eth/watchers: Update decimals on fetch

eth/watchers: Improve handling of decimals

eth/watchers: Fix price rat creation

eth/watchers: Make sure we use UTC on truncated timer

eth/contracts/chainlink: Generate only V3 contract bindings

eth/watchers: Watch PriceFeed only with polling

eth/watchers: Add a retry logic on price update

eth/watchers: Use clog instead of fmt.Printf

* eth: Create separate pricefeed client unit

This will make the code more testable.

* eth: Add tests for pricefeed client

* eth/watchers: Add tests to the truncated ticker

Gosh that was much harder than I thought

* eth/watchers: Add tests for pricefeedwatcher

* eth: Add comments to the new components

* go fmt

* cmd: make pricePerUnit flags strings

* cmd: Allow price per unit to be speficied with a currency

Currently ignoring the currency value.

* cmd: Add logic to start price update loop

* cmd: Add flag for specifying price feed address

* cmd: Add a lil test to priceDataToWei

* TODO: Reminder for something I noticed is missing

* cmd/starter: Support currencies for custom broadcaster prices

* eth: Address minor review comments

* eth,eth/watchers: Improve pricefeed watcher interface

* eth/watchers: Fix pricefeed watcher after merge

* cmd,core,server: Support dynamic updates to price in USD

* eth/watchers: Remove truncated ticker tests

* eth/watchers: Finalize pricefeedwatcher docs/tests

* cmd: Address review comment

* core: Create tests for autoconvertedprice

* cmd,core: Move wei default to AutoConvertedPrice

* Address review comments

* cmd: Fix the e2e flow for setting/updating configs

* CHANGELOG

* cmd: Make sure pricePerPixel can be specified with e notation

Parse it directlty as a big.Rat from a raw string, like I was
doing for pricePerUnit in some places.

* Fix tests

Turns out tests were not running on my branch due to base branch

* go fmt

* core: Fix typo in comment

* cmd,server: Use 3 decimal points when logging PPP

Found out that's officially supported precision on the
discovery logic, so let's reflect that here.

* Release 0.7.3 (#2988)

* release v0.7.3

* release v0.7.3

* Revert "Bump ffmpeg version and nv-codec-headers" (#2989)

* Revert "Bump ffmpeg version and nv-codec-headers (#2973)"

This reverts commit cad6713.

* Revert "Update CUDA build version from 11.7.1 to 12.0.0 (#2978)"

This reverts commit 6c09a9f.

* Reapply "Update CUDA build version from 11.7.1 to 12.0.0 (#2978)"

This reverts commit ebbf210.

* Force ffmpeg reinstall

* Revert "Force ffmpeg reinstall"

This reverts commit 5adb9a5.

---------

Co-authored-by: Victor Elias <[email protected]>

* Bump LPMS (#2992)

* release v0.7.4 (#2993)

* server: Skip redundant maxPrice check in ongoing session (#2994)

* server: Remove maxPrice check mid-session

* server: Fix tests

* server: Fix erroneous usage of assert.EqualErrorf

When I was writing the tests for validatePrice I found out
we were using that function wrong in a couple places and
never checking any error. We were sending err.Error() to check
the error from err.

* server: Fix error checks after fixing assertion

* CHANGELOG

* server: Allow Os price to increase up to 2x mid-session (#2995)

* server: Allow dynamic (and sometimes >max) prices for Os

* CHANGELOG

* server,discovery: Allow B to use any O in case none match maxPrice (#2999)

* discovery: Ignore maxPrice on db_discovery queries

Still kept the feature on the db as it had all the tests
already implemented and could still be useful in the future.
I can remove it if preferred though.

* server: Get prices as big rats for selection

While this may not seem useful now since we just convert
them to floats on the probability calculation, it will be
useful later when comparing prices to max price.

* server: Add maxPrice filter logic on selection algorithm

* CHANGELOG

* server: Break filter in 2 functions

* Fix transcoding price metrics (#3001)

* ci(ai): add AI issue templates

This commit introduces two new AI-specific issue templates, aiming to streamline
the routing of AI subnet-related issues and feature requests to the appropriate team.

* ci(ai): add AI pull request labeler

This commit adds a pull request labeler action that automatically
attaches the `ai` label when a pull request is created to the `ai-video`
branch.

* ci: change issue template order and add PR labeler config (#3006)

* ci: change issue template order

This commit ensures that the main branch issue templates are put above
the AI related issue templates.

* ci(ai): add PR labeler config file

This commmit adds a https://github.com/actions/labeler configuration
file so that all PRs on the `ai-video` branch will be correctly labeled
with the `ai` label.

* ci(ai): fix incorrect labels (#3012)

* ci(ai): fix incorrect labels

This commit fixed the labels that were specified in the Issue Templates
to the one found in the repository.

* ci: rename labeler and remove trailing whitespace

* ci(ai): fix pull request config warning (#3018) (#3019)

* ci(ai): fix pull request config warning (#3018)

This commit gets rid of the Pull request labeler configuration file
warning.

* ci(ai): auto assign AI issues

This commit auto assigns the AI issues to the right member of the AI
team.

* ci(ai): cleanup labeler actions

This commit cleans up the labeler actions and ensure they run on the
right triggers.

* Initialize round by any B/O who has the initializeRound flag set to true (#3029)

* Fix CI Darwin Build (#3049)

* Fix CI

* Fix CI

* chore: fix function names (#3040)

Signed-off-by: kevincatty <[email protected]>
Co-authored-by: Rafał Leszko <[email protected]>

* Create option to filter Os by min livepeer version used (#3050)

* Update LPMS with the mobile transcoding fix (#3003)

* Release 0.7.5 (#3051)

* refactor: add -gateway and deprecate -broadcaster (#3053)

* refactor: add -gateway and deprecate -broadcaster

This commit adds the `gateway` flag and deprecates the `broadcaster` flag
per core team decision (details:
https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

---------

Co-authored-by: John | Elite Encoder <[email protected]>

* refactor(census): rename Broadcaster metrics to Gateway (#3055)

* refactor(census): rename Broadcaster metrics to Gateway

This commit renames the metrics related to Broadcaster to Gateway, following
a team decision. More details can be found in the discussion
here:
[Team Discussion Link](.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* refactor: add -pricePerGateway and deprecate -pricePerBroadcaster (#3056)

* refactor: add -pricePerGateway and deprecate -pricePerBroadcaster

This commit adds the `pricePerGateway` flag and deprecates the `pricePerBroadcaster` flag
per core team decision (details:
https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* refactor: remove redundant deprecation comment

This commit removes the `PricePerBroadcaster` deprecation comment since
this is already clear from the glog warning below.

* fix: correct the `pricePerBroadcaster` flag check

This commit ensures that the deprecation condition for the `pricePerBroadcaster`
flag properly handles the default empty string value.

* fix: ensure 'pricePerGateway' is used

This commit ensures that the `pricePerGateway` is correctly used instead
of the `pricePerBroadcaster` when it is set.

* refactor: deprecate 'pricePerGateway' broadcasters property in favor of 'gateways'

This commit updates the configuration to replace the `broadcasters` property
specified under the `pricePerGateway` flag with `gateways`. Additionally, it
ensures that a warning is issued when the deprecated property is still used.

* test: fix TestParseGetBroadcasterPrices test

This commit ensures that the TestParseGetBroadcasterPrices function uses
the new getGatewayPrices function.

* test: rename TestParseGetBroadcasterPrices to reflect Gateway naming

This commit updates the `TestParseGetBroadcasterPrices` function to
`TestParseGetGatewayPrices` to align with the new node naming convention.

* ci: protect Docker 'stable' tag (#3062)

This commit introduces a safeguard to ensure that the Docker image
tagged
as 'stable' is only pushed when a new tag is created on the stable
branch.
This prevents unintended updates to the stable Docker image, ensuring
consistency and reliability for users relying on the stable tag.

* Return appropriate errors when auth fails, not just 5xx (#3065)

* Return appropriate errors when auth fails, not just 5xx

* Fix unit tests for new signature

* Fix remaining tests

* Fix another test

* Refactor Forbidden to error type

* Refactor Forbidden to error type

---------

Co-authored-by: Rafał Leszko <[email protected]>

* ci: fix syntax error in Docker action tags (#3068)

* ci: fix syntax error in Docker action tags

This commit addresses a syntax error in the Docker image tag creation
step.

* ci(docker): ensure stable tag is created on master branch

This commit ensures that the stable tag is created on the master branch.

* chore: fix some comments (#3070)

Signed-off-by: linghuying <[email protected]>

* Add logging to selection_algorithm.go (#3076)

* Add logging to selection_algorithm.go

* Add even more logging

* Fix typo in logs (#3079)

* Add ctx to logging for selection algorithm (#3080)

* Add ctx to logging for selection algorithm

* Reorg imports

* Fix unit tests

* chore: make function comment match function name (#3081)

Signed-off-by: tongjicoder <[email protected]>

* refactor: rename internal references from Broadcaster to Gateway (#3060)

* refactor: rename internal references from Broadcaster to Gateway

This commit updates internal references from 'Broadcaster' to 'Gateway'
in accordance with the core team’s decision. For more details, refer to
the discussion: [Discord
Link](https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* Add logging to the session refresh (#3083)

* Add `/healthz` endpoint (#3095)

* Update LPMS to ffmpeg 7 (#3096)

* install_ffmpeg: point to LPMS

* Update to use ffmpeg7 LPMS

* release v0.7.6

* chore(ai): ensure ai-video-rebased ffmpeg file is used

Since the lpms `ai-video` and `ai-video-rebase-main` branches are not
yet merged into the main branch we need to ensure the right AI
install_ffmpeg.sh script is used.

* chore(ai): remove local go module dependency

This commit removes the local go module dependency to lpms that was
accidentally commited.

* test: fix broadcast test

This commit fixes the bugs that were introduced by the AI codebas einto
the broadcast test functions.

* feat(ai): add dynamic pricePerUnit feature to AI pricing

This commit ensures that Orchestrators can set their pricing in USD and
the price gets updated dynamically.

* cmd: Use `-gateway` consistently

Avoid references to deprecated CLI flags.

* feat(ai): add minLivepeerVersion constraint and IgnorePreReleaseVersions

- Adds minLivepeerVersion constraint from
  #3050 to the AI codebase.
- Introduces `IgnorePreReleaseVersions` flag to filter out pre-release versions.

This update is essential for distinguishing AI subnet versions, which use pre-release
suffixes, from standard transcoding releases. This new flag can be
removed when merging in the main branch.

* fix(ai): fix offchain 'PriceFeedWatcher is not initialized' error

This commit ensures that the `PriceFeedWatcher is not initialized` error
is not thrown when the software is run in `offchain` mode.

* test: add pre-release suffix min version tests

This commit adds some tests to check if pre-release versions are
correctly handled when filtering orchestrators based on minimum version.

* feat: simplify pre-release version filter logic

This commit removes the POC `ignorePreReleaseVersions` command line
argument for logic in the `LivepeerVersionCompatibleWith` which ensures
that pre-release versions are only checked when the gateway specifies as
pre-release suffix in the `orchMinLivepeerVersion` command line
argument.

* feat: allow Gateways to filter by pre-release

This commit gives Gateways the ability to filter by pre-release suffix.
When a pre-release suffix is specified in the `OrchMinLivepeerVersion`
command line argument the software now also checks the pre-release
version suffix on the orchestrator.

* refactor(ai): rename capability constraint variable

This commit renames the orchConstraints variable in the capabilities.go
file to better reflect that it are constraints per capabilities.

* chore(ai): remove lpms local dependency

This commit ensure that the right remote dependency is used for the lpms
package.

* chore(ai): update lpms dependency

This commit updates the lpms dependency to the lastest version of the
`ai-video-rebase-main`.

* feat: remove AI specific minVersion constraint logic

This commit removes the ai-specific logic that allows ai suffixes to
work during version constraint checking. This was done to add it back in
a seperate commit so that we can always revert.

* feat(ai): Add AI suffix handling for min version logic

This commit introduces logic to handle version constraints with AI-specific
suffixes (e.g., v0.7.6-ai.1). This ensures compatibility during version
constraint filtering. Note that this logic should be removed when merging
into the master branch.

* core: Make the AI config take a big rat

* fix: add AIModels currency config field and fix pixelsPerUnit handling

This commit adds a new `currency` field to the `AIModelConfig` to specify the
currency. Additionally, it improves the AI startup code in `starter.go` to
correctly handle parsing of this currency while ensuring compatibility with
'offchain' mode. Further improvements to the AI startup code are deferred to
avoid conflicts with existing pull requests.

* fix(ai): temporarily disable arm64 builds

This commit disables the linux/arm64 for now as we haven't yet added support it.
This prevent the Docker CI from failing.

---------

Signed-off-by: kevincatty <[email protected]>
Signed-off-by: linghuying <[email protected]>
Signed-off-by: tongjicoder <[email protected]>
Co-authored-by: Victor Elias <[email protected]>
Co-authored-by: Rafał Leszko <[email protected]>
Co-authored-by: Thom Shutt <[email protected]>
Co-authored-by: Victor Elias <[email protected]>
Co-authored-by: kevincatty <[email protected]>
Co-authored-by: John | Elite Encoder <[email protected]>
Co-authored-by: linghuying <[email protected]>
Co-authored-by: tongjicoder <[email protected]>
Co-authored-by: Josh Allmann <[email protected]>
rickstaa added a commit that referenced this pull request Aug 7, 2024
This commit aims to synchronize the ai-video branch with the master branch. It addresses an issue where PR #3103 was not correctly recognized by GitHub as being in sync with the master branch.

* eth,eth/watcher: Create Chainlink price feed watcher (#2972)

* eth/watchers: Create PriceFeed watcher

Makefile: Use mockgen binary from tool dependencies

eth/contracts: Add chainlink interfaces source

Makefile: Generate Chainlink contracts ABI

tools: Add abigen tool to repo

eth/contracts: Generate chainlink bindings

Makefile: Fix abigen bindings generation

Revert everything abigen

Turns out there's already bindings exported from the Chainlink lib.

go.mod: Add chainlink library

eth/watchers: Add pricefeed watcher

eth/watchers: Clean-up event watching code

eth/watchers: Improve price tracking

Revert "go.mod: Add chainlink library"

This reverts commit ac415bd.

Revert "Revert everything abigen"

This reverts commit b7c40b1.

eth/contracts: Gen bindings for proxy iface

eth/watchers: Use local bindings for contracts

eth/watchers: Simplify event subs logic

eth/watchers: Simplify&optimize truncated ticker

eth/watchers: Update decimals on fetch

eth/watchers: Improve handling of decimals

eth/watchers: Fix price rat creation

eth/watchers: Make sure we use UTC on truncated timer

eth/contracts/chainlink: Generate only V3 contract bindings

eth/watchers: Watch PriceFeed only with polling

eth/watchers: Add a retry logic on price update

eth/watchers: Use clog instead of fmt.Printf

* eth: Create separate pricefeed client unit

This will make the code more testable.

* eth: Add tests for pricefeed client

* eth/watchers: Add tests to the truncated ticker

Gosh that was much harder than I thought

* eth/watchers: Add tests for pricefeedwatcher

* eth: Add comments to the new components

* go fmt

* eth: Address minor review comments

* eth,eth/watchers: Improve pricefeed watcher interface

* eth/watchers: Remove truncated ticker tests

* cmd/livepeer: Use price feed watcher for dynamic pricePerPixel (#2981)

* eth/watchers: Create PriceFeed watcher

Makefile: Use mockgen binary from tool dependencies

eth/contracts: Add chainlink interfaces source

Makefile: Generate Chainlink contracts ABI

tools: Add abigen tool to repo

eth/contracts: Generate chainlink bindings

Makefile: Fix abigen bindings generation

Revert everything abigen

Turns out there's already bindings exported from the Chainlink lib.

go.mod: Add chainlink library

eth/watchers: Add pricefeed watcher

eth/watchers: Clean-up event watching code

eth/watchers: Improve price tracking

Revert "go.mod: Add chainlink library"

This reverts commit ac415bd.

Revert "Revert everything abigen"

This reverts commit b7c40b1.

eth/contracts: Gen bindings for proxy iface

eth/watchers: Use local bindings for contracts

eth/watchers: Simplify event subs logic

eth/watchers: Simplify&optimize truncated ticker

eth/watchers: Update decimals on fetch

eth/watchers: Improve handling of decimals

eth/watchers: Fix price rat creation

eth/watchers: Make sure we use UTC on truncated timer

eth/contracts/chainlink: Generate only V3 contract bindings

eth/watchers: Watch PriceFeed only with polling

eth/watchers: Add a retry logic on price update

eth/watchers: Use clog instead of fmt.Printf

* eth: Create separate pricefeed client unit

This will make the code more testable.

* eth: Add tests for pricefeed client

* eth/watchers: Add tests to the truncated ticker

Gosh that was much harder than I thought

* eth/watchers: Add tests for pricefeedwatcher

* eth: Add comments to the new components

* go fmt

* cmd: make pricePerUnit flags strings

* cmd: Allow price per unit to be speficied with a currency

Currently ignoring the currency value.

* cmd: Add logic to start price update loop

* cmd: Add flag for specifying price feed address

* cmd: Add a lil test to priceDataToWei

* TODO: Reminder for something I noticed is missing

* cmd/starter: Support currencies for custom broadcaster prices

* eth: Address minor review comments

* eth,eth/watchers: Improve pricefeed watcher interface

* eth/watchers: Fix pricefeed watcher after merge

* cmd,core,server: Support dynamic updates to price in USD

* eth/watchers: Remove truncated ticker tests

* eth/watchers: Finalize pricefeedwatcher docs/tests

* cmd: Address review comment

* core: Create tests for autoconvertedprice

* cmd,core: Move wei default to AutoConvertedPrice

* Address review comments

* cmd: Fix the e2e flow for setting/updating configs

* CHANGELOG

* cmd: Make sure pricePerPixel can be specified with e notation

Parse it directlty as a big.Rat from a raw string, like I was
doing for pricePerUnit in some places.

* Fix tests

Turns out tests were not running on my branch due to base branch

* go fmt

* core: Fix typo in comment

* cmd,server: Use 3 decimal points when logging PPP

Found out that's officially supported precision on the
discovery logic, so let's reflect that here.

* Release 0.7.3 (#2988)

* release v0.7.3

* release v0.7.3

* Revert "Bump ffmpeg version and nv-codec-headers" (#2989)

* Revert "Bump ffmpeg version and nv-codec-headers (#2973)"

This reverts commit cad6713.

* Revert "Update CUDA build version from 11.7.1 to 12.0.0 (#2978)"

This reverts commit 6c09a9f.

* Reapply "Update CUDA build version from 11.7.1 to 12.0.0 (#2978)"

This reverts commit ebbf210.

* Force ffmpeg reinstall

* Revert "Force ffmpeg reinstall"

This reverts commit 5adb9a5.

---------

Co-authored-by: Victor Elias <[email protected]>

* Bump LPMS (#2992)

* release v0.7.4 (#2993)

* server: Skip redundant maxPrice check in ongoing session (#2994)

* server: Remove maxPrice check mid-session

* server: Fix tests

* server: Fix erroneous usage of assert.EqualErrorf

When I was writing the tests for validatePrice I found out
we were using that function wrong in a couple places and
never checking any error. We were sending err.Error() to check
the error from err.

* server: Fix error checks after fixing assertion

* CHANGELOG

* server: Allow Os price to increase up to 2x mid-session (#2995)

* server: Allow dynamic (and sometimes >max) prices for Os

* CHANGELOG

* server,discovery: Allow B to use any O in case none match maxPrice (#2999)

* discovery: Ignore maxPrice on db_discovery queries

Still kept the feature on the db as it had all the tests
already implemented and could still be useful in the future.
I can remove it if preferred though.

* server: Get prices as big rats for selection

While this may not seem useful now since we just convert
them to floats on the probability calculation, it will be
useful later when comparing prices to max price.

* server: Add maxPrice filter logic on selection algorithm

* CHANGELOG

* server: Break filter in 2 functions

* Fix transcoding price metrics (#3001)

* ci(ai): add AI issue templates

This commit introduces two new AI-specific issue templates, aiming to streamline
the routing of AI subnet-related issues and feature requests to the appropriate team.

* ci(ai): add AI pull request labeler

This commit adds a pull request labeler action that automatically
attaches the `ai` label when a pull request is created to the `ai-video`
branch.

* ci: change issue template order and add PR labeler config (#3006)

* ci: change issue template order

This commit ensures that the main branch issue templates are put above
the AI related issue templates.

* ci(ai): add PR labeler config file

This commmit adds a https://github.com/actions/labeler configuration
file so that all PRs on the `ai-video` branch will be correctly labeled
with the `ai` label.

* ci(ai): fix incorrect labels (#3012)

* ci(ai): fix incorrect labels

This commit fixed the labels that were specified in the Issue Templates
to the one found in the repository.

* ci: rename labeler and remove trailing whitespace

* ci(ai): fix pull request config warning (#3018) (#3019)

* ci(ai): fix pull request config warning (#3018)

This commit gets rid of the Pull request labeler configuration file
warning.

* ci(ai): auto assign AI issues

This commit auto assigns the AI issues to the right member of the AI
team.

* ci(ai): cleanup labeler actions

This commit cleans up the labeler actions and ensure they run on the
right triggers.

* Initialize round by any B/O who has the initializeRound flag set to true (#3029)

* Fix CI Darwin Build (#3049)

* Fix CI

* Fix CI

* chore: fix function names (#3040)

Signed-off-by: kevincatty <[email protected]>
Co-authored-by: Rafał Leszko <[email protected]>

* Create option to filter Os by min livepeer version used (#3050)

* Update LPMS with the mobile transcoding fix (#3003)

* Release 0.7.5 (#3051)

* refactor: add -gateway and deprecate -broadcaster (#3053)

* refactor: add -gateway and deprecate -broadcaster

This commit adds the `gateway` flag and deprecates the `broadcaster` flag
per core team decision (details:
https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

---------

Co-authored-by: John | Elite Encoder <[email protected]>

* refactor(census): rename Broadcaster metrics to Gateway (#3055)

* refactor(census): rename Broadcaster metrics to Gateway

This commit renames the metrics related to Broadcaster to Gateway, following
a team decision. More details can be found in the discussion
here:
[Team Discussion Link](.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* refactor: add -pricePerGateway and deprecate -pricePerBroadcaster (#3056)

* refactor: add -pricePerGateway and deprecate -pricePerBroadcaster

This commit adds the `pricePerGateway` flag and deprecates the `pricePerBroadcaster` flag
per core team decision (details:
https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* refactor: remove redundant deprecation comment

This commit removes the `PricePerBroadcaster` deprecation comment since
this is already clear from the glog warning below.

* fix: correct the `pricePerBroadcaster` flag check

This commit ensures that the deprecation condition for the `pricePerBroadcaster`
flag properly handles the default empty string value.

* fix: ensure 'pricePerGateway' is used

This commit ensures that the `pricePerGateway` is correctly used instead
of the `pricePerBroadcaster` when it is set.

* refactor: deprecate 'pricePerGateway' broadcasters property in favor of 'gateways'

This commit updates the configuration to replace the `broadcasters` property
specified under the `pricePerGateway` flag with `gateways`. Additionally, it
ensures that a warning is issued when the deprecated property is still used.

* test: fix TestParseGetBroadcasterPrices test

This commit ensures that the TestParseGetBroadcasterPrices function uses
the new getGatewayPrices function.

* test: rename TestParseGetBroadcasterPrices to reflect Gateway naming

This commit updates the `TestParseGetBroadcasterPrices` function to
`TestParseGetGatewayPrices` to align with the new node naming convention.

* ci: protect Docker 'stable' tag (#3062)

This commit introduces a safeguard to ensure that the Docker image
tagged
as 'stable' is only pushed when a new tag is created on the stable
branch.
This prevents unintended updates to the stable Docker image, ensuring
consistency and reliability for users relying on the stable tag.

* Return appropriate errors when auth fails, not just 5xx (#3065)

* Return appropriate errors when auth fails, not just 5xx

* Fix unit tests for new signature

* Fix remaining tests

* Fix another test

* Refactor Forbidden to error type

* Refactor Forbidden to error type

---------

Co-authored-by: Rafał Leszko <[email protected]>

* ci: fix syntax error in Docker action tags (#3068)

* ci: fix syntax error in Docker action tags

This commit addresses a syntax error in the Docker image tag creation
step.

* ci(docker): ensure stable tag is created on master branch

This commit ensures that the stable tag is created on the master branch.

* chore: fix some comments (#3070)

Signed-off-by: linghuying <[email protected]>

* Add logging to selection_algorithm.go (#3076)

* Add logging to selection_algorithm.go

* Add even more logging

* Fix typo in logs (#3079)

* Add ctx to logging for selection algorithm (#3080)

* Add ctx to logging for selection algorithm

* Reorg imports

* Fix unit tests

* chore: make function comment match function name (#3081)

Signed-off-by: tongjicoder <[email protected]>

* refactor: rename internal references from Broadcaster to Gateway (#3060)

* refactor: rename internal references from Broadcaster to Gateway

This commit updates internal references from 'Broadcaster' to 'Gateway'
in accordance with the core team’s decision. For more details, refer to
the discussion: [Discord
Link](https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* Add logging to the session refresh (#3083)

* Add `/healthz` endpoint (#3095)

* Update LPMS to ffmpeg 7 (#3096)

* install_ffmpeg: point to LPMS

* Update to use ffmpeg7 LPMS

* release v0.7.6

* cmd: Use `-gateway` consistently

Avoid references to deprecated CLI flags.

* core: Rename 'InArray' to 'HasCapability' (#3118)

---------

Signed-off-by: kevincatty <[email protected]>
Signed-off-by: linghuying <[email protected]>
Signed-off-by: tongjicoder <[email protected]>
Co-authored-by: Victor Elias <[email protected]>
Co-authored-by: Rafał Leszko <[email protected]>
Co-authored-by: Thom Shutt <[email protected]>
Co-authored-by: Victor Elias <[email protected]>
Co-authored-by: kevincatty <[email protected]>
Co-authored-by: John | Elite Encoder <[email protected]>
Co-authored-by: linghuying <[email protected]>
Co-authored-by: tongjicoder <[email protected]>
Co-authored-by: Josh Allmann <[email protected]>
rickstaa added a commit that referenced this pull request Aug 7, 2024
* eth,eth/watcher: Create Chainlink price feed watcher (#2972)

* eth/watchers: Create PriceFeed watcher

Makefile: Use mockgen binary from tool dependencies

eth/contracts: Add chainlink interfaces source

Makefile: Generate Chainlink contracts ABI

tools: Add abigen tool to repo

eth/contracts: Generate chainlink bindings

Makefile: Fix abigen bindings generation

Revert everything abigen

Turns out there's already bindings exported from the Chainlink lib.

go.mod: Add chainlink library

eth/watchers: Add pricefeed watcher

eth/watchers: Clean-up event watching code

eth/watchers: Improve price tracking

Revert "go.mod: Add chainlink library"

This reverts commit ac415bd.

Revert "Revert everything abigen"

This reverts commit b7c40b1.

eth/contracts: Gen bindings for proxy iface

eth/watchers: Use local bindings for contracts

eth/watchers: Simplify event subs logic

eth/watchers: Simplify&optimize truncated ticker

eth/watchers: Update decimals on fetch

eth/watchers: Improve handling of decimals

eth/watchers: Fix price rat creation

eth/watchers: Make sure we use UTC on truncated timer

eth/contracts/chainlink: Generate only V3 contract bindings

eth/watchers: Watch PriceFeed only with polling

eth/watchers: Add a retry logic on price update

eth/watchers: Use clog instead of fmt.Printf

* eth: Create separate pricefeed client unit

This will make the code more testable.

* eth: Add tests for pricefeed client

* eth/watchers: Add tests to the truncated ticker

Gosh that was much harder than I thought

* eth/watchers: Add tests for pricefeedwatcher

* eth: Add comments to the new components

* go fmt

* eth: Address minor review comments

* eth,eth/watchers: Improve pricefeed watcher interface

* eth/watchers: Remove truncated ticker tests

* cmd/livepeer: Use price feed watcher for dynamic pricePerPixel (#2981)

* eth/watchers: Create PriceFeed watcher

Makefile: Use mockgen binary from tool dependencies

eth/contracts: Add chainlink interfaces source

Makefile: Generate Chainlink contracts ABI

tools: Add abigen tool to repo

eth/contracts: Generate chainlink bindings

Makefile: Fix abigen bindings generation

Revert everything abigen

Turns out there's already bindings exported from the Chainlink lib.

go.mod: Add chainlink library

eth/watchers: Add pricefeed watcher

eth/watchers: Clean-up event watching code

eth/watchers: Improve price tracking

Revert "go.mod: Add chainlink library"

This reverts commit ac415bd.

Revert "Revert everything abigen"

This reverts commit b7c40b1.

eth/contracts: Gen bindings for proxy iface

eth/watchers: Use local bindings for contracts

eth/watchers: Simplify event subs logic

eth/watchers: Simplify&optimize truncated ticker

eth/watchers: Update decimals on fetch

eth/watchers: Improve handling of decimals

eth/watchers: Fix price rat creation

eth/watchers: Make sure we use UTC on truncated timer

eth/contracts/chainlink: Generate only V3 contract bindings

eth/watchers: Watch PriceFeed only with polling

eth/watchers: Add a retry logic on price update

eth/watchers: Use clog instead of fmt.Printf

* eth: Create separate pricefeed client unit

This will make the code more testable.

* eth: Add tests for pricefeed client

* eth/watchers: Add tests to the truncated ticker

Gosh that was much harder than I thought

* eth/watchers: Add tests for pricefeedwatcher

* eth: Add comments to the new components

* go fmt

* cmd: make pricePerUnit flags strings

* cmd: Allow price per unit to be speficied with a currency

Currently ignoring the currency value.

* cmd: Add logic to start price update loop

* cmd: Add flag for specifying price feed address

* cmd: Add a lil test to priceDataToWei

* TODO: Reminder for something I noticed is missing

* cmd/starter: Support currencies for custom broadcaster prices

* eth: Address minor review comments

* eth,eth/watchers: Improve pricefeed watcher interface

* eth/watchers: Fix pricefeed watcher after merge

* cmd,core,server: Support dynamic updates to price in USD

* eth/watchers: Remove truncated ticker tests

* eth/watchers: Finalize pricefeedwatcher docs/tests

* cmd: Address review comment

* core: Create tests for autoconvertedprice

* cmd,core: Move wei default to AutoConvertedPrice

* Address review comments

* cmd: Fix the e2e flow for setting/updating configs

* CHANGELOG

* cmd: Make sure pricePerPixel can be specified with e notation

Parse it directlty as a big.Rat from a raw string, like I was
doing for pricePerUnit in some places.

* Fix tests

Turns out tests were not running on my branch due to base branch

* go fmt

* core: Fix typo in comment

* cmd,server: Use 3 decimal points when logging PPP

Found out that's officially supported precision on the
discovery logic, so let's reflect that here.

* Release 0.7.3 (#2988)

* release v0.7.3

* release v0.7.3

* Revert "Bump ffmpeg version and nv-codec-headers" (#2989)

* Revert "Bump ffmpeg version and nv-codec-headers (#2973)"

This reverts commit cad6713.

* Revert "Update CUDA build version from 11.7.1 to 12.0.0 (#2978)"

This reverts commit 6c09a9f.

* Reapply "Update CUDA build version from 11.7.1 to 12.0.0 (#2978)"

This reverts commit ebbf210.

* Force ffmpeg reinstall

* Revert "Force ffmpeg reinstall"

This reverts commit 5adb9a5.

---------

Co-authored-by: Victor Elias <[email protected]>

* Bump LPMS (#2992)

* release v0.7.4 (#2993)

* server: Skip redundant maxPrice check in ongoing session (#2994)

* server: Remove maxPrice check mid-session

* server: Fix tests

* server: Fix erroneous usage of assert.EqualErrorf

When I was writing the tests for validatePrice I found out
we were using that function wrong in a couple places and
never checking any error. We were sending err.Error() to check
the error from err.

* server: Fix error checks after fixing assertion

* CHANGELOG

* server: Allow Os price to increase up to 2x mid-session (#2995)

* server: Allow dynamic (and sometimes >max) prices for Os

* CHANGELOG

* server,discovery: Allow B to use any O in case none match maxPrice (#2999)

* discovery: Ignore maxPrice on db_discovery queries

Still kept the feature on the db as it had all the tests
already implemented and could still be useful in the future.
I can remove it if preferred though.

* server: Get prices as big rats for selection

While this may not seem useful now since we just convert
them to floats on the probability calculation, it will be
useful later when comparing prices to max price.

* server: Add maxPrice filter logic on selection algorithm

* CHANGELOG

* server: Break filter in 2 functions

* Fix transcoding price metrics (#3001)

* ci(ai): add AI issue templates

This commit introduces two new AI-specific issue templates, aiming to streamline
the routing of AI subnet-related issues and feature requests to the appropriate team.

* ci(ai): add AI pull request labeler

This commit adds a pull request labeler action that automatically
attaches the `ai` label when a pull request is created to the `ai-video`
branch.

* ci: change issue template order and add PR labeler config (#3006)

* ci: change issue template order

This commit ensures that the main branch issue templates are put above
the AI related issue templates.

* ci(ai): add PR labeler config file

This commmit adds a https://github.com/actions/labeler configuration
file so that all PRs on the `ai-video` branch will be correctly labeled
with the `ai` label.

* ci(ai): fix incorrect labels (#3012)

* ci(ai): fix incorrect labels

This commit fixed the labels that were specified in the Issue Templates
to the one found in the repository.

* ci: rename labeler and remove trailing whitespace

* ci(ai): fix pull request config warning (#3018) (#3019)

* ci(ai): fix pull request config warning (#3018)

This commit gets rid of the Pull request labeler configuration file
warning.

* ci(ai): auto assign AI issues

This commit auto assigns the AI issues to the right member of the AI
team.

* ci(ai): cleanup labeler actions

This commit cleans up the labeler actions and ensure they run on the
right triggers.

* Initialize round by any B/O who has the initializeRound flag set to true (#3029)

* Fix CI Darwin Build (#3049)

* Fix CI

* Fix CI

* chore: fix function names (#3040)

Signed-off-by: kevincatty <[email protected]>
Co-authored-by: Rafał Leszko <[email protected]>

* Create option to filter Os by min livepeer version used (#3050)

* Update LPMS with the mobile transcoding fix (#3003)

* Release 0.7.5 (#3051)

* refactor: add -gateway and deprecate -broadcaster (#3053)

* refactor: add -gateway and deprecate -broadcaster

This commit adds the `gateway` flag and deprecates the `broadcaster` flag
per core team decision (details:
https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

---------

Co-authored-by: John | Elite Encoder <[email protected]>

* refactor(census): rename Broadcaster metrics to Gateway (#3055)

* refactor(census): rename Broadcaster metrics to Gateway

This commit renames the metrics related to Broadcaster to Gateway, following
a team decision. More details can be found in the discussion
here:
[Team Discussion Link](.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* refactor: add -pricePerGateway and deprecate -pricePerBroadcaster (#3056)

* refactor: add -pricePerGateway and deprecate -pricePerBroadcaster

This commit adds the `pricePerGateway` flag and deprecates the `pricePerBroadcaster` flag
per core team decision (details:
https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* refactor: remove redundant deprecation comment

This commit removes the `PricePerBroadcaster` deprecation comment since
this is already clear from the glog warning below.

* fix: correct the `pricePerBroadcaster` flag check

This commit ensures that the deprecation condition for the `pricePerBroadcaster`
flag properly handles the default empty string value.

* fix: ensure 'pricePerGateway' is used

This commit ensures that the `pricePerGateway` is correctly used instead
of the `pricePerBroadcaster` when it is set.

* refactor: deprecate 'pricePerGateway' broadcasters property in favor of 'gateways'

This commit updates the configuration to replace the `broadcasters` property
specified under the `pricePerGateway` flag with `gateways`. Additionally, it
ensures that a warning is issued when the deprecated property is still used.

* test: fix TestParseGetBroadcasterPrices test

This commit ensures that the TestParseGetBroadcasterPrices function uses
the new getGatewayPrices function.

* test: rename TestParseGetBroadcasterPrices to reflect Gateway naming

This commit updates the `TestParseGetBroadcasterPrices` function to
`TestParseGetGatewayPrices` to align with the new node naming convention.

* ci: protect Docker 'stable' tag (#3062)

This commit introduces a safeguard to ensure that the Docker image
tagged
as 'stable' is only pushed when a new tag is created on the stable
branch.
This prevents unintended updates to the stable Docker image, ensuring
consistency and reliability for users relying on the stable tag.

* Return appropriate errors when auth fails, not just 5xx (#3065)

* Return appropriate errors when auth fails, not just 5xx

* Fix unit tests for new signature

* Fix remaining tests

* Fix another test

* Refactor Forbidden to error type

* Refactor Forbidden to error type

---------

Co-authored-by: Rafał Leszko <[email protected]>

* ci: fix syntax error in Docker action tags (#3068)

* ci: fix syntax error in Docker action tags

This commit addresses a syntax error in the Docker image tag creation
step.

* ci(docker): ensure stable tag is created on master branch

This commit ensures that the stable tag is created on the master branch.

* chore: fix some comments (#3070)

Signed-off-by: linghuying <[email protected]>

* Add logging to selection_algorithm.go (#3076)

* Add logging to selection_algorithm.go

* Add even more logging

* Fix typo in logs (#3079)

* Add ctx to logging for selection algorithm (#3080)

* Add ctx to logging for selection algorithm

* Reorg imports

* Fix unit tests

* chore: make function comment match function name (#3081)

Signed-off-by: tongjicoder <[email protected]>

* refactor: rename internal references from Broadcaster to Gateway (#3060)

* refactor: rename internal references from Broadcaster to Gateway

This commit updates internal references from 'Broadcaster' to 'Gateway'
in accordance with the core team’s decision. For more details, refer to
the discussion: [Discord
Link](https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog

* Add logging to the session refresh (#3083)

* Add `/healthz` endpoint (#3095)

* Update LPMS to ffmpeg 7 (#3096)

* install_ffmpeg: point to LPMS

* Update to use ffmpeg7 LPMS

* release v0.7.6

* chore(ai): ensure ai-video-rebased ffmpeg file is used

Since the lpms `ai-video` and `ai-video-rebase-main` branches are not
yet merged into the main branch we need to ensure the right AI
install_ffmpeg.sh script is used.

* chore(ai): remove local go module dependency

This commit removes the local go module dependency to lpms that was
accidentally commited.

* test: fix broadcast test

This commit fixes the bugs that were introduced by the AI codebas einto
the broadcast test functions.

* feat(ai): add dynamic pricePerUnit feature to AI pricing

This commit ensures that Orchestrators can set their pricing in USD and
the price gets updated dynamically.

* cmd: Use `-gateway` consistently

Avoid references to deprecated CLI flags.

* feat(ai): add minLivepeerVersion constraint and IgnorePreReleaseVersions

- Adds minLivepeerVersion constraint from
  #3050 to the AI codebase.
- Introduces `IgnorePreReleaseVersions` flag to filter out pre-release versions.

This update is essential for distinguishing AI subnet versions, which use pre-release
suffixes, from standard transcoding releases. This new flag can be
removed when merging in the main branch.

* fix(ai): fix offchain 'PriceFeedWatcher is not initialized' error

This commit ensures that the `PriceFeedWatcher is not initialized` error
is not thrown when the software is run in `offchain` mode.

* test: add pre-release suffix min version tests

This commit adds some tests to check if pre-release versions are
correctly handled when filtering orchestrators based on minimum version.

* feat: simplify pre-release version filter logic

This commit removes the POC `ignorePreReleaseVersions` command line
argument for logic in the `LivepeerVersionCompatibleWith` which ensures
that pre-release versions are only checked when the gateway specifies as
pre-release suffix in the `orchMinLivepeerVersion` command line
argument.

* feat: allow Gateways to filter by pre-release

This commit gives Gateways the ability to filter by pre-release suffix.
When a pre-release suffix is specified in the `OrchMinLivepeerVersion`
command line argument the software now also checks the pre-release
version suffix on the orchestrator.

* refactor(ai): rename capability constraint variable

This commit renames the orchConstraints variable in the capabilities.go
file to better reflect that it are constraints per capabilities.

* chore(ai): remove lpms local dependency

This commit ensure that the right remote dependency is used for the lpms
package.

* chore(ai): update lpms dependency

This commit updates the lpms dependency to the lastest version of the
`ai-video-rebase-main`.

* feat: remove AI specific minVersion constraint logic

This commit removes the ai-specific logic that allows ai suffixes to
work during version constraint checking. This was done to add it back in
a seperate commit so that we can always revert.

* feat(ai): Add AI suffix handling for min version logic

This commit introduces logic to handle version constraints with AI-specific
suffixes (e.g., v0.7.6-ai.1). This ensures compatibility during version
constraint filtering. Note that this logic should be removed when merging
into the master branch.

* core: Make the AI config take a big rat

* fix: add AIModels currency config field and fix pixelsPerUnit handling

This commit adds a new `currency` field to the `AIModelConfig` to specify the
currency. Additionally, it improves the AI startup code in `starter.go` to
correctly handle parsing of this currency while ensuring compatibility with
'offchain' mode. Further improvements to the AI startup code are deferred to
avoid conflicts with existing pull requests.

* fix(ai): temporarily disable arm64 builds

This commit disables the linux/arm64 for now as we haven't yet added support it.
This prevent the Docker CI from failing.

---------

Signed-off-by: kevincatty <[email protected]>
Signed-off-by: linghuying <[email protected]>
Signed-off-by: tongjicoder <[email protected]>
Co-authored-by: Victor Elias <[email protected]>
Co-authored-by: Rafał Leszko <[email protected]>
Co-authored-by: Thom Shutt <[email protected]>
Co-authored-by: Victor Elias <[email protected]>
Co-authored-by: kevincatty <[email protected]>
Co-authored-by: John | Elite Encoder <[email protected]>
Co-authored-by: linghuying <[email protected]>
Co-authored-by: tongjicoder <[email protected]>
Co-authored-by: Josh Allmann <[email protected]>
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.

2 participants