Skip to content

refactor(server): normalize compute driver acquisition path #1949

Description

@elezar

Description

Normalize the gateway compute-driver startup path so driver selection happens before constructing or validating driver-specific configuration. The current path mixes construction responsibilities across CLI parsing, runtime selection, and per-driver constructors.

Context

While reviewing PR #1703, we found that driver config/acquisition is inconsistent across drivers:

  • Docker and VM configs are constructed in crates/openshell-server/src/cli.rs before the selected runtime is known.
  • Kubernetes and Podman configs are constructed lazily inside build_compute_runtime after driver selection.
  • Remote endpoint drivers resolve CLI/env sockets through Config.compute_driver_endpoints, while TOML endpoint sockets are resolved directly from [openshell.drivers.<name>].

This means unrelated invalid Docker or VM config can fail gateway startup even when another driver is selected, and it makes the endpoint-backed driver path harder to reason about.

Definition of Done

  • build_compute_runtime or an adjacent acquisition layer selects the configured driver before building driver-specific config.
  • Docker, Podman, Kubernetes, VM, and remote endpoint drivers follow the same high-level acquisition pattern.
  • Unselected driver tables are not validated during startup.
  • Local TLS/defaulting behavior remains unchanged for selected local drivers.
  • Existing driver-selection and gateway-config tests are updated or expanded to cover the normalized behavior.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions