From a51ddbd67444159d94bc28687ed7531a023eb99b Mon Sep 17 00:00:00 2001 From: pollfly <75068813+pollfly@users.noreply.github.com> Date: Thu, 19 Jan 2023 17:28:08 +0200 Subject: [PATCH] Describe default automount behavior for agent ssh access (#445) --- docs/clearml_agent.md | 17 +++++++++++++---- docs/configs/clearml_conf.md | 4 +++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/clearml_agent.md b/docs/clearml_agent.md index a76472af..5f9d30f9 100644 --- a/docs/clearml_agent.md +++ b/docs/clearml_agent.md @@ -244,15 +244,24 @@ It will make sure the agent will pull from the `group_a` queue, then from `group that `group_a` or `group_b` will not be able to starve one another of resources. #### SSH Access -To make SSH keys available to an agent running in Docker mode, use the `SSH_AUTH_SOCK` environment variable. +By default, ClearML Agent maps the host's `~/.ssh` into the container's `/root/.ssh` directory (configurable, +see [clearml.conf](configs/clearml_conf.md#docker_internal_mounts)). -The command below will execute an agent in Docker mode and assign it to service a queue. The agent will have access to -the SSH keys provided in the environment variable. +If you want to use existing auth sockets with ssh-agent, you can verify your host ssh-agent is working correctly with: +```commandline +echo $SSH_AGENT_SOCK ``` -SSH_AUTH_SOCK= clearml-agent daemon --gpus --queue --docker + +You should see a path to a temporary file, something like this: + +```console +/tmp/ssh-/agent. ``` +Then run your `clearml-agent` in Docker mode, which will automatically detect the `SSH_AGENT_SOCK` environment variable, +and mount the socket into any container it spins. + ### Kubernetes Agents can be deployed bare-metal or as dockers in a Kubernetes cluster. ClearML Agent adds the missing scheduling capabilities to Kubernetes, allows for more flexible automation from code, and gives access to all of ClearML Agent’s diff --git a/docs/configs/clearml_conf.md b/docs/configs/clearml_conf.md index 0b934a89..369127f2 100644 --- a/docs/configs/clearml_conf.md +++ b/docs/configs/clearml_conf.md @@ -153,7 +153,9 @@ Compatible with Docker versions 0.6.5 and above --- -**`agent.docker_internal_mounts`** (*dict*) + + +**`agent.docker_internal_mounts`** (*dict*) * Set internal mount points inside the Docker. This is especially useful for non-root Docker container images.