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

server: Add orch info on AI events #3321

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#### General

#### Broadcaster
- [#3321](https://github.com/livepeer/go-livepeer/pull/3321) Add orchestrator info on live AI monitoring events

#### Orchestrator

Expand Down
8 changes: 7 additions & 1 deletion server/ai_live_video.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func startControlPublish(control *url.URL, params aiRequestParams) {
}()
}

func startEventsSubscribe(ctx context.Context, url *url.URL, params aiRequestParams) {
func startEventsSubscribe(ctx context.Context, url *url.URL, params aiRequestParams, sess *AISession) {
subscriber := trickle.NewTrickleSubscriber(url.String())
stream := params.liveParams.stream
streamId := params.liveParams.streamID
Expand Down Expand Up @@ -233,6 +233,12 @@ func startEventsSubscribe(ctx context.Context, url *url.URL, params aiRequestPar
event["stream_id"] = streamId
event["request_id"] = params.liveParams.requestID
event["pipeline_id"] = params.liveParams.pipelineID
if sess != nil {
event["orchestrator_info"] = map[string]interface{}{
"address": sess.Address(),
"url": sess.Transcoder(),
}
}

clog.Infof(ctx, "Received event for stream=%s event=%+v", stream, event)

Expand Down
2 changes: 1 addition & 1 deletion server/ai_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ func submitLiveVideoToVideo(ctx context.Context, params aiRequestParams, sess *A
startControlPublish(control, params)
startTricklePublish(ctx, pub, params, sess)
startTrickleSubscribe(ctx, sub, params)
startEventsSubscribe(ctx, events, params)
startEventsSubscribe(ctx, events, params, sess)
return resp, nil
}

Expand Down
Loading