feat(gateway): add resource defaults and grpc rate limiting#1566
Open
alangou wants to merge 2 commits into
Open
feat(gateway): add resource defaults and grpc rate limiting#1566alangou wants to merge 2 commits into
alangou wants to merge 2 commits into
Conversation
Signed-off-by: Adrien Langou <alangou@nvidia.com>
Signed-off-by: Adrien Langou <alangou@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
Label |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds gateway-level defaults for sandbox CPU and memory limits, plus an optional gateway-wide gRPC request rate limit. This gives operators safer default resource controls while keeping PID limits and per-principal rate limiting out of scope for this draft.
Related Issue
Closes OS-76
Changes
Testing
mise run pre-commitpassesAdditional targeted checks run during development:
mise exec -- cargo test -p openshell-core grpc_rate_limit --libmise exec -- cargo test -p openshell-server grpc_rate_limit --libmise exec -- cargo clippy -p openshell-server --all-targets -- -D warningsOpen Questions
PID Limit Semantics
default_sandbox_pids_limitship in a follow-up, or stay out until the driver contract has a typed PID field?template.resources.limits.pids.template.resources.limits.pidsis currently preserved in the public sandbox spec but ignored when building driver requests. Should unsupported drivers reject this explicitly instead of silently ignoring it?resources.limits.pids; confirm whether any Kubernetes-side PID control is possible through the sandbox controller, kubeletpodPidsLimit, or a different mechanism.--pids-limit, but the current compute driver proto only types CPU and memory. Decide whether to add a typed field, use driver-specific config, or leave Docker/Podman PID defaults out of scope.Driver Consistency
platform_config, some ignore passthrough resources, and some apply backend-specific fallbacks.resources_rawas a best-effort contract accepted by every driver, where supported fields are applied and unsupported fields become no-ops with warnings.resources_rawis adopted, decide where warnings should surface so users do not get a false security signal from accepted-but-unenforced limits.gRPC Rate Limit Scope
Checklist