What is the best practice for mounting an S3 container inside a docker image that will be using as a ClearML agent? I can think of 3 solutions, but have been unable to get any to work currently:
- Use prefabbed configuration in ClearML, specifically CLEARML_AGENT_K8S_HOST_MOUNT. For this to work, the S3 bucket would be mounted separately on the host using rclone and then remapped into docker. This appears to only apply to Kubernetes and not Docker - and therefore would not work.
- Mount using s3fuse as specified here. The issue is will it work with the S3 bucket secret stored in ClearML browser sessions? This would also appear to be complicated and require custom docker images, not to mention running the docker image as --privileged or similar.
- Pass arguments to docker using "docker_args and docker_bash_setup_script arguments to Task.create()" as specified in the 1.0 release notes. This would be similar to (1), but the arguments would be for bind-mounting the volume. I do not see much documentation or examples on how this new feature may be used for this end.
I was able to get another option entirely to work, namely, mount a drive on in WSL and then pass it to Docker. Let's get to it:
Why not host in Windows itself, why rclone in WSL?
Steps to mount the drive in ClearML in Windows:
/data/my-mount
(this needs to be in/data
- I don't know why and I can't find out with a Google search, but I found out about it here)--config
option)./data/my-mount
rather than/data/my mount
. There is a bug that I opened about this.docker run -it -v \\wsl$\Ubuntu\data:/data my-docker-image:latest ls /data/my-mount
docker: Error response from daemon: error while creating mount source path
C:\Users\Myself\clearml.conf
such that:["-v","/data:/data", ]
.clearml-agent daemon --docker