Skip to content

Conversation

@SebiWrn
Copy link
Collaborator

@SebiWrn SebiWrn commented Oct 15, 2025

Motivation and Context

This PR adds the selfstreaming to the runners

Important

Please first merge #1656, as these PRs build on top of each other

@SebiWrn SebiWrn requested a review from a team October 15, 2025 18:17
@SebiWrn SebiWrn self-assigned this Oct 15, 2025
@SebiWrn
Copy link
Collaborator Author

SebiWrn commented Oct 15, 2025

Fixes #1654

@SebiWrn SebiWrn force-pushed the runner/add-selfstream branch from 8e9e776 to dc7caa9 Compare October 16, 2025 13:46
@SebiWrn SebiWrn linked an issue Oct 16, 2025 that may be closed by this pull request
@SebiWrn SebiWrn force-pushed the runner/add-selfstream branch from dc7caa9 to 515502a Compare October 16, 2025 20:38
Copy link
Member

@joschahenningsen joschahenningsen left a comment

Choose a reason for hiding this comment

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

Sorry for being so verbose reviewing some of the old worker code, I think it's worthwile to re-think how it was done back then now and get rid of some of that tech depth :)

Overall, I really love the approach of having gocast be the initiator of self-streams as though they were normal lecture-hall streams!

Copy link
Member

@joschahenningsen joschahenningsen left a comment

Choose a reason for hiding this comment

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

One concern with this, otherwise looks great! 💯

return nil, err
}

resp, err := m.requestStreamVersion(ctx, stream, client, model.LectureHall{}, protobuf.StreamVersion_STREAM_VERSION_COMBINED)
Copy link
Member

Choose a reason for hiding this comment

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

We need to make sure, this is requested at the same runner, that this request originates from, otherwise it will break as soon as we have more than one runner

Copy link
Collaborator Author

@SebiWrn SebiWrn Oct 19, 2025

Choose a reason for hiding this comment

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

You're right, I forgot to implement this. An alternative would be to have only one mediaMTX instance at a time and then distribute the load of selfstreams evenly to the runners as every runner could fetch the stream from this instance and we wouldn't rely on only one machine for a stream (except for the mediaMTX). What do you think about this?

Copy link
Member

Choose a reason for hiding this comment

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

I'd like all runners to be treated the same, let's design this to work without magic knowledge of what which runner does

Copy link
Member

Choose a reason for hiding this comment

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

If we need load balancing to multiple ingest servers, let's use traefik and DNS rr to distribute streams to multiple runners

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This means we only have one mediamtx for all instead of having one for each runner?

@SebiWrn SebiWrn marked this pull request as draft October 19, 2025 20:01
@SebiWrn
Copy link
Collaborator Author

SebiWrn commented Oct 19, 2025

Whole functionality of requesting a selfstream now moved to main instance (gocast), so that every runner can handle the selfstreaming requests.
Ingest is now own package that could be deployed separately

@SebiWrn SebiWrn marked this pull request as ready for review October 19, 2025 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Runner]: Self streams

3 participants