allegroai / clearml-agent

ClearML Agent - ML-Ops made easy. ML-Ops scheduler & orchestration solution
https://clear.ml/docs/
Apache License 2.0
242 stars 92 forks source link

Does clearml-agent caches experiments docker-enviroment? #202

Closed konstantinator closed 6 months ago

konstantinator commented 6 months ago

Hello everyone!

I encountered a similar problem issue but with Docker. Every time I launch a task, I have to wait 5-10 minutes for the environment to build. Is there a way to reuse an already created environment from previous tasks?

Here's how I launch the agent:

clearml-agent daemon --queue hello_queue --docker my_hello_image

And here's how I start a task for it:

clearml-task --project Hello --name hello --script ./hello_world.py --packages "pip" --queue hello_queue \
  --docker my_hello_image --docker_args "-v /data:/data \
  --rm --name my_container_hello" 
jkhenning commented 6 months ago

Hi @konstantinator, you can simply achieve that by mounting the /root/.clearml from inside the container to the host machine, so basically adding something like: -v ~/agent/.clearml:/root/.clearml to the docker args

konstantinator commented 6 months ago

Thank you, @jkhenning ! The issue was the lengthy installation of Linux packages on top of my Docker image. I noticed that they were being installed every time the Docker container was launched, so I rebuilt the image with these packages included. Now, the clearml-agent begins executing tasks in less than a minute, which is acceptable for me.

Thank you for your response!