Skip to content

Commit

Permalink
chore(unified name): wdpost -> window_post
Browse files Browse the repository at this point in the history
  • Loading branch information
0x5459 committed Jul 28, 2023
1 parent 263dabf commit aaf48fb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions damocles-worker/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ pub struct Processors {
/// section for unseal processor
pub unseal: Option<Vec<Ext>>,

/// section for fetch processor
pub wdpost: Option<Vec<Ext>>,
/// section for window_post processor
pub window_post: Option<Vec<Ext>>,
}

impl Processors {
Expand Down
4 changes: 2 additions & 2 deletions damocles-worker/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ fn start_processors(cfg: &config::Config, locks: &Arc<resource::Pool>) -> Result

let unseal: processor::ArcUnsealProcessor = construct_sub_processor!(unseal, cfg, locks);

let wdpost: processor::ArcWdPostProcessor = construct_sub_processor!(wdpost, cfg, locks);
let window_post: processor::ArcWdPostProcessor = construct_sub_processor!(window_post, cfg, locks);

Ok(GlobalProcessors {
add_pieces,
Expand All @@ -325,7 +325,7 @@ fn start_processors(cfg: &config::Config, locks: &Arc<resource::Pool>) -> Result
snap_prove,
transfer,
unseal,
wdpost,
window_post,
})
}

Expand Down
6 changes: 4 additions & 2 deletions damocles-worker/src/sealing/sealing_thread/planner/wdpost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crossbeam_channel::{bounded, Receiver, Sender};
use jsonrpc_core::ErrorCode;
use jsonrpc_core_client::RpcError;
use tokio::runtime::Handle;
use vc_processors::builtin::tasks::{PoStReplicaInfo, WindowPoSt, WindowPoStOutput};
use vc_processors::builtin::tasks::{PoStReplicaInfo, WindowPoSt, WindowPoStOutput, STAGE_NAME_WINDOW_POST};

use crate::logging::warn;
use crate::rpc::sealer::{AllocatePoStSpec, AllocatedWdPoStJob, SectorID};
Expand Down Expand Up @@ -337,6 +337,8 @@ impl WdPost<'_> {
}

fn generate(&self) -> Result<WdPostEvent, Failure> {
let _token = self.job.sealing_ctrl.ctx().global.limit.acquire(STAGE_NAME_WINDOW_POST).crit()?;

let wdpost_job = self.job.wdpost_job.as_ref().context("wdpost info not found").abort()?;

let mut instances = HashMap::new();
Expand Down Expand Up @@ -410,7 +412,7 @@ impl WdPost<'_> {
replicas: replica,
seed: wdpost_job.input.seed,
};
let res = self.job.sealing_ctrl.ctx().global.processors.wdpost.process(post_in);
let res = self.job.sealing_ctrl.ctx().global.processors.window_post.process(post_in);
if let Err(e) = &res {
tracing::error!(err=?e, job_id=wdpost_job.id,"wdpost error");
}
Expand Down
2 changes: 1 addition & 1 deletion damocles-worker/src/watchdog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct GlobalProcessors {
pub snap_prove: ArcSnapProveProcessor,
pub transfer: ArcTransferProcessor,
pub unseal: ArcUnsealProcessor,
pub wdpost: ArcWdPostProcessor,
pub window_post: ArcWdPostProcessor,
}

impl Module for Box<dyn Module> {
Expand Down
20 changes: 14 additions & 6 deletions docs/zh/09.独立运行的poster节点.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ damocles-worker 新增 wdpost planner 用于执行 window post 任务。
| | |
-------+--------------------------+--------------------------+------------
| | |
pull | job pull | job pull | job
push | res pull | res pull | res
by | rpc by | rpc by | rpc
| pull job | pull job | pull job
| push res | push res | push res
| by rpc | by rpc | by rpc
| | |
+------+--------+ +-------+-------+ +------+--------+
|damocles-worker| |damocles-worker| |damocles-worker|
Expand Down Expand Up @@ -91,11 +91,19 @@ plan = "wdpost"
name = "miner-6666-store"
location = "/mnt/miner-6666-store"

[[processors.wdpost]]
# 使用自定义 wdpost 算法 (可选)

# 控制 window_post 任务并发 (可选),不配置则不限制
[processors.limitation.concurrent]
window_post = 2

[[processors.window_post]]
# 使用自定义 wdpost 算法 (可选), 如果不配置 bin,则默认使用内置算法
bin="~/my_algorithm"
args = ["window_post"]
envs = { BELLMAN_GPU_INDEXS="0",CUDA_VISIBLE_DEVICES="0", ... }
# 配置自定义算法的环境变量 (可选)
envs = { BELLMAN_GPU_INDEXS="0", CUDA_VISIBLE_DEVICES="0", ... }
# 配置本进程最大并发数量 (可选),不配置则不限制
concurrent = 1
```

##### 一份最简的只启动一个 wdpost sealing_thread 的配置如下:
Expand Down

0 comments on commit aaf48fb

Please sign in to comment.