Skip to content

Commit

Permalink
feat(hydroflow_plus_std): extract initial Hydroflow+ utilities into a…
Browse files Browse the repository at this point in the history
… standard library
shadaj committed Dec 3, 2024
1 parent 0dc709e commit 16342d2
Showing 15 changed files with 82 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ jobs:
--bump ${{ inputs.bump }} --bump-dependencies auto
${{ inputs.execute && '--execute' || '--no-publish' }}
hydroflow hydroflow_lang hydroflow_macro hydroflow_plus
hydroflow_datalog hydroflow_datalog_core
hydroflow_plus_std hydroflow_datalog hydroflow_datalog_core
hydro_deploy hydro_cli hydroflow_deploy_integration
stageleft stageleft_macro stageleft_tool
multiplatform_test
14 changes: 14 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
@@ -14,6 +14,7 @@ members = [
"hydroflow_lang",
"hydroflow_macro",
"hydroflow_plus",
"hydroflow_plus_std",
"hydroflow_plus_test",
"hydroflow_plus_test_local",
"hydroflow_plus_test_local_macro",
Empty file added hydroflow_plus_std/CHANGELOG.md
Empty file.
28 changes: 28 additions & 0 deletions hydroflow_plus_std/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "hydroflow_plus_std"
publish = true
version = "0.10.0"
edition = "2021"
license = "Apache-2.0"
documentation = "https://docs.rs/hydroflow_plus_std/"
description = "Standard library of distributed systems building blocks for Hydroflow+"

[lints]
workspace = true

[lib]
path = "src/lib.rs"

[dependencies]
hydroflow_plus = { path = "../hydroflow_plus", version = "^0.10.0", default-features = false }
stageleft = { path = "../stageleft", version = "^0.5.0" }

[build-dependencies]
stageleft_tool = { path = "../stageleft_tool", version = "^0.4.0" }

[dev-dependencies]
hydroflow_plus = { path = "../hydroflow_plus", version = "^0.10.0" }
insta = "1.39"
hydro_deploy = { path = "../hydro_deploy/core", version = "^0.10.0" }
async-ssh2-lite = { version = "0.5.0", features = ["vendored-openssl"] }
ctor = "0.2.8"
3 changes: 3 additions & 0 deletions hydroflow_plus_std/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
stageleft_tool::gen_final!();
}
13 changes: 13 additions & 0 deletions hydroflow_plus_std/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
stageleft::stageleft_no_entry_crate!();

pub mod quorum;
pub mod request_response;

#[stageleft::runtime]
#[cfg(test)]
mod tests {
#[ctor::ctor]
fn init() {
hydroflow_plus::deploy::init_test();
}
}
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions hydroflow_plus_test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ stageleft_devel = []

[dependencies]
hydroflow_plus = { path = "../hydroflow_plus", version = "^0.10.0" }
hydroflow_plus_std = { path = "../hydroflow_plus_std", version = "^0.10.0" }
tokio = { version = "1.29.0", features = [ "full" ] }
stageleft = { path = "../stageleft", version = "^0.5.0" }
rand = "0.8.0"
2 changes: 0 additions & 2 deletions hydroflow_plus_test/src/cluster/mod.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,5 @@ pub mod map_reduce;
pub mod paxos;
pub mod paxos_bench;
pub mod paxos_kv;
pub mod quorum;
pub mod request_response;
pub mod simple_cluster;
pub mod two_pc;
5 changes: 2 additions & 3 deletions hydroflow_plus_test/src/cluster/paxos.rs
Original file line number Diff line number Diff line change
@@ -4,12 +4,11 @@ use std::hash::Hash;
use std::time::Duration;

use hydroflow_plus::*;
use hydroflow_plus_std::quorum::{collect_quorum, collect_quorum_with_response};
use hydroflow_plus_std::request_response::join_responses;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};

use super::quorum::{collect_quorum, collect_quorum_with_response};
use super::request_response::join_responses;

pub struct Proposer {}
pub struct Acceptor {}

2 changes: 1 addition & 1 deletion hydroflow_plus_test/src/cluster/paxos_bench.rs
Original file line number Diff line number Diff line change
@@ -3,11 +3,11 @@ use std::rc::Rc;
use std::time::Duration;

use hydroflow_plus::*;
use hydroflow_plus_std::quorum::collect_quorum;
use tokio::time::Instant;

use super::paxos::{Acceptor, Ballot, Proposer};
use super::paxos_kv::{paxos_kv, KvPayload, Replica};
use super::quorum::collect_quorum;

pub struct Client {}

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions hydroflow_plus_test/src/cluster/two_pc.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use hydroflow_plus::*;

use super::quorum::collect_quorum;
use hydroflow_plus_std::quorum::collect_quorum;

// if the variable start with p, that means current work is at the participant side. if start with c, at coordinator side.
//

0 comments on commit 16342d2

Please sign in to comment.