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

livepeer_cli: use the O's currently registered Service URI as default address #2416

Merged
merged 1 commit into from
May 23, 2022

Conversation

emranemran
Copy link
Contributor

@emranemran emranemran commented May 19, 2022

When changing config options for the Orchestrator via livepeer_cli, the
public host:port of the node is requested for the configuration to be
applied successfully. This host:port address defaults to using the
ip-address of the node instead of using the global domain name that is
registered when setting up an O node. Use the registered Service URI as
the default option such that the entry can be left blank when
configuring options via the livepeer-cli.

What does this pull request do? Explain your changes. (required)
(see above commit desc)

Specific updates (required)
(see above commit desc)

How did you test each of these updates (required)

  • testing locally using both off-chain and on-chain OT nodes.

Does this pull request close any open issues?
fix #2293

Checklist:

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #2416 (a8b1830) into master (27b1ba8) will decrease coverage by 0.03243%.
The diff coverage is 0.00000%.

❗ Current head a8b1830 differs from pull request most recent head cbe02ed. Consider uploading reports for the commit cbe02ed to get more accurate results

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #2416         +/-   ##
===================================================
- Coverage   54.95519%   54.92276%   -0.03244%     
===================================================
  Files             93          93                 
  Lines          19414       19420          +6     
===================================================
- Hits           10669       10666          -3     
- Misses          8150        8159          +9     
  Partials         595         595                 
Impacted Files Coverage Δ
cmd/livepeer_cli/wizard_transcoder.go 0.00000% <0.00000%> (ø)
discovery/db_discovery.go 64.93056% <0.00000%> (-1.04166%) ⬇️
common/util.go 55.70470% <0.00000%> (ø)
discovery/wh_discovery.go 62.00000% <0.00000%> (+1.80583%) ⬆️

Continue to review full report at Codecov.

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

@emranemran emranemran requested a review from ArcAster May 19, 2022 21:16
@emranemran
Copy link
Contributor Author

Tested locally with both off-chain and on-chain BOT nodes - it's working as expected and addresses the ticket's need.

Copy link
Contributor

@leszko leszko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @emranemran Added one comment.

Other than that, could you improve the PR description with the following points?

  1. Change #2293 to fix #2293. Then, merging this PR will automatically close the related GH Issue
  2. Update PENDING_CHANGELOG.md
  3. Fill the checklist:
  • Run ./test locally and check it if it works
  • Cross out README and other documentation updated if there is README update related to this PR
  • Update PENDING_CHANGELOG.md and check Pending changelog updated

@@ -66,13 +67,16 @@ func (w *wizard) promptOrchestratorConfig() (float64, float64, int, int, string)
fmt.Printf("Enter the price for %d pixels in Wei (required) ", pixelsPerUnit)
pricePerUnit := w.readDefaultInt(0)

addr := myHostPort()
if w.offchain {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this if does not make sense, because you can never run this function in the offchain mode. Orchestrator activation and setting orchestrator config is only for on-chain.

However, I think you need another condition here.

  1. If orch.ServiceURI is already set (orchestrator is already registered on-chain), then use orch.ServiceURI.
  2. Otherwise, use myHostPort()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, that makes more sense. I was thinking there might be some use cases for off-chain where myHostPort needs is used as-is. Will update PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed all comments. Also added a condition to not allow orchestrator config settings to be changed if off-chain is detected based on your comments.

Only outstanding issue was that test.sh fails locally for unrelated reasons - likely related to clang compiler that gets used by default on my Mac M1. The tests executed in this PR all pass so this should be OK to merge. If it's alright, I can follow up with a fix for test.sh failures on Macs as part of a separate ticket.

/opt/homebrew/Cellar/ffmpeg/5.0.1/include/libavformat/avformat.h:2161:41: note: passing argument to parameter 'decoder_ret' here
extras.c:193:13: error: implicit declaration of function 'avfilter_compare_sign_bypath' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
extras.c:193:13: note: did you mean 'lpms_compare_sign_bypath'?
extras.c:191:5: note: 'lpms_compare_sign_bypath' declared here
extras.c:204:13: error: implicit declaration of function 'avfilter_compare_sign_bybuff' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
extras.c:204:13: note: did you mean 'lpms_compare_sign_bybuffer'?
extras.c:202:5: note: 'lpms_compare_sign_bybuffer' declared here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If tests pass on GH Actions, that's fine. M1 may fail for some unrelated reasons. I also experience some test failures on M1.

@emranemran emranemran force-pushed the user/emahbub/use-serviceuri-cli branch 2 times, most recently from 7951465 to 5f304ed Compare May 20, 2022 20:34
CHANGELOG_PENDING.md Outdated Show resolved Hide resolved
@@ -66,13 +67,16 @@ func (w *wizard) promptOrchestratorConfig() (float64, float64, int, int, string)
fmt.Printf("Enter the price for %d pixels in Wei (required) ", pixelsPerUnit)
pricePerUnit := w.readDefaultInt(0)

addr := myHostPort()
if w.offchain {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If tests pass on GH Actions, that's fine. M1 may fail for some unrelated reasons. I also experience some test failures on M1.

Copy link
Contributor

@leszko leszko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added one more minor suggestion, other than that, LGTM 👍

When changing config options for the Orchestrator via livepeer_cli, the
public host:port of the node is requested for the configuration to be
applied successfully. This host:port address defaults to using the
ip-address of the node instead of using the global domain name that is
registered when setting up an O node. Use the registered Service URI as
the default option such that the entry can be left blank when
configuring options via the livepeer-cli.

Update CHANGELOG_PENDING.md

Co-authored-by: Rafał Leszko <[email protected]>
@emranemran emranemran force-pushed the user/emahbub/use-serviceuri-cli branch from a8b1830 to cbe02ed Compare May 23, 2022 16:40
@emranemran emranemran merged commit 54f74ce into master May 23, 2022
@emranemran emranemran deleted the user/emahbub/use-serviceuri-cli branch May 23, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants