fix(microsandbox): mount workspace source and make it usable by the remote user#778
Conversation
✅ Deploy Preview for images-devsy-sh canceled.
|
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for devsydev canceled.
|
f8bfa2a to
bcac1e9
Compare
…e user The microsandbox driver never shared the workspace source into the microVM, so the devcontainer workspaceFolder (/workspaces/<name>) did not exist and VS Code failed to connect with "Workspace does not exist". Even once mounted, the virtiofs share is root-owned in the guest with no UID mapping, so a non-root remote user could not enter or edit it. - Translate the workspace bind mount (options.WorkspaceMount) and MountTypeBind mounts into `msb --mount-dir SOURCE:DEST[:ro]`. - Add a WorkspaceChowner capability so the agent recursively chowns the workspace to the remote user (as it already does for podman machine). - Stop ChownR from aborting the whole walk on a single un-chownable entry (e.g. read-only .git pack files on the share), leaving the rest unowned. - Default MICROSANDBOX_MEMORY to 2048 MiB so the VS Code extension host no longer OOMs on first connect.
bcac1e9 to
5dc8b6d
Compare
Summary
Fixes the microsandbox microVM backend so a devcontainer workspace actually works. Previously VS Code failed to connect: the workspace source was never shared into the microVM, so
/workspaces/<name>did not exist ("Workspace does not exist"), and even once mounted the virtiofs share was root-owned and unusable by a non-root remote user.Three root causes addressed, plus an OOM default:
options.WorkspaceMountand dropped bind mounts entirely. Now the workspace bind mount and anyMountTypeBindmounts are translated tomsb --mount-dir SOURCE:DEST[:ro](virtiofs).root:rootwith no UID mapping, and microsandbox does no UID remap. Added adriver.WorkspaceChownercapability; microsandbox reports it, so the agent recursively chowns the workspace to the remote user — the same treatmentpodman machinealready gets for the identical problem.ChownRaborted early. The recursive chown bailed on the first un-chownable entry (read-only.gitpack files on the share), leaving everything after it root-owned. It now skips failed entries, finishes the walk, and returns aggregated errors.MICROSANDBOX_MEMORYnow defaults to 2048 MiB, so the VS Code extension host no longer gets OOM-killed on first connect (the VM previously booted at the runtime's ~512 MiB default). User-set values still win.Validation
Verified end-to-end on a clean microsandbox workspace (cross-compiled Linux agent injected via
DEVSY_AGENT_BINARY):msb inspectshows the/workspaces/<name>bind mount.chown workspace recursively: user=vscode.msb execasvscode:cdinto the folder works, all files (incl.app.py,.gitignore,.github/*) arevscode-owned and editable,git statusclean.gofmt,go vet, and all tests in the touched packages (267) pass.Notes
ChownR,chownWorkspacegating) ship in the Linux agent binary and take effect once a release is built from this code.