Related to my above thread, I think there is some more customization that needs to be supported to use docker mode properly for different use-cases.
It seems in https://github.com/allegroai/clearml-agent/blob/b196ab57931f3c67efcb561df0c8a2fe7c0e76f9/clearml_agent/commands/worker.py#L2965 it is assumed that the docker container will be logged in as root in runtime.
I’m thinking of either adding docker_home_dir
as a configurable and basing mounted_pip_dl_dir
, mounted_vcs_cache
, mounted_venv_dir
on it or letting them be individually configurable (or both).
One related issue is it seems the mounted cache dir location is hardcode mounted_cache_dir = self._docker_fixed_user_cache # '/root/.clearml/cache'
(see https://github.com/allegroai/clearml-agent/blob/b196ab57931f3c67efcb561df0c8a2fe7c0e76f9/clearml_agent/commands/worker.py#L2962 ). The comment seems to be incorrect as _docker_fixed_user_cache = '/clearml_agent_cache'
. mounted_cache_dir
should also be configurable.
In general, being root
user in runtime is great for most people (it allows a lot of flexbility) but is not good practice for in serious production environment. In most production cases the correct assumption is non-sudo user, it should be easy to configure clearml
to work in that setup.
EDIT: I wonder if this code has anything to do with it: https://github.com/allegroai/clearml-agent/blob/b196ab57931f3c67efcb561df0c8a2fe7c0e76f9/clearml_agent/commands/worker.py#L2179-L2184
Seems to allows specifying user home dir