-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathcli.rs
More file actions
60 lines (48 loc) · 1.61 KB
/
cli.rs
File metadata and controls
60 lines (48 loc) · 1.61 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
use clap::Parser;
use fhevm_engine_common::utils::DatabaseURL;
use tracing::Level;
use uuid::Uuid;
#[derive(Parser, Debug, Clone)]
#[command(version, about, long_about = None)]
pub struct Args {
/// Postgres database url. If unspecified DATABASE_URL environment variable is used
#[arg(long)]
pub database_url: Option<DatabaseURL>,
/// Redis URL
#[arg(long)]
pub redis_url: String,
/// RabbitMQ URI
#[arg(long, default_value = "amqp://guest:guest@localhost:5672/%2f")]
pub rmq_uri: String,
/// Tenant key cache size
#[arg(long, default_value_t = 32)]
pub tenant_key_cache_size: i32,
/// Ciphertext cache size
#[arg(long, default_value_t = 1000)]
pub ciphertext_cache_size: i32,
/// tfhe-worker service name in OTLP traces
#[arg(long, default_value = "tfhe-compute-node")]
pub service_name: String,
/// Prometheus metrics server address
#[arg(long, default_value = "0.0.0.0:9100")]
pub metrics_addr: Option<String>,
/// Tokio processing threads
#[arg(long, default_value_t = 32)]
pub blocking_fhe_threads: usize,
/// Tokio Async IO threads
#[arg(long, default_value_t = 4)]
pub tokio_threads: usize,
/// Log level for the application
#[arg(
long,
value_parser = clap::value_parser!(Level),
default_value_t = Level::INFO)]
pub log_level: Level,
/// Worker/replica ID for this worker instance
/// If not provided, a random UUID will be generated
#[arg(long, value_parser = clap::value_parser!(Uuid))]
pub worker_id: Option<Uuid>,
}
pub fn parse() -> Args {
Args::parse()
}