Describe default automount behavior for agent ssh access (#445)

This commit is contained in:
pollfly 2023-01-19 17:28:08 +02:00 committed by GitHub
parent 6187da7b84
commit a51ddbd674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 5 deletions

View File

@ -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. that `group_a` or `group_b` will not be able to starve one another of resources.
#### SSH Access #### 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 If you want to use existing auth sockets with ssh-agent, you can verify your host ssh-agent is working correctly with:
the SSH keys provided in the environment variable.
```commandline
echo $SSH_AGENT_SOCK
``` ```
SSH_AUTH_SOCK=<file_socket> clearml-agent daemon --gpus <your config> --queue <your queue name> --docker
You should see a path to a temporary file, something like this:
```console
/tmp/ssh-<random>/agent.<random>
``` ```
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 ### Kubernetes
Agents can be deployed bare-metal or as dockers in a Kubernetes cluster. ClearML Agent adds the missing scheduling 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 Agents capabilities to Kubernetes, allows for more flexible automation from code, and gives access to all of ClearML Agents

View File

@ -153,7 +153,9 @@ Compatible with Docker versions 0.6.5 and above
--- ---
**`agent.docker_internal_mounts`** (*dict*) <a id="docker_internal_mounts"/>
**`agent.docker_internal_mounts`** (*dict*)
* Set internal mount points inside the Docker. This is especially useful for non-root Docker container images. * Set internal mount points inside the Docker. This is especially useful for non-root Docker container images.