Skip to content

Commit

Permalink
fix: CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Oct 3, 2024
1 parent 87b00a0 commit a2d662a
Show file tree
Hide file tree
Showing 9 changed files with 323 additions and 42 deletions.
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ default-members = [
exclude = ["raft-rs", "raftify-cli"]

[workspace.package]
version = "0.1.78"
version = "0.1.80"
authors = ["Lablup Inc."]
edition = "2021"
description = "Experimental High level Raft framework"
Expand Down
4 changes: 4 additions & 0 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ keywords.workspace = true

[dependencies]
raftify.workspace = true

[features]
default = ["tls"]
tls = []
7 changes: 4 additions & 3 deletions examples/memstore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.40", features = ["full"] }
color-backtrace = "0.6.1"
raftify = { version = "0.1.78" }
raftify_cli = { version = "0.1.1" }
raftify = { version = "0.1.80" }
raftify_cli = { version = "0.1.80" }

[features]
default = ["heed_storage"]
default = ["heed_storage", "tls"]
inmemory_storage = []
heed_storage = []
rocksdb_storage = []
tls = []
1 change: 0 additions & 1 deletion examples/memstore/static-members/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ default = ["heed_storage"]
inmemory_storage = []
heed_storage = []
rocksdb_storage = []

29 changes: 18 additions & 11 deletions examples/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use raftify::{Config, ConfigBuilder, Peers, RaftConfig, TlsConfig};
use raftify::{Config, ConfigBuilder, Peers, RaftConfig};

#[cfg(feature = "tls")]
use raftify::TlsConfig;

use crate::utils::{ensure_directory_exist, get_storage_path};

Expand All @@ -14,21 +17,25 @@ pub fn build_config(node_id: u64, initial_peers: Option<Peers>) -> Config {
let storage_pth = get_storage_path("./logs", node_id);
ensure_directory_exist(&storage_pth).expect("Failed to create storage directory");

let client_tls_config = TlsConfig {
cert_path: None,
key_path: None,
ca_cert_path: Some("./ca_cert.pem".to_string()),
domain_name: Some("localhost".to_string()),
};

let config_builder = ConfigBuilder::new()
let mut config_builder = ConfigBuilder::new()
.log_dir("./logs".to_owned())
.save_compacted_logs(true)
.compacted_log_dir("./logs".to_owned())
.compacted_log_size_threshold(1024 * 1024 * 1024)
.raft_config(raft_config)
.tick_interval(0.2)
.global_client_tls_config(client_tls_config);
.tick_interval(0.2);

#[cfg(feature = "tls")]
{
let client_tls_config = TlsConfig {
cert_path: None,
key_path: None,
ca_cert_path: Some("./ca_cert.pem".to_string()),
domain_name: Some("localhost".to_string()),
};

config_builder = config_builder.global_client_tls_config(client_tls_config);
}

let config_builder = if let Some(peers) = initial_peers {
config_builder.initial_peers(peers)
Expand Down
Loading

0 comments on commit a2d662a

Please sign in to comment.