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

feat: enable external ai-runner when all pipelines are configured as external containers #3335

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions cmd/livepeer/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,29 @@
}

var aiCaps []core.Capability
var aiConfig []core.AIModelConfig
var externalAIRunner bool

capabilityConstraints := make(core.PerCapabilityConstraints)
if *cfg.AIModels != "" {
aiConfig, err = core.ParseAIModelConfigs(*cfg.AIModels)
if err != nil {
glog.Errorf("Error parsing -aiModels: %v", err)
return
}

// Check if each entry has a valid URL
for _, config := range aiConfig {
if config.URL != "" {
_, err := url.ParseRequestURI(config.URL)
if err != nil {
glog.Errorf("Error parsing URL for model %v: %v", config.ModelID, err)
return
}
externalAIRunner = true
}
}
}

if *cfg.AIWorker {
gpus := []string{}
Expand Down Expand Up @@ -1211,7 +1233,7 @@
return
}

n.AIWorker, err = worker.NewWorker(*cfg.AIRunnerImage, gpus, modelsDir)
n.AIWorker, err = worker.NewWorker(*cfg.AIRunnerImage, gpus, modelsDir, externalAIRunner)

Check failure on line 1236 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for linux-cpu-amd64

too many arguments in call to worker.NewWorker

Check failure on line 1236 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for darwin-amd64

too many arguments in call to worker.NewWorker

Check failure on line 1236 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Run tests defined for the project

too many arguments in call to worker.NewWorker

Check failure on line 1236 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for linux-cpu-arm64

too many arguments in call to worker.NewWorker

Check failure on line 1236 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for darwin-arm64

too many arguments in call to worker.NewWorker

Check failure on line 1236 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for linux-gpu-amd64

too many arguments in call to worker.NewWorker

Check failure on line 1236 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for linux-gpu-arm64

too many arguments in call to worker.NewWorker

Check failure on line 1236 in cmd/livepeer/starter/starter.go

View workflow job for this annotation

GitHub Actions / Build binaries for windows-cpu-amd64

too many arguments in call to worker.NewWorker
if err != nil {
glog.Errorf("Error starting AI worker: %v", err)
return
Expand All @@ -1230,13 +1252,7 @@
}

if *cfg.AIModels != "" {
configs, err := core.ParseAIModelConfigs(*cfg.AIModels)
if err != nil {
glog.Errorf("Error parsing -aiModels: %v", err)
return
}

for _, config := range configs {
for _, config := range aiConfig {
pipelineCap, err := core.PipelineToCapability(config.Pipeline)
if err != nil {
panic(fmt.Errorf("Pipeline is not valid capability: %v\n", config.Pipeline))
Expand Down
Loading