Skip to content

Commit 4ba931a

Browse files
committed
Merge branch 'main' into docs4
2 parents 1eaedf8 + a7f957e commit 4ba931a

File tree

42 files changed

+479
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+479
-189
lines changed

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
open-pull-requests-limit: 10
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
# ignore:
9+
# - dependency-name: ""

Cargo.toml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ members = [
3737
"example_apps/tutorial_app",
3838
"example_apps/tutorial_app/model",
3939
"example_apps/tutorial_app/generator",
40+
"example_apps/join_map",
41+
"example_apps/join_value",
4042
]
4143

4244
exclude = [
@@ -63,7 +65,7 @@ futures-util = "0.3.25"
6365
parking_lot = "0.12"
6466
pin-project = "1.0.12"
6567
rand = "0.8"
66-
criterion = "0.4"
68+
criterion = "0.5.1"
6769
either = "1.8"
6870
tempdir = "0.3.7"
6971
slab = "0.4"
@@ -89,15 +91,15 @@ num-bigint = "0.4"
8991
ratchet = { package = "ratchet_rs", version = "0.4" }
9092
ratchet_fixture = "0.4"
9193
flate2 = "1.0.22"
92-
bitflags = "1.3"
94+
bitflags = "2.5"
9395
rocksdb = "0.22"
9496
integer-encoding = "3.0.4"
9597
rustls = "0.20"
9698
webpki = "0.22"
9799
webpki-roots = "0.22"
98100
tokio-rustls = "0.23"
99101
rustls-pemfile = "1.0.0"
100-
trust-dns-resolver = "0.22.0"
102+
trust-dns-resolver = "0.23.2"
101103
clap = "4.1"
102104
crossbeam-queue = { version = "0.3" }
103105
crossbeam-channel = { version = "0.5" }
@@ -106,6 +108,23 @@ percent-encoding = "2.1.0"
106108
mime = "0.3"
107109
serde_json = "1.0"
108110
serde = "1.0"
109-
reqwest = "0.11"
111+
reqwest = "0.12.4"
110112
convert_case = "0.6"
111113
frunk = "0.4"
114+
byteorder = "1.4"
115+
rmp = "0.8"
116+
ryu = "1.0"
117+
regex = "1.3.6"
118+
fnv = "1.0.7"
119+
cursive = { default-features = false, version = "0.20" }
120+
duration-str = "0.11.2"
121+
quick-xml = "0.31.0"
122+
csv = "1.2"
123+
serde-xml-rs = "0.6"
124+
axum = "0.6.20"
125+
hyper-staticfile = "0.9"
126+
httparse = "1.8"
127+
sha1 = "0.10"
128+
waker-fn = "1.1.0"
129+
num = "0.4"
130+
smol_str = "0.2.0"

api/formats/swimos_msgpack/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ either = { workspace = true }
1010
swimos_form = { path = "../../swimos_form" }
1111
swimos_model = { path = "../../swimos_model" }
1212
bytes = { workspace = true }
13-
byteorder = "1.4"
14-
rmp = "0.8"
13+
byteorder = { workspace = true }
14+
rmp = { workspace = true }
1515
num-bigint = { workspace = true }
1616

1717
[dev-dependencies]

api/formats/swimos_recon/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ swimos_utilities = { path = "../../../swimos_utilities", features = ["encoding"]
1616
nom = { workspace = true }
1717
nom_locate = { workspace = true }
1818
num-traits = { workspace = true }
19-
ryu = "1.0"
19+
ryu = { workspace = true }
2020
futures = { workspace = true }
2121
tokio = { workspace = true, features = ["io-util"] }
2222
tokio-util = { workspace = true, features = ["codec"] }

api/swimos_agent_protocol/src/ad_hoc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::AdHocCommand;
2929
mod tests;
3030

3131
#[derive(Debug, Default, Clone, Copy)]
32-
pub struct CommandEncoder<E> {
32+
struct CommandEncoder<E> {
3333
body_encoder: E,
3434
}
3535

api/swimos_agent_protocol/src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub mod encoding {
8787
};
8888
}
8989

90-
/// # The encoding used for map like lanes and stores, shared between the other protocols in this module.
90+
/// The encoding used for map like lanes and stores, shared between the other protocols in this module.
9191
pub mod map {
9292
pub use crate::map::{
9393
MapMessageDecoder, MapMessageEncoder, MapOperationDecoder, MapOperationEncoder,
@@ -96,7 +96,7 @@ pub mod encoding {
9696
};
9797
}
9898

99-
/// # The protocol used by the agents to send ad hoc messages to lanes on other agents.
99+
/// The protocol used by the agents to send ad hoc messages to lanes on other agents.
100100
///
101101
/// [`crate::AdHocCommand`] messages are sent by agents to the runtime to instruct it to send an ad hoc
102102
/// command to an arbitrary lane endpoint.
@@ -109,10 +109,6 @@ pub mod encoding {
109109

110110
/// # The protocol used by the runtime to communicate with stores.
111111
///
112-
/// TODO Non-transient lanes also implicitly contain a store. They should
113-
/// ultimately use the initialization component of this protocol. Currently,
114-
/// they have initialization messages built into the lane protocol.
115-
///
116112
/// There are two phases to the communication between the runtime and the agent.
117113
///
118114
/// 1. Initialization
@@ -135,6 +131,11 @@ pub mod encoding {
135131
/// 2. The store or land sends [`crate::StoreResponse`] messages each time its state
136132
/// changes which are persisted by the runtime.
137133
pub mod store {
134+
135+
// TODO Non-transient lanes also implicitly contain a store. They should
136+
// ultimately use the initialization component of this protocol. Currently,
137+
// they have initialization messages built into the lane protocol.
138+
138139
pub use crate::store::{
139140
MapStoreInitDecoder, MapStoreResponseEncoder, RawMapStoreInitDecoder,
140141
RawMapStoreInitEncoder, RawMapStoreResponseDecoder, RawValueStoreInitDecoder,

api/swimos_agent_protocol/src/model.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,42 +60,52 @@ impl<T> LaneResponse<T> {
6060
/// to describe alterations to the lane.
6161
#[derive(Copy, Clone, Debug, PartialEq, Eq, Form)]
6262
pub enum MapOperation<K, V> {
63+
/// Update the value associated with a key in the map (or insert an entry if they key does not exist).
6364
#[form(tag = "update")]
6465
Update {
6566
key: K,
6667
#[form(body)]
6768
value: V,
6869
},
70+
/// Remove an entry from the map, by key (does nothing if there is no such entry).
6971
#[form(tag = "remove")]
7072
Remove {
7173
#[form(header)]
7274
key: K,
7375
},
76+
/// Remove all entries in the map.
7477
#[form(tag = "clear")]
7578
Clear,
7679
}
7780

7881
/// Representation of map lane messages (used to form the body of Recon messages when operating)
7982
/// on downlinks. This extends [`MapOperation`] with `Take` (retain the first `n` items) and `Drop`
80-
/// (remove the first `n` items). We never use these internally but must support them for communicating
81-
/// with other implementations.
83+
/// (remove the first `n` items).
8284
#[derive(Copy, Clone, Debug, PartialEq, Eq, Form, Hash)]
8385
pub enum MapMessage<K, V> {
86+
/// Update the value associated with a key in the map (or insert an entry if they key does not exist).
8487
#[form(tag = "update")]
8588
Update {
8689
key: K,
8790
#[form(body)]
8891
value: V,
8992
},
93+
/// Remove an entry from the map, by key (does nothing if there is no such entry).
9094
#[form(tag = "remove")]
9195
Remove {
9296
#[form(header)]
9397
key: K,
9498
},
99+
/// Remove all entries in the map.
95100
#[form(tag = "clear")]
96101
Clear,
102+
/// Retain only the first `n` entries in the map, the remainder are removed. The ordering
103+
/// used to determine 'first' is the Recon order of the keys. If there are fewer than `n`
104+
/// entries in the map, this does nothing.
97105
#[form(tag = "take")]
98106
Take(#[form(header_body)] u64),
107+
/// Remove the first `n` entries in the map. The ordering used to determine 'first' is the
108+
/// Recon order of the keys. If there are fewer than `n` entries in the map, it is cleared.
99109
#[form(tag = "drop")]
100110
Drop(#[form(header_body)] u64),
101111
}
@@ -150,7 +160,8 @@ impl<S, T> AdHocCommand<S, T> {
150160
/// * `command` - The body of the command message.
151161
/// * `overwrite_permitted` - Controls the behaviour of command handling in the case of back-pressure.
152162
/// If this is true, the command maybe be overwritten by a subsequent command to the same target (and so
153-
/// will never be sent). If false, the command will be queued instead.
163+
/// will never be sent). If false, the command will be queued instead. This is a user specifiable parameter
164+
/// in the API.
154165
pub fn new(address: Address<S>, command: T, overwrite_permitted: bool) -> Self {
155166
AdHocCommand {
156167
address,

api/swimos_api/src/agent/lane/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#[cfg(test)]
16+
mod tests;
17+
1518
use std::{
1619
borrow::Borrow,
1720
fmt::{Display, Formatter},
@@ -72,7 +75,10 @@ impl WarpLaneKind {
7275

7376
pub fn uplink_kind(&self) -> UplinkKind {
7477
match self {
75-
WarpLaneKind::Map | WarpLaneKind::DemandMap | WarpLaneKind::JoinMap => UplinkKind::Map,
78+
WarpLaneKind::Map
79+
| WarpLaneKind::DemandMap
80+
| WarpLaneKind::JoinMap
81+
| WarpLaneKind::JoinValue => UplinkKind::Map,
7682
WarpLaneKind::Supply => UplinkKind::Supply,
7783
WarpLaneKind::Spatial => todo!("Spatial uplinks not supported."),
7884
_ => UplinkKind::Value,
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
use crate::agent::UplinkKind;
2+
3+
use super::WarpLaneKind;
4+
5+
// spatial lanes are omitted as they are unimplemented
6+
const LANE_KINDS: [WarpLaneKind; 8] = [
7+
WarpLaneKind::Command,
8+
WarpLaneKind::Demand,
9+
WarpLaneKind::DemandMap,
10+
WarpLaneKind::Map,
11+
WarpLaneKind::JoinMap,
12+
WarpLaneKind::JoinValue,
13+
WarpLaneKind::Supply,
14+
WarpLaneKind::Value,
15+
];
16+
17+
#[test]
18+
fn uplink_kinds() {
19+
for kind in LANE_KINDS {
20+
let uplink_kind = kind.uplink_kind();
21+
if kind.map_like() {
22+
assert_eq!(uplink_kind, UplinkKind::Map);
23+
} else if matches!(kind, WarpLaneKind::Supply) {
24+
assert_eq!(uplink_kind, UplinkKind::Supply);
25+
} else {
26+
assert_eq!(uplink_kind, UplinkKind::Value)
27+
}
28+
}
29+
}
30+
31+
// this is here for when spatial lanes are implemented as the test will no longer panic
32+
#[test]
33+
#[should_panic]
34+
fn spatial_uplink_kind() {
35+
WarpLaneKind::Spatial.uplink_kind();
36+
}

api/swimos_api/src/downlink/mod.rs

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)