diff --git a/src/forge/controller/provisioner.py b/src/forge/controller/provisioner.py index 35ab7e525..7c204b266 100644 --- a/src/forge/controller/provisioner.py +++ b/src/forge/controller/provisioner.py @@ -48,7 +48,13 @@ async def get_remote_info(host_mesh: HostMesh) -> tuple[str, str]: """Returns the host name and port of the host mesh.""" throwaway_procs = host_mesh.spawn_procs(per_host={"procs": 1}) fetcher = throwaway_procs.spawn("_fetcher", _RemoteInfoFetcher) - fetcher = fetcher.slice(procs=0) + + # This will reduce something like extent = {"hosts": 2, "procs": 1} to + # {"hosts": 1, "procs": 1}. + singleton_slice = {k: slice(0, 1) for k in fetcher.extent.keys()} + fetcher = fetcher.slice(**singleton_slice) + # Fetcher should be a singleton at this point - call_one() will fail otherwise + host, port = await fetcher.get_info.call_one() await throwaway_procs.stop() return host, port