Skip to content
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

Docker based code execution slow - reuse container / be able to specify requirements.txt up front #741

Open
bbence84 opened this issue Nov 22, 2023 · 4 comments · May be fixed by #2444
Open
Labels
code-execution execute generated code docker Issues relating to Docker

Comments

@bbence84
Copy link

I am relying heavily on the docker based code execution, which works pretty well, however it seems to be pretty slow, likely because of the fact that each time it instantiates a new container. This is very slow. Additionally it would be nice if there would be a way to influence the docker container be initialized with packages we already know would be likely used. This would also speed up code execution.
Thanks!

@rickyloynd-microsoft rickyloynd-microsoft added code-execution execute generated code docker Issues relating to Docker labels Nov 22, 2023
@larryhopecode
Copy link

It looks like docker file implementation could be optimized a bit.

@afourney
Copy link
Member

Yes, a new container (not image) is spun up for every message that has code, and it is much slower than native code execution. A more viable option is to create one Docker container, and run everything in it (in which case, it acts as if running natively, yet is still sandboxed). This is what many of us do anyways, but it would be good if somehow it could be achieved via configuration.

@sidhujag
Copy link
Collaborator

sidhujag commented Nov 25, 2023

I second this, metagpt and others will work in a group sharing file workspace to create a project with tests and usually have a requirements.txt to install so tester can install code and run it with tests.. its probably useful to have a way to install.. I have been using subprocess but i think requirements is a better way.

@sonichi
Copy link
Collaborator

sonichi commented Dec 3, 2023

One can specify the docker image name with use_docker in code_execution_config. Is that already considered?

@akoumany akoumany linked a pull request Apr 19, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-execution execute generated code docker Issues relating to Docker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants