Repository navigation
feat(kubernetes): support emptyDir sandbox workspaces - #4542
lunarwhite wants to merge 1 commit into
Conversation
Signed-off-by: Yuedong Wu <dwcn22@outlook.com>
|
Hi @drew, may I request your review on this PR when you have the time? as you triaged/accepted the issue that it addresses. |
|
I think we'd to support emptyDir workspaces in combination with PVCs. |
|
There is a catch in that if you stop the sandbox, then restart, your sandbox workspace is not persistent. This is a violation of the existing start/stop contract. |
|
I second @mrunalp 's #4542 (comment). We would like to support both scenarios in combination and also allow per sandbox override + sizing similarly to how #4473 proposes the implementation. |
|
I had already opened #4473 a couple days ago. I also added a few more things like:
|
|
TLDR; I think it's important that the user or the operator can "on the fly" change the type of persistency he needs for a sandbox and not just rely on the gateway default. The changes in my PR are a reflection of that |
|
Thanks for all your inputs. Given @kon-angelo is the issue reporter with specific uses cases in their mind, let's move the design discuss to #4473 and iterate then. I'll close mine to avoid dup efforts and review. |
Summary
Kubernetes gateways can set
workspace_volume = "empty_dir"to back/sandboxwith anemptyDircapped atworkspace_default_storage_sizeinstead of a per-sandbox PVC, so sandboxes run on clusters without dynamic provisioning or a defaultStorageClass./sandboxthen lasts as long as the workload Pod. The default stays a PVC.Related Issue
Closes #2787
Changes
workspace_volumesetting,persistent_volume_claim(the default) orempty_dir.empty_dirdrops the workspace claim template and adds aworkspaceemptyDirwhosesizeLimitisworkspace_default_storage_size. The/sandboxmount and theseed-workspaceinit container are unchanged. The standalone driver takes--workspace-volume/OPENSHELL_K8S_WORKSPACE_VOLUME. Helm needs no chart change: setgatewayConfig.openshell.drivers.kubernetes.workspace_volume.empty_dirrender, and a check that the default render adds no Pod-levelworkspacevolume.configuration.mdx,runtimes.mdx,kubernetes/setup.mdx, the driver README, and thedebug-openshell-clusterskill.Testing
cargo fmt --check,cargo clippy -p openshell-driver-kubernetes --all-targets -- -D warnings,cargo test -p openshell-driver-kubernetes,mise run markdown:lint,mise run docsempty_dirgateway fails the conformancesandbox-lifecyclescenario by design.Manual e2e testing: no default StorageClass, before and after
Setup: kind v0.32.0, Kubernetes v1.35.5, Agent Sandbox v1.0.3
The images and CLI were built from this branch, the final commit changes only unit tests and doc wording.
localhost/seeded-sandbox:2787isnvcr.io/nvidia/base/ubuntu:24.04plus/sandbox/from-image.txt.Before (default PVC mode)
After the gateway's own claim binds, the default
StorageClassis removed, and a new sandbox's workspace claim staysPending.After (`empty_dir` on the same gateway)
The sandbox is
Readywith no workspace claim,/sandboxholds the image's content, and stop/start re-seeds it.The first
empty_dircreate after the gateway restart never became ready and was rolled back after five minutes, like the stalls above. The retry shown here succeeded.Checklist