-
Notifications
You must be signed in to change notification settings - Fork 208
Put envd, ptys, socats, and commands into their own cgroups #1580
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
packages/orchestrator/internal/template/build/core/rootfs/templates.go
Outdated
Show resolved
Hide resolved
2fdcc9e to
3b9a6a2
Compare
other code review comments as well
This configures memory reservations on the envd service, and puts internal processes into cgroups based on their process type. Most importantly, this keeps envd responsive when the system is saturated.
envd.service cgroup:
the envd process. manages and handles communication into the sandbox.
pty cgroup:
any process that defines a pty configuration. assumed to be interactive, so it gets higher priority.
socat cgroup:
forwarded ports. shouldn't require much cpu, but is used for interaction, so it gets higher priority.
user cgroup:
every other command launched by the user. the lowest priority, as it has the highest chance of interrupting envd.
Note
Adds a cgroup v2 manager and assigns envd, PTY, socat, and user processes to dedicated cgroups with CPU/memory settings; integrated into process handling, port forwarding, and orchestrator templates.
cgroupspackage with cgroup v2 manager (Cgroup2Manager), options, noop manager, and tests.main.go: create and configure cgroup manager (flags:--cgroup-root), set per-type CPU/memory (pty,socat,user), pass to process service and port forwarder; bumpVersionto0.4.3.port/forward.go: runsocatinProcessTypeSocatcgroup viaSysProcAttrFD.services/process: plumb cgroup manager;handler.NewsetsSysProcAttr{UseCgroupFD,CgroupFD}and selects proc type (ptyvsuser).envd.service.tplwith cgroup delegation and resource reservations (Delegate=yes,MemoryMin/Low,CPUWeight).github.com/opencontainers/runtime-spectov1.3.0; adjust rootfs test accordingly.Written by Cursor Bugbot for commit 4d795e6. This will update automatically on new commits. Configure here.