-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[runtiime env] Use coroutine to create runtime envs in runtime_env_agent
#21950
Comments
I believe this is a issue from history. In the first version, runtime envs are installed in workers(setup_worker.py). So all the methods of runtime env setup are synchronous. It made sense at that time. When we moved the logic from workers to agent, we used |
RuntimeEnv
in RuntimeEnvAgent
RuntimeEnv
in RuntimeEnvAgent
RuntimeEnv
in RuntimeEnvAgent
runtime_env_agent
@SongGuyang @Catch-Bull coroutines sounds good (we're actually using |
This sounds good to me as well. I think you're right about the historical reasons @SongGuyang. Regarding @edoakes's concern, I'm trying to imagine a case where a plugin's setup step wouldn't be able to support |
If any step of plugins/options didn't support |
We use coroutine to implement About implementation, we need to pay attention to compatibility with py3.6, compared to py3.7, py3.6 lacks support for |
Yes. We're going to do this part in two steps:
|
Some asyncio APIs are different between Python 3.6 & 3.7. But, it's OK to write the code to compatible both of them. |
Yes, the first step just change runtime env manager's API to async, e.g. delete_uri, setup, ... The implementation of API use Then, we can refactor all the runtime env implementations to async step by step.
Finally, we can run some logic concurrently. e.g. |
Sounds good to me. |
Search before asking
Description
CreateRuntimeEnv
request will trigger different thread for runtime env setup.runtime_env
is synchronous. (such as downloading packages, pip install, conda env prepare...)DownloadManager
which can limit download peak ) to manage the whole runtime_env's creation to achieve some optimization purposes. Using coroutines can avoid using mutex lock and make it easier to implementdef xxx
toasync def xxx
asyncio.Task
to trigger runtime_env setup. The existing method isrun_setup_with_logger
....
Use case
No response
Related issues
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: