feat(driver-mxc): default MXC admission settings to what the driver can enforce
还没有人认领这个 Issue。
评估
调研方向
Start with MxcComputeConfig::default() in crates/openshell-driver-mxc/src/driver.rs and admission_config_from_context in crates/openshell-server/src/compute/driver_config.rs. Run the existing MXC default-rejection and lifecycle tests, then check the gateway-config.mdx and sandbox-compute-drivers.mdx documentation. Done means omitted MXC settings allow creation, explicit admission remains rejecting, tests pass, and both docs explain the exception.
由索引模型根据 Issue 内容生成。
描述
User Story
As an operator running the MXC compute driver on Windows, I want a fresh install or upgrade to start creating sandboxes without hand-editing admission settings, so that MXC keeps working out of the box after #3538 lands.
Problem Statement
#3538 makes external-resource admission on by default for every compute driver and disables caller-supplied template.driver_config by default. Both defaults are correct for the Linux and Kubernetes drivers, but they make the MXC driver reject every sandbox create under a default configuration:
- MXC requires
template.driver_config.mxcwith a non-emptycommand, soallow_driver_config = falserejects every request. - Every MXC workload grants access to existing host filesystem objects, and MXC has no trusted label resolver, so
resource_admission.enabled = truealso rejects every request viareject_unlabelable.
An MXC gateway only works once the operator adds this to gateway.toml:
[openshell.drivers.mxc]
allow_driver_config = true
[openshell.drivers.mxc.resource_admission]
enabled = false
The docs (crates/openshell-driver-mxc/README.md, docs/reference/sandbox-compute-drivers.mdx) say this in prose, but the MXC example in docs/reference/gateway-config.mdx does not include it, and the failure surfaces as a per-create FailedPrecondition rather than at gateway startup.
Impact / Why This Matters
Anyone upgrading an MXC gateway across #3538 will see every sandbox create fail until they find the two settings. The workaround is a two-line config change, but it is undiscoverable from the error and undocumented in the main config example. MXC is not in scope for 0.1.0, so this is a fast-follow rather than a blocker.
Proposed Design
Make the MXC driver's default admission posture match what MXC can actually enforce, while still honoring explicit operator settings:
- With no
allow_driver_configorresource_admissionkeys under[openshell.drivers.mxc], the gateway starts with caller driver config allowed and label admission disabled for MXC, and logs the existing "admission is DISABLED" warning at startup. - An operator who explicitly sets
resource_admission.enabled = truefor MXC still gets today's behavior (every create is rejected with a clear message), so the exception is opt-out only by omission, never by overriding an explicit setting. - Docs state that MXC is the one driver whose defaults differ, and why.
Implementation sketch (two touch points, because the gateway independently derives the expected policy and compares it against the driver's acknowledgement):
crates/openshell-driver-mxc/src/driver.rs:MxcComputeConfig::default()setsallow_driver_config: trueand aResourceAdmissionConfigwithenabled: false.crates/openshell-server/src/compute/driver_config.rs:admission_config_from_contextapplies the same defaults for themxcdriver when the fields are absent, before thetry_into::<DriverAdmissionConfig>().
A cleaner but larger alternative is to let each driver registration declare its default admission policy, so the server does not hard-code a driver name.
Acceptance Criteria
- A gateway with
[openshell.drivers.mxc]and no admission keys starts, acknowledges a disabled policy, and creates sandboxes withtemplate.driver_config.mxc.command. - A gateway with
[openshell.drivers.mxc.resource_admission] enabled = truestill rejects sandbox creates with the existingreject_unlabelableerror. - The existing MXC default-rejection test becomes an explicit-enable test; MXC lifecycle tests no longer need a custom admission config.
-
docs/reference/gateway-config.mdxanddocs/reference/sandbox-compute-drivers.mdxdescribe the MXC default exception.
Alternatives Considered
- Docs only. Add the two TOML lines to the MXC example in
gateway-config.mdx. Cheapest, and worth doing regardless, but upgrades still break silently until the operator reads the docs. - Startup preflight. Fail gateway startup when MXC is selected with admission enabled, with a message naming the two settings. Better error, but still requires manual config for every MXC install.
- Driver-declared defaults. Add a default admission policy to the compute driver registration so the server never hard-codes
mxc. Preferred long-term shape; the sketch above is the minimal version and can be refactored into this later.
- 主要语言
- Rust
- 星标
- 8.7k
- 派生
- 1.3k
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 301
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA/OpenShell 的其他 Issue
-
area:docs
难度 1/5 1 小时以内 新手友好度 88/100
-
state:triage-needed
难度 2/5 1-3 小时 新手友好度 82/100
-
area:cli state:validated
难度 2/5 1-3 小时 新手友好度 72/100
-
state:triage-needed
难度 1/5 1 小时以内 新手友好度 90/100
-
area:build spike state:review-ready state:stale
难度 2/5 半天 新手友好度 68/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
bug core
难度 2/5 1-3 小时 新手友好度 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW 未关闭fuzz
难度 2/5 1-3 小时 新手友好度 82/100
ClickHouse/ClickHouse#122114 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
linebender/vello_svg#90 ·
-
难度 2/5 1-3 小时 新手友好度 74/100