Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"rust-analyzer.check.command": "clippy",
"rust-analyzer.check.extraArgs": [
"--",
"-D",
"warnings",
"-W",
"clippy::pedantic",
"-W",
"clippy::nursery",
"-W",
"clippy::style",
"-W",
"clippy::complexity",
"-W",
"clippy::perf",
"-W",
"clippy::suspicious",
"-W",
"clippy::correctness"
]
"rust-analyzer.check.command": "clippy",
"rust-analyzer.check.extraArgs": [
"--",
"-D",
"warnings",
"-W",
"clippy::pedantic",
"-W",
"clippy::nursery",
"-W",
"clippy::style",
"-W",
"clippy::complexity",
"-W",
"clippy::perf",
"-W",
"clippy::suspicious",
"-W",
"clippy::correctness"
],
"idf.pythonInstallPath": "/usr/local/bin/python3"
}
15 changes: 15 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ license = "Apache-2.0"

[workspace.dependencies]
aes-gcm = "0.10.3"
async-trait = "0.1.86"
anyhow = "1.0.97"
atoma-confidential = { path = "./atoma-confidential" }
atoma-daemon = { path = "./atoma-daemon" }
Expand Down
4 changes: 3 additions & 1 deletion atoma-bin/atoma_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ async fn main() -> Result<()> {
let p2p_node_service_handle = spawn_with_shutdown(
async move {
let p2p_node =
AtomaP2pNode::start(config.p2p, Arc::new(keystore), p2p_event_sender, false)?;
AtomaP2pNode::start(config.p2p, Arc::new(keystore), p2p_event_sender, false)
.await
.map_err(|e| anyhow::anyhow!("Failed to start P2P node: {}", e))?;
let pinned_future = Box::pin(p2p_node.run(p2p_node_service_shutdown_receiver));
pinned_future.await
},
Expand Down
5 changes: 3 additions & 2 deletions atoma-p2p-tester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create and start the P2P node
let keystore: FileBasedKeystore =
FileBasedKeystore::new(&PathBuf::from(&config.sui.sui_keystore_path()))
.context("Failed to create keystore")?;
.with_context(|| "Failed to create keystore")?;

let node = AtomaP2pNode::start(config.p2p, Arc::new(keystore), atoma_p2p_sender, false)
.context("Failed to start P2P node")?;
.await
.with_context(|| "Failed to start P2P node")?;

let atoma_p2p_node_handle =
spawn_with_shutdown(node.run(shutdown_receiver.clone()), shutdown_sender.clone());
Expand Down
5 changes: 5 additions & 0 deletions atoma-p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ edition.workspace = true
license.workspace = true

[dependencies]
anyhow = { workspace = true }
async-trait = { workspace = true }
blake3 = { workspace = true }
bytes = { workspace = true }
ciborium = { workspace = true }
Expand All @@ -20,12 +22,14 @@ libp2p = { workspace = true, features = [
"mdns",
"kad",
"macros",
"request-response",
"quic",
"tcp",
"yamux",
"noise",
"metrics",
"rsa",
"cbor",
] }
fastcrypto = { workspace = true }
flume = { workspace = true }
Expand All @@ -39,6 +43,7 @@ sui-keys = { workspace = true }
sui-sdk = { workspace = true }
serde_json = { workspace = true }
sysinfo = { workspace = true }
sqlx = { workspace = true, features = ["runtime-tokio", "postgres"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tracing = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions atoma-p2p/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ pub struct AtomaP2pNodeConfig {
/// of the form (`serving_engine`, `metrics_endpoint`)
/// (e.g. `"meta-llama/Llama-3.2-3B-Instruct" => ("vllm", "http://chat-completions:8000/metrics")`)
pub metrics_endpoints: HashMap<String, (String, String)>,

/// Database connection URL for `PostgreSQL`
pub database_url: String,
}

impl AtomaP2pNodeConfig {
Expand Down
10 changes: 10 additions & 0 deletions atoma-p2p/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,14 @@ pub enum AtomaP2pNodeError {
PublishError(String),
#[error("DNS resolver error: `{0}`")]
DnsError(#[from] std::io::Error),
#[error("Failed to connect to database: `{0}`")]
DatabaseConnectionError(#[from] sqlx::Error),
#[error("External error: `{0}`")]
External(String),
}

impl From<anyhow::Error> for AtomaP2pNodeError {
fn from(err: anyhow::Error) -> Self {
Self::External(err.to_string())
}
}
Loading
Loading