Skip to content

Disable ingress session flag update#935

Merged
biglittlebigben merged 14 commits intolivekit:mainfrom
tryiris-ai:disableIngressSessionFlagUpdate
Jan 7, 2025
Merged

Disable ingress session flag update#935
biglittlebigben merged 14 commits intolivekit:mainfrom
tryiris-ai:disableIngressSessionFlagUpdate

Conversation

@Rajiv91
Copy link
Copy Markdown
Contributor

@Rajiv91 Rajiv91 commented Dec 30, 2024

New Enabled flags on createIngress and updateIngress to have the ability to disable ingress sessions without having to remove the entire session and lose the streamkey

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 30, 2024

⚠️ No Changeset found

Latest commit: 1933f25

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 30, 2024

CLA assistant check
All committers have signed the CLA.

Comment thread protobufs/livekit_ingress.proto Outdated
string participant_metadata = 14;
bool reusable = 11;
IngressState state = 12; // Description of error/stream non compliance and debug info for publisher otherwise (received bitrate, resolution, bandwidth)
optional bool session_enabled = 16;
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.

I would simply use enabled here, rather than session_enabled as we currently do not use a session semantic in this API. Please also add a comment specifying that when false, new connection attempts to this ingress will fail, and that the default value is true.

Comment thread protobufs/livekit_ingress.proto Outdated
IngressVideoOptions video = 7;

// NEXT_ID: 11
optional bool session_enabled = 11;
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.

Please update this similarly to above.

@biglittlebigben
Copy link
Copy Markdown
Contributor

The validation code in ingress/validation.go:ValidateForSerialization also needs to fail if the flag is set to false on a non reusable ingress.

Comment thread ingress/errors.go Outdated
ErrNoResponse = psrpc.NewErrorf(psrpc.Unavailable, "no response from ingress service")
ErrInvalidOutputDimensions = NewInvalidVideoParamsError("invalid output media dimensions")
ErrInvalidIngressType = psrpc.NewErrorf(psrpc.InvalidArgument, "invalid ingress type")
ErrSessionDisabled = psrpc.NewErrorf(psrpc.PermissionDenied, "session is disabled")
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.

Please also rename the error to ErrIngressDisabled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it, thanks for the feedback. I'll be working on it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hey @biglittlebigben I updated the branch with the feedback you requested:

  • ErrIngressDisabled for the new error variable
  • ValidateForSerialization in ingress/validation.go checking the enabled flag.
  • session_enabled now is just enabled.
  • CreateIngressRequest message includes the flag too.

And i updated the bootstrap script with the versions i see they are being used in main for those protoc dependencies.
And I have a question about the compiled proto that is causing conflicts here: replay/cloud_replay.pb.go. The conflict is because is the only file compiled with different versions of protoc and protoc-gen-go:
// protoc-gen-go v1.31.0
// protoc v4.24.3
Was this on purpose?
Do you want me to compile that single file with those old versions and push it or will the same versions be used now as in the rest of the project?
Let me know if something is missing, thanks in advance.

Copy link
Copy Markdown
Contributor

@biglittlebigben biglittlebigben left a comment

Choose a reason for hiding this comment

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

Please see further comments. With regard to the conflict, the files generated by the Github action are the ones that should end up merged in the repository, and any conflict should be resolved accordingly.

Comment thread bootstrap.sh Outdated
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3
go install github.com/livekit/psrpc/protoc-gen-psrpc@v0.5.1
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.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.

Please remove this change from this PR and create a separate PR for this version change if you believe this is needed, since this is unrelated to the initial PR purpose. Keeping unrelated changes to separate PRs help debugging and backing out a broken patch when needed.

Comment thread ingress/validation.go Outdated
return ErrInvalidIngress("no source URL")
}
if info.Enabled != nil && !*info.Enabled {
return ErrIngressDisabled
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.

Please return ErrInvalidIngress("disabled non reusable ingress"), or a similar message. The issue here is that the ingress has an inconsistent set of parameters, not that is it merely disabled.

Comment thread protobufs/livekit_ingress.proto Outdated
string participant_metadata = 14;
bool reusable = 11;
IngressState state = 12; // Description of error/stream non compliance and debug info for publisher otherwise (received bitrate, resolution, bandwidth)
optional bool enabled = 16; // The default value is true and when set to false, the new connection attempts will be rejected
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.

Also, just realizing while looking at the livekit SFU patch: this should not be optional as it is an output, so the returned value should always be explicit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it, makes sense
Thanks

…ingress fixed, ingressInfo enabled not longer an optional
@Rajiv91
Copy link
Copy Markdown
Contributor Author

Rajiv91 commented Jan 6, 2025

Hey @biglittlebigben I just updated the pr with your feedback.
Thanks

Copy link
Copy Markdown
Contributor

@biglittlebigben biglittlebigben left a comment

Choose a reason for hiding this comment

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

This looks good to me. Please approve the CLA and fix the conflict and I'll merge.

@Rajiv91
Copy link
Copy Markdown
Contributor Author

Rajiv91 commented Jan 7, 2025

This looks good to me. Please approve the CLA and fix the conflict and I'll merge.

Thanks.
I already fixed the conflicts and aproved the CLA. And a reminder that this pr is linked with these other 2:
livekit/livekit#3293
livekit/ingress#319

@biglittlebigben biglittlebigben merged commit e58b0bf into livekit:main Jan 7, 2025
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.

3 participants