Skip to main content

Module compose_import

Module compose_import 

Source
Expand description

One-way, lossy compose YAML → WorkloadSpec import shim.

Best-effort translation of a docker-compose v3 file into a set of WorkloadSpec values, one per compose service. The output may need hand-editing — compose’s expressiveness exceeds ours by design and we lose the parts we don’t want. This shim is for one-time migration, not round-trip authoring.

Lossy areas (each emits an ImportWarning keyed by compose path):

  • network_mode: host → rejected as ImportError::HostNetwork.
  • build: blocks → ignored with warning (“build externally; provide an image: reference”).
  • Custom networks → flattened to the mesh; warns when topology can’t be preserved.
  • Bind volumes → echoed as warning that yubaba requires tier = "infra" (the importer auto-promotes the spec’s tier when bind mounts are present so the result still passes shape validation).
  • Healthcheck blocks → noted as warning; not translated in V1 (compose’s syntax is rich enough to deserve its own pass).

See .yah/docs/architecture/A054-yah-workload-spec.md §“Compose-import shim” for the design contract.

Structs§

ImportResult
Output of import_compose.
ImportWarning
A non-fatal lossy translation noted during import.

Enums§

ImportError
A hard rejection during import.

Functions§

import_compose
Parse a compose v3 YAML string into a set of WorkloadSpec values.