Skip to content

ai/worker: Absorb ai-worker library#3345

Merged
victorges merged 18 commits intomasterfrom
vg/chore/ai-worker-to-go-livepeer
Jan 31, 2025
Merged

ai/worker: Absorb ai-worker library#3345
victorges merged 18 commits intomasterfrom
vg/chore/ai-worker-to-go-livepeer

Conversation

@victorges
Copy link
Copy Markdown
Contributor

@victorges victorges commented Jan 9, 2025

What does this pull request do? Explain your changes. (required)
This is to move the Go logic from livepeer/ai-worker repository into a separate package
in this repository (the only consumer).

This will allow livepeer/ai-worker to be renamed to ai-runner and avoid any
maintenance confusion, keeping only the specific AI runner container logic on it.

Specific updates (required)

  • Create package which current version of ai-worker worker package (needs update after some PRs get merged there)
  • Replace references and remove go.mod dependency
  • Copy Makefile command to generate runner.gen.go API bindings
  • Create short package doc.go based on the relevant README bits from livepeer/ai-worker

How did you test each of these updates (required)
If it builds it works. No code changes.

Does this pull request close any open issues?
No.

Checklist:

@github-actions github-actions bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code AI Issues and PR related to the AI-video branch. labels Jan 9, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 25.93123% with 1034 lines in your changes missing coverage. Please review.

Project coverage is 32.26037%. Comparing base (e9d55d0) to head (dfc687f).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
ai/worker/worker.go 0.00000% 601 Missing ⚠️
ai/worker/multipart.go 0.00000% 282 Missing ⚠️
ai/worker/docker.go 74.58432% 83 Missing and 24 partials ⚠️
ai/worker/container.go 43.85965% 27 Missing and 5 partials ⚠️
ai/worker/b64.go 65.71429% 10 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3345         +/-   ##
===================================================
- Coverage   33.63244%   32.26037%   -1.37207%     
===================================================
  Files            141         147          +6     
  Lines          37556       40573       +3017     
===================================================
+ Hits           12631       13089        +458     
- Misses         24202       26713       +2511     
- Partials         723         771         +48     
Files with missing lines Coverage Δ
ai/file_worker.go 0.00000% <ø> (ø)
ai/worker/runner.gen.go 5.98396% <ø> (ø)
cmd/livepeer/starter/starter.go 7.45342% <ø> (ø)
core/ai.go 58.51852% <ø> (ø)
core/ai_orchestrator.go 30.94660% <ø> (ø)
server/ai_http.go 10.03135% <ø> (ø)
server/ai_mediaserver.go 7.40103% <ø> (ø)
server/ai_process.go 0.59880% <ø> (ø)
server/ai_worker.go 49.89059% <ø> (ø)
server/rpc.go 66.66667% <ø> (ø)
... and 5 more

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 e9d55d0...dfc687f. Read the comment docs.

Files with missing lines Coverage Δ
ai/file_worker.go 0.00000% <ø> (ø)
ai/worker/runner.gen.go 5.98396% <ø> (ø)
cmd/livepeer/starter/starter.go 7.45342% <ø> (ø)
core/ai.go 58.51852% <ø> (ø)
core/ai_orchestrator.go 30.94660% <ø> (ø)
server/ai_http.go 10.03135% <ø> (ø)
server/ai_mediaserver.go 7.40103% <ø> (ø)
server/ai_process.go 0.59880% <ø> (ø)
server/ai_worker.go 49.89059% <ø> (ø)
server/rpc.go 66.66667% <ø> (ø)
... and 5 more

@victorges victorges force-pushed the vg/chore/ai-worker-to-go-livepeer branch from 17174ee to a2f4e63 Compare January 10, 2025 23:39
@victorges victorges requested a review from rickstaa January 10, 2025 23:43
@victorges victorges marked this pull request as ready for review January 10, 2025 23:47
@victorges victorges force-pushed the vg/chore/ai-worker-to-go-livepeer branch from 01eda1a to 732240c Compare January 17, 2025 19:26
@victorges victorges force-pushed the vg/chore/ai-worker-to-go-livepeer branch 4 times, most recently from e6c24e0 to 95830ae Compare January 29, 2025 00:39
@victorges victorges force-pushed the vg/chore/ai-worker-to-go-livepeer branch from 95830ae to 695e81b Compare January 29, 2025 00:54
@victorges victorges merged commit baedf97 into master Jan 31, 2025
@victorges victorges deleted the vg/chore/ai-worker-to-go-livepeer branch January 31, 2025 13:22
# Git reference to download the OpenAPI spec from, defaults to `main` branch.
# It can also be a simple git commit hash. e.g. `make ai_worker_codegen REF=c19289d`
REF ?= refs/heads/main
ai_worker_codegen:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@victorges I assume this command is excluded from all to prevent unexpected breakage? If so, perhaps we should document it in the developer docs?

PortBindings: nat.PortMap{
containerPort: []nat.PortBinding{
{
HostIP: "0.0.0.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could that be 127.0.0.1 to avoid exposing the ports out of the machine?

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. dependencies Pull requests that update a dependency file go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants