-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathdaemon_cli.rs
More file actions
90 lines (70 loc) · 2.51 KB
/
daemon_cli.rs
File metadata and controls
90 lines (70 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
use clap::Parser;
use tracing::Level;
#[derive(Parser, Debug, Clone)]
#[command(version, about, long_about = None)]
pub struct Args {
/// Run the API server
#[arg(long)]
pub run_server: bool,
/// Run the background worker
#[arg(long)]
pub run_bg_worker: bool,
/// Polling interval for the background worker to fetch jobs
#[arg(long, default_value_t = 1000)]
pub worker_polling_interval_ms: u64,
/// Generate fhe keys and exit
#[arg(long)]
pub generate_fhe_keys: bool,
/// Server maximum ciphertexts to schedule per batch
#[arg(long, default_value_t = 5000)]
pub server_maximum_ciphertexts_to_schedule: usize,
/// Server maximum ciphertexts to serve on get_cihpertexts endpoint
#[arg(long, default_value_t = 5000)]
pub server_maximum_ciphertexts_to_get: usize,
/// Work items batch size
#[arg(long, default_value_t = 10)]
pub work_items_batch_size: i32,
/// Tenant key cache size
#[arg(long, default_value_t = 32)]
pub tenant_key_cache_size: i32,
/// Maximum compact inputs to upload
#[arg(long, default_value_t = 10)]
pub maximimum_compact_inputs_upload: usize,
/// Maximum compact inputs to upload
#[arg(long, default_value_t = 255)]
pub maximum_handles_per_input: u8,
/// Coprocessor FHE processing threads
#[arg(long, default_value_t = 8)]
pub coprocessor_fhe_threads: usize,
/// Tokio Async IO threads
#[arg(long, default_value_t = 4)]
pub tokio_threads: usize,
/// Postgres pool max connections
#[arg(long, default_value_t = 10)]
pub pg_pool_max_connections: u32,
/// Server socket address
#[arg(long, default_value = "127.0.0.1:50051")]
pub server_addr: String,
/// Prometheus metrics server address
#[arg(long, default_value = "0.0.0.0:9100")]
pub metrics_addr: String,
/// Postgres database url. If unspecified DATABASE_URL environment variable is used
#[arg(long)]
pub database_url: Option<String>,
/// Coprocessor private key file path.
/// Private key is in plain text 0x1234.. format.
#[arg(long, default_value = "./coprocessor.key")]
pub coprocessor_private_key: String,
/// Coprocessor service name in OTLP traces
#[arg(long, default_value = "coprocessor")]
pub service_name: String,
/// Log level for the application
#[arg(
long,
value_parser = clap::value_parser!(Level),
default_value_t = Level::INFO)]
pub log_level: Level,
}
pub fn parse_args() -> Args {
Args::parse()
}