fix(create-a-container): raise default container maxmem to 8GB - #439
Open
runleveldev wants to merge 1 commit into
Open
fix(create-a-container): raise default container maxmem to 8GB#439runleveldev wants to merge 1 commit into
runleveldev wants to merge 1 commit into
Conversation
Interactive dev boxes (code-server + extension host + a Vite dev server) realistically need ~6GB. The 4GB default was too tight and was the root cause of memory-exhaustion thrash: a container could hold ~3.6GB of unswappable anon memory against its 4GB cgroup limit while the node had ample headroom. Bump the canonical default (RESOURCE_DEFAULTS.memory) to 8192 and source the creation-time fallbacks in create-container.js from RESOURCE_DEFAULTS so the default lives in one place. Mirror the value in the dummy node seed and the client-side display defaults. Per-user/template overrides still take precedence; swap stays 0. Closes #432
Contributor
There was a problem hiding this comment.
🟢 Ready to approve
The changes are consistent across server creation defaults, effective-resource defaults, dummy API, and UI fallbacks, and they preserve the existing override precedence model.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Raises the canonical default container memory limit in create-a-container from 4GB to 8GB and wires container-creation fallbacks to use the model’s RESOURCE_DEFAULTS, keeping the creation-time defaults and the resource-request “effective” defaults consistent.
Changes:
- Increased
RESOURCE_DEFAULTS.memoryto8192MB (auto-approval threshold +/api/v1/resource-requests/effectivebaseline). - Updated
create-container.jsto source creation-time fallback values fromResourceRequest.RESOURCE_DEFAULTSinstead of hardcoded literals. - Updated dummy API seed values and client-side “default display/fallback” constants to reflect the new 8GB default.
File summaries
| File | Description |
|---|---|
| create-a-container/models/resourcerequest.js | Bumps canonical default memory to 8192MB (drives effective resources + auto-approval baseline). |
| create-a-container/bin/create-container.js | Uses ResourceRequest.RESOURCE_DEFAULTS for fallback resources during container creation. |
| create-a-container/utils/dummy-api.js | Updates dummy node/container config seed to 8192MB for consistency in dev/test-like flows. |
| create-a-container/client/src/components/containers/ResourcesSection.tsx | Updates UI fallback defaults to 8192MB. |
| create-a-container/client/src/pages/resource-requests/ResourceRequestsPage.tsx | Updates displayed defaults to 8192MB. |
| create-a-container/client/src/pages/resource-requests/MyRequestsPage.tsx | Updates displayed defaults to 8192MB. |
Review details
- Files reviewed: 5/6 changed files
- Comments generated: 0
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
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.
Closes #432. Part of #431 (memory-exhaustion thrash).
Problem
Interactive dev boxes (code-server + extension host + a Vite dev server) realistically need ~6GB. The default of 4GB was too tight and was the root cause in #431: a container held ~3.6GB of unswappable anon memory in a 4GB container, thrashing against its cgroup limit while nodes had ample headroom.
Changes
Server (behavioral):
models/resourcerequest.js—RESOURCE_DEFAULTS.memory: 4096 → 8192. This is the canonical default; it feeds the/api/v1/resource-requests/effectiveendpoint and the auto-approval threshold (requests ≤ default are auto-approved).bin/create-container.js— sourced the creation-time fallbacks (cores/memory/swap/rootfs) fromRESOURCE_DEFAULTSinstead of hardcoded literals, so the default lives in one place.memoryflows intocreateLxc(Docker-image path) andupdateLxcConfigaftercloneLxc(template path).Consistency mirrors:
utils/dummy-api.js— dummy node seedmemory: 8192client/src/components/containers/ResourcesSection.tsx— UI fallbackDEFAULTS.memory: 8192client/src/pages/resource-requests/{ResourceRequestsPage,MyRequestsPage}.tsx— display defaults8192Acceptance criteria
approvedResourcestakes precedence over defaults)proxmox-api.jshas no defaults; untouched)Notes
swapstill defaults to0— intentionally out of scope.node --check.node_modulesis not installed in this environment, so jest/vite were not run here; the client edits are single-literal swaps that don't affect types.