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

Fix runtime error in aiWorker when pricePerUnit is unset #3059

Merged
merged 4 commits into from
May 20, 2024

Conversation

eliteprox
Copy link
Contributor

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

Fixes a fatal runtime error when -pricePerUnit is not set, which is allowed with -aiWorker flag in #3047

Specific updates (required)

  • Checks if basePrice is nil before comparing if it is equal to zero.
  • I also added a check if transcodePrice is nil before using it, just in case that condition occurs. Though it shouldn't happen because of startup checks that require -pricePerUnit when -aiWorker is not set

How did you test each of these updates (required)

  • Verified that ai jobs process at the correct price from aiModels.json
  • Verified -pricePerBroadcaster prices are set correctly for transcoding work
  • Verified -pricePerUnit price is used for transcode jobs when -pricePerBroadcaster is unset for the broadcasting address
  • Verified that -autoAdjustPrice still works correctly in all cases

Does this pull request close any open issues?

#3057

Checklist:

@eliteprox eliteprox requested a review from rickstaa as a code owner May 17, 2024 16:42
@github-actions github-actions bot added the AI Issues and PR related to the AI-video branch. label May 17, 2024
@eliteprox eliteprox changed the title Fix-nil-baseprice Fix runtime error in aiWorker when pricePerUnit is unset May 17, 2024
core/orchestrator.go Outdated Show resolved Hide resolved
This commit ensures that when the `transcodePrice` is not set by the AI
orchestrator no `nil` error is thrown when a Gateway requests the
orchestrators OrchInfo.
rickstaa and others added 2 commits May 20, 2024 17:46
This commit fixes the check that is performed to check if transcodePrice
is set.
Tested transcoding with `-pricePerUnit` and `-pricePerBroadcaster`, verified the correct price comes through. 

Tested AI jobs with and without pricePerUnit, in every case the price from the model is used and no nil errors occur. 

Tested without `-autoAdjustPrice=false` so that it would reach the line it was previously breaking on. Everything looks good.
@rickstaa rickstaa merged commit 03b64fb into livepeer:ai-video May 20, 2024
7 of 9 checks passed
@rickstaa rickstaa mentioned this pull request Jun 10, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Issues and PR related to the AI-video branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants