Skip to main content

cluster_compose_overlay_arg

Function cluster_compose_overlay_arg 

Source
pub fn cluster_compose_overlay_arg(project_root: &Path) -> String
Expand description

Write a temporary docker-compose overlay (under project_root) that populates extra_hosts: for the cluster-capable services (cuda, dev, bench) from the controller-resolved cluster hosts in ENV_CLUSTER_EXTRA_HOSTS, then return the -f flag sequence to splice in front of docker compose run.

docker compose run itself does not accept --add-host (that’s docker run only), but compose merges multiple -f files, so the overlay extends the base config without mutating it.

Returns the empty string (and writes nothing) when not in cluster mode — non-cluster runs keep their existing docker compose run invocation unchanged.