|
1 |
| -# DoH |
2 |
| -Distributed jObs Hypervisor |
| 1 | +# DoH: Disributed jObs Hypervisor |
| 2 | + |
| 3 | +## 0x01 Deployment |
| 4 | + |
| 5 | +Install Rust |
| 6 | +```bash |
| 7 | +# Install rust |
| 8 | +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| 9 | +# or update |
| 10 | +rustup update |
| 11 | +Install openssl and libssl-dev |
| 12 | +sudo apt-get update |
| 13 | +sudo apt install openssl |
| 14 | +sudo apt install libssl-dev |
| 15 | +sudo apt install pkg-config |
| 16 | +``` |
| 17 | + |
| 18 | +## 0x02 compile |
| 19 | +```bash |
| 20 | +git clone https://github.com/ZimaBlue-AI/DoH |
| 21 | +cd DoH |
| 22 | +cargo build --release |
| 23 | +``` |
| 24 | + |
| 25 | +## 0x03 configuration |
| 26 | + |
| 27 | +### 3.1 Resource monitoring program configuration, saved as config.json |
| 28 | + |
| 29 | +```json |
| 30 | +{ |
| 31 | + "disk_monitor": { |
| 32 | + "disk_space_threshold": 107374182400, #100GB |
| 33 | + "check_interval": 60, #1 miniute |
| 34 | + "mount_points": ["/mnt/c"], |
| 35 | + "path_space": [ |
| 36 | + { |
| 37 | + "path":"/mnt/c/DoH/", |
| 38 | + "space_threshold":[10, 26214400] # lower than 10bytes, or larger than 25MB will give out warning |
| 39 | + } |
| 40 | + ], |
| 41 | + "receiver": [{ |
| 42 | + "receive_id": "ou_***", |
| 43 | + "receive_id_type": "open_id" |
| 44 | + }] |
| 45 | + }, |
| 46 | + "resource_monitor": { |
| 47 | + "check_interval": 10, #10 seconds |
| 48 | + "iops_threshold": 26214400, # read/write bytes over 25MB |
| 49 | + "memory_threshold": 1073741824, # RAM over 1GB |
| 50 | + "virtual_memory_threshold": 10737418240, # Virtual memory over 1GB |
| 51 | + "cpu_threshold": 190.0, # CPU usage over 190% |
| 52 | + "exclude_self_process": true, # don't warrning the self monitor processes |
| 53 | + "receiver": [{ |
| 54 | + "receive_id": "186***", # phone |
| 55 | + "receive_id_type": "mobile" |
| 56 | + }] |
| 57 | + }, |
| 58 | + "notice_config": { |
| 59 | + "fs_config": { |
| 60 | + "app_id": "cli_***", # feishu(lark) app_id |
| 61 | + "app_secret": "***", # feishu(lark) app_secret |
| 62 | + "receiver": [{ |
| 63 | + "receive_id": "oc_***" |
| 64 | + "receive_id_type": "chat_id" |
| 65 | + }] |
| 66 | + } |
| 67 | + } |
| 68 | +} |
| 69 | +``` |
| 70 | + |
| 71 | + |
| 72 | +### 3.2 Node hypervisor configuration |
| 73 | + |
| 74 | +```json |
| 75 | +{ |
| 76 | + "disk_monitor": { |
| 77 | + "disk_space_threshold": 107374182400, #100GB |
| 78 | + "check_interval": 60, #1 miniute |
| 79 | + "mount_points": ["/mnt/c"], |
| 80 | + "path_space": [ |
| 81 | + { |
| 82 | + "path":"/mnt/c/DoH/", |
| 83 | + "space_threshold":[10, 26214400] # lower than 10bytes, or larger than 25MB will give out warning |
| 84 | + } |
| 85 | + ], |
| 86 | + "receiver": [{ |
| 87 | + "receive_id": "ou_***", |
| 88 | + "receive_id_type": "open_id" |
| 89 | + }] |
| 90 | + }, |
| 91 | + "resource_monitor": { |
| 92 | + "check_interval": 10, #10 seconds |
| 93 | + "iops_threshold": 26214400, # read/write bytes over 25MB |
| 94 | + "memory_threshold": 1073741824, # RAM over 1GB |
| 95 | + "virtual_memory_threshold": 10737418240, # Virtual memory over 1GB |
| 96 | + "cpu_threshold": 190.0, # CPU usage over 190% |
| 97 | + "exclude_self_process": true, # don't warrning the self monitor processes |
| 98 | + "receiver": [{ |
| 99 | + "receive_id": "186***", # phone |
| 100 | + "receive_id_type": "mobile" |
| 101 | + }] |
| 102 | + }, |
| 103 | + "node_monitor": { |
| 104 | + "run_time": 10, |
| 105 | + "check_interval": 60, |
| 106 | + "node_id": "management_node", # node name |
| 107 | + "exclude_users": ["root"], # don not daemon root user |
| 108 | + "include_users": ["ai"], # daemon user list |
| 109 | + "receiver": [{ |
| 110 | + "receive_id": "186***", |
| 111 | + "receive_id_type": "mobile" |
| 112 | + }] |
| 113 | + }, |
| 114 | + "notice_config": { |
| 115 | + "fs_config": { |
| 116 | + "app_id": "cli_***", # feishu(lark) app_id |
| 117 | + "app_secret": "***", # feishu(lark) app_secret |
| 118 | + "receiver": [] |
| 119 | + } |
| 120 | + } |
| 121 | +} |
| 122 | +``` |
| 123 | + |
| 124 | +### 3.3 Job management program configuration |
| 125 | +``` |
| 126 | +{ |
| 127 | + "disk_monitor": { |
| 128 | + "disk_space_threshold": 107374182400, #100GB |
| 129 | + "check_interval": 60, #1 miniute |
| 130 | + "mount_points": ["/mnt/c"], |
| 131 | + "path_space": [ |
| 132 | + { |
| 133 | + "path":"/mnt/c/DoH/", |
| 134 | + "space_threshold":[10, 26214400] # lower than 10bytes, or larger than 25MB will give out warning |
| 135 | + } |
| 136 | + ], |
| 137 | + "receiver": [{ |
| 138 | + "receive_id": "ou_***", |
| 139 | + "receive_id_type": "open_id" |
| 140 | + }] |
| 141 | + }, |
| 142 | + "resource_monitor": { |
| 143 | + "check_interval": 10, #10 seconds |
| 144 | + "iops_threshold": 26214400, # read/write bytes over 25MB |
| 145 | + "memory_threshold": 1073741824, # RAM over 1GB |
| 146 | + "virtual_memory_threshold": 10737418240, # Virtual memory over 1GB |
| 147 | + "cpu_threshold": 190.0, # CPU usage over 190% |
| 148 | + "exclude_self_process": true, # don't warrning the self monitor processes |
| 149 | + "receiver": [{ |
| 150 | + "receive_id": "186***", # phone |
| 151 | + "receive_id_type": "mobile" |
| 152 | + }] |
| 153 | + }, |
| 154 | + "job_monitor": { |
| 155 | + "check_interval": 10, |
| 156 | + "script_path": "/mnt/c/DoH/test/test.sh", # run job shell script |
| 157 | + "receiver": [{ |
| 158 | + "receive_id": "ou_***", |
| 159 | + "receive_id_type": "open_id" |
| 160 | + }] |
| 161 | + }, |
| 162 | + "notice_config": { |
| 163 | + "fs_config": { |
| 164 | + "app_id": "cli_***", # feishu(lark) app_id |
| 165 | + "app_secret": "***", # feishu(lark) app_secret |
| 166 | + "receiver": [{ |
| 167 | + "receive_id": "oc_***" |
| 168 | + "receive_id_type": "chat_id" |
| 169 | + }] |
| 170 | + } |
| 171 | + } |
| 172 | +} |
| 173 | +``` |
| 174 | + |
| 175 | +## 0x04 Run |
| 176 | +### 4.1 Resource monitoring |
| 177 | +```bash |
| 178 | +RUST_LOG=INFO ./target/release/doh |
| 179 | +``` |
| 180 | + |
| 181 | +### 4.2 Node monitoring |
| 182 | +```bash |
| 183 | +RUST_LOG=INFO ./target/release/node_monitor |
| 184 | +``` |
| 185 | + |
| 186 | +### 4.3 Job monitoring |
| 187 | +```bash |
| 188 | +RUST_LOG=INFO ./target/release/job_monitor |
| 189 | +``` |
| 190 | + |
| 191 | +## 0x05 TODO |
| 192 | + |
| 193 | +- [ ] Add support for other IM (WeCom, DingTalk, Slack, Discord, etc.) |
| 194 | +- [ ] Increase resource use assessment report |
| 195 | +- [ ] ReAct according to constraint policy (Response & Action) |
| 196 | +- [ ] Remote control and web interaction |
| 197 | +- [ ] Increase artificial intelligence management |
| 198 | + |
| 199 | +## 0x06 License |
| 200 | + |
| 201 | +Licensed under [GNU General Public License v3.0 (GPL-3.0)](https://www.gnu.org/licenses/gpl-3.0.html). |
| 202 | + |
| 203 | +--- |
| 204 | +Copyright (c) 2024 ZimaBlueAI Tech. Co. Ltd. |
0 commit comments