Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/filguard/lotus-ops
Browse files Browse the repository at this point in the history
  • Loading branch information
jyma committed Aug 12, 2021
2 parents 612999c + 7b9ee58 commit 837e2b3
Show file tree
Hide file tree
Showing 31 changed files with 3,899 additions and 72 deletions.
5 changes: 1 addition & 4 deletions README.md
Expand Up @@ -20,8 +20,5 @@
- [Lotus日常运维CheckList](./documents/lotus-ops-checklist.md)
- [常用环境变量说明](./documents/environment-usage.md)
- [自动Pledge脚本使用说明](./documents/auto-pledge.md)
- 时空证明运行流程、原理详解
- 爆块逻辑及优化方法
- 消息池清理操作
- 源码编译及编译常见问题
- 常见运维问题定位与解决
- [顽固扇区如何删除?](./documents/questions.md#1-顽固扇区如何删除)
@@ -1,14 +1,13 @@
- hosts: window-post-miner
remote_user: '{{ remote_user }}'
environment:
RUST_LOG: '{{ rust_log }}'
RUST_BACKTRACE: '{{ rust_backtrace }}'
FIL_PROOFS_PARAMETER_CACHE: '{{ fil_proofs_parameter_cache }}'
FIL_PROOFS_MAXIMIZE_CACHING: '{{ fil_proofs_maximize_caching }}'
FIL_PROOFS_USE_GPU_COLUMN_BUILDER: '{{ fil_proofs_use_gpu_column_builder }}'
FIL_PROOFS_USE_GPU_TREE_BUILDER: '{{ fil_proofs_use_gpu_tree_builder }}'
FULLNODE_API_INFO: '{{ fullnode_api_info }}'
LOTUS_PATH: '{{ lotus_path }}'
TMPDIR: '{{ tmp_dir }}'
LOTUS_MINER_PATH: '{{ lotus_miner_path }}'
TMPDIR: '{{ tmp_dir }}'
tasks:
Expand Down
Expand Up @@ -9,6 +9,7 @@
FIL_PROOFS_USE_GPU_TREE_BUILDER: '{{ fil_proofs_use_gpu_tree_builder }}'
FULLNODE_API_INFO: '{{ fullnode_api_info }}'
LOTUS_PATH: '{{ lotus_path }}'
TMPDIR: '{{ tmp_dir }}'
LOTUS_MINER_PATH: '{{ lotus_miner_path }}'
TMPDIR: '{{ tmp_dir }}'
tasks:
Expand Down
1 change: 1 addition & 0 deletions ansible/5-start-seal-miner.yaml
Expand Up @@ -9,6 +9,7 @@
FIL_PROOFS_USE_GPU_TREE_BUILDER: '{{ fil_proofs_use_gpu_tree_builder }}'
FULLNODE_API_INFO: '{{ fullnode_api_info }}'
LOTUS_PATH: '{{ lotus_path }}'
TMPDIR: '{{ tmp_dir }}'
LOTUS_MINER_PATH: '{{ lotus_miner_path }}'
TMPDIR: '{{ tmp_dir }}'
tasks:
Expand Down
47 changes: 33 additions & 14 deletions ansible/6-start-precommit-worker.yaml
@@ -1,9 +1,10 @@
- hosts: precommit-worker
- hosts: 10.0.1.16
remote_user: '{{ remote_user }}'
environment:
RUST_LOG: '{{ rust_log }}'
RUST_BACKTRACE: '{{ rust_backtrace }}'
FIL_PROOFS_PARAMETER_CACHE: '{{ fil_proofs_parameter_cache }}'
FIL_PROOFS_PARENT_CACHE: '{{ fil_proofs_parent_cache }}'
FIL_PROOFS_MAXIMIZE_CACHING: '{{ fil_proofs_maximize_caching }}'
FIL_PROOFS_USE_GPU_COLUMN_BUILDER: '{{ fil_proofs_use_gpu_column_builder }}'
FIL_PROOFS_USE_GPU_TREE_BUILDER: '{{ fil_proofs_use_gpu_tree_builder }}'
Expand All @@ -14,7 +15,7 @@
- debug: var=ansible_all_ipv4_addresses[0]
- debug: var=ansible_hostname
- debug: var=lotus_miner_path

- name: Create cache path, lotus worker path, tmp path, log path
file:
path: '{{ item }}'
Expand All @@ -24,25 +25,43 @@
mode: u=rwxr,g=xr,o=x
loop:
- '{{ fil_proofs_parent_cache }}'
- '{{ lotus_worker_path }}'
- '{{ tmp_dir }}/tmp'
- '{{ lotus_worker_path_0 }}'
- '{{ lotus_worker_path_1 }}'
- '{{ tmp_dir }}'
- '{{ log_path }}'

- name: Copy myscheduler config to precommit worker
copy:
src: '{{ workspace }}/lotus-ops/config/myscheduler-precommit.json'
dest: '{{ item }}/myscheduler.json'
loop:
- '{{ lotus_worker_path }}'
- '{{ lotus_worker_path_0 }}'
- '{{ lotus_worker_path_1 }}'

- name: Start precommit worker 0
shell: |
tmux new -s lotus -d -n worker
tmux send-keys -t lotus:worker "export LOTUS_WORKER_PATH={{ lotus_worker_path }}" C-m
tmux send-keys -t lotus:worker "export CUDA_VISIBLE_DEVICES=0" C-m
tmux send-keys -t lotus:worker "export TMPDIR={{ tmp_dir }}/tmp" C-m
tmux send-keys -t lotus:worker "export FIL_PROOFS_MULTICORE_SDR_PRODUCERS=1" C-m
tmux send-keys -t lotus:worker "export ENV_CPU_CORE_BEGIN_NUM=0" C-m
tmux send-keys -t lotus:worker "export ENV_CPU_CORE_END_NUM=16" C-m
tmux send-keys -t lotus:worker "lotus-worker run --listen={{ ansible_all_ipv4_addresses[0] }}:{{ worker_port }} --commit=false" C-m
tmux pipe-pane -o "cat >>{{ log_path }}/lotus-worker-`date +%Y-%m-%d-%H-%M`.log"
tmux new -s lotus -d -n worker0
tmux send-keys -t lotus:worker0 "export LOTUS_WORKER_PATH={{ lotus_worker_path_0 }}" C-m
tmux send-keys -t lotus:worker0 "export CUDA_VISIBLE_DEVICES=0" C-m
tmux send-keys -t lotus:worker0 "export TMPDIR={{ tmp_dir }}" C-m
tmux send-keys -t lotus:worker0 "export FIL_PROOFS_MULTICORE_SDR_PRODUCERS=1" C-m
tmux send-keys -t lotus:worker0 "export ENV_CPU_CORE_BEGIN_NUM=0" C-m
tmux send-keys -t lotus:worker0 "export ENV_CPU_CORE_END_NUM=8" C-m
tmux send-keys -t lotus:worker0 "echo $ENV_CPU_CORE_BEGIN_NUM" C-m
tmux send-keys -t lotus:worker0 "echo $ENV_CPU_CORE_END_NUM" C-m
tmux send-keys -t lotus:worker0 "lotus-worker run --listen={{ ansible_all_ipv4_addresses[0] }}:{{ lotus_worker_port_0 }} --commit=false" C-m
tmux pipe-pane -o "cat >>{{ log_path }}/lotus-worker0-`date +%Y-%m-%d-%H-%M`.log"
- name: Start commit worker 1
shell: |
tmux new-window -t lotus -n worker1
tmux send-keys -t lotus:worker1 "export LOTUS_WORKER_PATH={{ lotus_worker_path_1 }}" C-m
tmux send-keys -t lotus:worker1 "export CUDA_VISIBLE_DEVICES=0" C-m
tmux send-keys -t lotus:worker1 "export TMPDIR={{ tmp_dir }}" C-m
tmux send-keys -t lotus:worker1 "export FIL_PROOFS_MULTICORE_SDR_PRODUCERS=1" C-m
tmux send-keys -t lotus:worker1 "export ENV_CPU_CORE_BEGIN_NUM=8" C-m
tmux send-keys -t lotus:worker1 "export ENV_CPU_CORE_END_NUM=16" C-m
tmux send-keys -t lotus:worker1 "echo $ENV_CPU_CORE_BEGIN_NUM" C-m
tmux send-keys -t lotus:worker1 "echo $ENV_CPU_CORE_END_NUM" C-m
tmux send-keys -t lotus:worker1 "lotus-worker run --listen={{ ansible_default_ipv4.address }}:{{ lotus_worker_port_1 }} --commit=false" C-m
tmux pipe-pane -o "cat >>{{ log_path }}/lotus-worker1-`date +%Y-%m-%d-%H-%M`.log"
4 changes: 2 additions & 2 deletions ansible/7-start-commit-worker.yaml
@@ -1,4 +1,4 @@
- hosts: commit-worker
- hosts: 10.0.2.13
remote_user: '{{ remote_user }}'
environment:
RUST_LOG: '{{ rust_log }}'
Expand Down Expand Up @@ -54,4 +54,4 @@
tmux send-keys -t lotus:worker1 "export CUDA_VISIBLE_DEVICES=1" C-m
tmux send-keys -t lotus:worker1 "export TMPDIR={{ tmp_dir }}/tmp1" C-m
tmux send-keys -t lotus:worker1 "lotus-worker run --listen={{ ansible_all_ipv4_addresses[0] }}:{{ lotus_worker_port_1 }} --addpiece=false --precommit1=false --precommit2=false" C-m
tmux pipe-pane -o "cat >>{{ log_path }}/lotus-worker1-`date +%Y-%m-%d-%H-%M`.log"
tmux pipe-pane -o "cat >>{{ log_path }}/lotus-worker1-`date +%Y-%m-%d-%H-%M`.log"
12 changes: 6 additions & 6 deletions ansible/copy-bin-to-amd.yaml
Expand Up @@ -5,7 +5,7 @@
become_method: sudo
vars:
- lotus_bin_path: 'lotus-bin'
- version: '1.7.0'
- version: 'v1.10.0'
- platform: 'amd'
tasks:
- name: Copy lotus bin to all amd
Expand All @@ -14,8 +14,8 @@
dest: '/usr/local/bin/'
mode: +x
loop:
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/{{ platform }}/lotus'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/{{ platform }}/lotus-miner'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/{{ platform }}/lotus-worker'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/{{ platform }}/lotus-shed'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/{{ platform }}/lotus-bench'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/lotus'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/lotus-miner'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/lotus-worker'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/lotus-shed'
- '{{ workspace }}/{{ lotus_bin_path }}/{{ version }}/lotus-bench'
5 changes: 3 additions & 2 deletions ansible/install-node-exporter.yaml
@@ -1,4 +1,5 @@
- hosts: public-daemon,winning-post-miner,window-post-miner,seal-miner,precommit-worker,commit-worker
# - hosts: public-daemon,private-daemon,winning-post-miner,window-post-miner,seal-miner,precommit-worker,commit-worker
- hosts: 10.0.1.17
remote_user: '{{ remote_user }}'
gather_facts: no
become: yes
Expand All @@ -7,7 +8,7 @@
tasks:
- name: Create prometheus run direction
file:
path: '/home/fil/disk_md0/prometheus/run'
path: '/home/fil/prometheus/run'
state: directory

- name: Copy node exporter script to remote server
Expand Down
28 changes: 28 additions & 0 deletions ansible/lotus-version-check.yaml
@@ -0,0 +1,28 @@
- hosts: amd
tasks:
- debug: var=ansible_default_ipv4.address
- debug: var=ansible_hostname

- name: Create workspace directory
file:
path: '{{ workspace }}'
state: directory
owner: '{{ remote_user }}'
group: '{{ remote_user }}'
mode: +x

- name: Copy check script to remote server
copy:
src: '{{ workspace }}/lotus-ops/scripts/lotus-version-check.sh'
dest: '{{ workspace }}'
owner: '{{ remote_user }}'
group: '{{ remote_user }}'
mode: +x

- name: Lotus version check
shell: '{{ workspace }}/lotus-version-check.sh'
register: check_result

- name: Echo check result
debug:
msg: '{{ check_result.stdout }}'
2 changes: 1 addition & 1 deletion ansible/worker-pre-check.yaml
Expand Up @@ -25,4 +25,4 @@

- name: Echo check result
debug:
msg: '{{ check_result.stdout }}'
msg: '{{ check_result.stdout }}'
2 changes: 1 addition & 1 deletion config/Miner-monitoring.json
Expand Up @@ -17,7 +17,7 @@
"editable": true,
"gnetId": 8919,
"graphTooltip": 0,
"id": 1,
"id": null,
"iteration": 1615014350433,
"links": [
{
Expand Down

0 comments on commit 837e2b3

Please sign in to comment.