You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(miner): Add remote capability to DockerExecutorManager (COM-542) (#668)
The `DockerExecutorManager` has been expanded to support multiple remote
executors as well as running one executor locally. You can configure the
executors with a config file. The local executor is run directly on the
host machine using docker. The remote executors are run on a remote
machine using docker over ssh.
The default config uses one local executor.
Copy file name to clipboardExpand all lines: miner/README.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,56 @@ Most straightforward option is to use a "miner-runner" docker image which will l
16
16
17
17
Alternatively, you can use `docker-compose` to launch all the necessary services manually. See [docker-compose.yml](envs/runner/data/docker-compose.yml) for reference.
18
18
19
+
## Using the docker executor manager
20
+
21
+
The default config of the docker executor manager runs executors in docker containers on the same machine as the miner (for `DEFAULT_EXECUTOR_CLASS`).
22
+
It can be configured to run executors in docker containers on remote machines for different executor classes.
23
+
To do this, follow these steps:
24
+
25
+
1. Create a directory for your configuration, e.g., `/home/ubuntu/vendor`.
26
+
2. Generate an SSH key pair in this directory for the executor manager to use to connect to the executors.
27
+
If your executor machines require different keys, you can put all the keys here.
28
+
The executor machines must accept SSH connections from the miner machine with the key configured below.
29
+
3. Create a YAML file in the directory (i.e., `docker_config.yaml`) and configure your executor machines. For example:
30
+
```yaml
31
+
executor-1:
32
+
executor_class: always_on.llm.a6000
33
+
mode: ssh
34
+
host: "1.2.3.4"
35
+
ssh_port: 22
36
+
username: "ubuntu"
37
+
key_path: "/root/vendor/id_ed25519_miner"
38
+
39
+
executor-2:
40
+
executor_class: always_on.llm.a6000
41
+
mode: ssh
42
+
host: "1.1.1.1"
43
+
ssh_port: 22
44
+
username: "ubuntu"
45
+
key_path: "/root/vendor/id_ed25519_miner"
46
+
```
47
+
The root keys are names of the executor machines, which can be anything you want.
48
+
You can set the value of `executor_class` to a special value `DEFAULT_EXECUTOR_CLASS` to use the default executor manager set in your `.env`.
49
+
Along with other remote servers, you can also configure one executor to run locally on the miner machine:
50
+
```yaml
51
+
executor-local:
52
+
executor_class: always_on.llm.a6000
53
+
mode: local
54
+
```
55
+
> [!NOTE]
56
+
> If you use ddos-shield, your local executor cannot serve streaming jobs.
57
+
4. Update your `.env` file with the following variables:
5. (Optional) You can add `DEBUG_AUTO_REMOVE_EXECUTOR_CONTAINERS=False` in `.env` to skip removing containers automatically after they are stopped (i.e., for debugging purposes).
63
+
6. Restart your miner.
64
+
65
+
> [!NOTE]
66
+
> `HOST_VENDOR_DIR` will be mounted to `/root/vendor` inside the miner container.
67
+
> So, `key_path` in the YAML config and `DOCKER_EXECUTORS_CONFIG_PATH` in `.env` should be relative to `/root/vendor`.
68
+
19
69
## Custom executor manager
20
70
21
71
Miners are encouraged to optimize their setup by implementing their own executor manager. To use your custom code, follow these steps:
0 commit comments