We are creating a custom kernel provisioner and we have an API for finding a host based on certain parameters but this API takes upto 20s to send the host. This 20s wait blocks the server and makes lab unusable during those 20s. We tried making the _determine_next_host function async ourselves by running the host fetching API in a asyncio's run_in_executor and awaiting the _determine_next_host call in the launch_kernel function.
A simple reproducer for this is adding a asyncio.sleep(10) in the DistributedProvisioner._determine_next_host function. The result will be that the kernel never reaches an alive state.
Proposed Solution
We would like a way to asynchronously determine the next host.
Problem
We are creating a custom kernel provisioner and we have an API for finding a host based on certain parameters but this API takes upto 20s to send the host. This 20s wait blocks the server and makes lab unusable during those 20s. We tried making the
_determine_next_host
function async ourselves by running the host fetching API in aasyncio
'srun_in_executor
and awaiting the_determine_next_host
call in thelaunch_kernel
function.A simple reproducer for this is adding a
asyncio.sleep(10)
in theDistributedProvisioner._determine_next_host
function. The result will be that the kernel never reaches an alive state.Proposed Solution
We would like a way to asynchronously determine the next host.
Additional context
I'm using
gateway_provisioners
v0.2.0