Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remote-signal scenario #93

Merged
merged 18 commits into from
Oct 23, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/performance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
fail-fast: false
matrix:
# To run a test with TryCP and default configuration, add the scenario name to this array.
scenario: [trycp_write_validated, remote_call_rate, validation_receipts]
scenario: [trycp_write_validated, remote_call_rate, validation_receipts, remote_signal_scenario]
# To run a test with TryCP and additional configuration, add the scenario name and `extra-args` as an `include` item.
include:
- scenario: two_party_countersigning
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,23 @@ jobs:
# Stop local network services
pkill hc-run-local

- name: Smoke test - remote_signals
run: |
set -x

# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"

# Run the scenario for 10 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#remote_signals -- --targets targets-ci.yaml --instances-per-target 2 --duration 10 --no-progress

# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local

- name: Build scenario bundles
if: runner.os == 'Linux'
run: |
Expand Down
30 changes: 30 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ members = [
"scenarios/write_query",
"scenarios/local_signals",
"scenarios/remote_call_rate",
"scenarios/remote_signals",
"scenarios/two_party_countersigning",
"scenarios/write_validated",
"scenarios/trycp_write_validated",
Expand All @@ -38,6 +39,8 @@ members = [
"zomes/signal/coordinator",
"zomes/remote_call/coordinator",
"zomes/remote_call/integrity",
"zomes/remote_signal/coordinator",
"zomes/remote_signal/integrity",
"zomes/countersigning/coordinator",
"zomes/countersigning/integrity",
"zomes/validated/coordinator",
Expand Down Expand Up @@ -126,6 +129,7 @@ crud_integrity = { path = "./zomes/crud/integrity" }
timed_integrity = { path = "./zomes/timed/integrity" }
callback_integrity = { path = "./zomes/callback/integrity" }
remote_call_integrity = { path = "./zomes/remote_call/integrity" }
remote_signal_integrity = { path = "./zomes/remote_signal/integrity" }
countersigning_integrity = { path = "./zomes/countersigning/integrity" }
validated_integrity = { path = "./zomes/validated/integrity" }

Expand Down
1 change: 1 addition & 0 deletions influx/templates/dashboards/remote_signal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"apiVersion":"influxdata.com/v2alpha1","kind":"Dashboard","metadata":{"name":"gallant-joliot-8be001"},"spec":{"charts":[{"colors":[{"id":"base","name":"white","type":"text","hex":"#ffffff"}],"decimalPlaces":0,"height":3,"kind":"Single_Stat","name":"Success Count","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.remote_signal_round_trip\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> count(column: \"_value\")"}],"staticLegend":{},"width":2},{"colors":[{"id":"base","name":"white","type":"text","hex":"#ffffff"},{"id":"agKfMu_fMEWQsV8VtYmRf","name":"curacao","type":"text","hex":"#F95F53","value":1}],"decimalPlaces":0,"height":2,"kind":"Single_Stat","name":"Timeout Count","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.remote_signal_timeout\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)\n |> count(column: \"_value\")"}],"staticLegend":{},"width":2,"yPos":3},{"axes":[{"base":"10","name":"x","scale":"linear"},{"base":"10","name":"y","scale":"linear","suffix":"s"}],"colorizeRows":true,"colors":[{"id":"_Kmy96ivvq5r-WIXSWlbf","name":"Color Blind Friendly - Light","type":"scale","hex":"#FFFFFF"},{"id":"UiMejor0obvfbXb0AJbtx","name":"Color Blind Friendly - Light","type":"scale","hex":"#E69F00"},{"id":"5KdcJZm9RmEAzTwiCK5YO","name":"Color Blind Friendly - Light","type":"scale","hex":"#56B4E9"},{"id":"-9T14uII1D1erm2GvaEwg","name":"Color Blind Friendly - Light","type":"scale","hex":"#009E73"},{"id":"9lIv9GdoZ4ZJbY8nKFApd","name":"Color Blind Friendly - Light","type":"scale","hex":"#F0E442"},{"id":"wLB0idDKVNOPS6JgvBnvf","name":"Color Blind Friendly - Light","type":"scale","hex":"#0072B2"},{"id":"6rwjjsXeoPNK9_w9zF2Si","name":"Color Blind Friendly - Light","type":"scale","hex":"#D55E00"},{"id":"vNX9d5I38kAbXAOxngj_G","name":"Color Blind Friendly - Light","type":"scale","hex":"#CC79A7"}],"geom":"line","height":3,"hoverDimension":"auto","kind":"Xy","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Round Trip Time","opacity":1,"orientationThreshold":100000000,"position":"overlaid","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.remote_signal_round_trip\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)"}],"staticLegend":{"colorizeRows":true,"opacity":1,"orientationThreshold":100000000,"widthRatio":1},"width":10,"widthRatio":1,"xCol":"_time","xPos":2,"yCol":"_value"},{"axes":[{"name":"x"},{"name":"y"}],"colors":[{"hex":"#FFFFFF"},{"hex":"#E69F00"},{"hex":"#56B4E9"},{"hex":"#009E73"},{"hex":"#F0E442"},{"hex":"#0072B2"},{"hex":"#D55E00"},{"hex":"#CC79A7"}],"height":2,"kind":"Scatter","legendColorizeRows":true,"legendOpacity":1,"legendOrientationThreshold":100000000,"name":"Timeouts","queries":[{"query":"from(bucket: \"windtunnel\")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r[\"_measurement\"] == \"wt.custom.remote_signal_timeout\")\n |> filter(fn: (r) => r[\"run_id\"] == v.RunId)"}],"staticLegend":{},"width":10,"xCol":"_time","xPos":2,"yCol":"_value","yPos":3}],"name":"Remote Signal"}}]
29 changes: 29 additions & 0 deletions scenarios/remote_signals/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "remote_signals"
version = "0.1.0"
edition = "2021"
build = "../scenario_build.rs"

[dependencies]
anyhow = { workspace = true }
tokio = { workspace = true }
rand = { workspace = true }
log = { workspace = true }

holochain_types = { workspace = true }
trycp_wind_tunnel_runner = { workspace = true }
remote_signal_integrity = { workspace = true }

[build-dependencies]
happ_builder = { workspace = true }

[lints]
workspace = true

[package.metadata.required-dna]
name = "remote_signal"
zomes = ["remote_signal"]

[package.metadata.required-happ]
name = "remote_signal"
dnas = ["remote_signal"]
47 changes: 47 additions & 0 deletions scenarios/remote_signals/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## remote_signals

### Description

This scenario tests the throughput of `remote_signals` operations.
cdunster marked this conversation as resolved.
Show resolved Hide resolved

Two environment variables can further control this scenario:

- `SIGNAL_INTERVAL_MS` - the interval (in ms) per node at which to publish origin signals (defaults to 1000, or 1 signal every second)
- `RESPONSE_TIMEOUT_MS` - the interval (in ms) at which we will stop waiting for a response signal and record a `remote_signal_timeout` metric (see below).

Two custom metrics are recorded:

- `wt.custom.remote_signal_round_trip`: The time in floating-point seconds from origin signal dispatch to origin receive of the remote side's response signal.
- `wt.custom.remote_signal_timeout`: A counter (value 1) recorded every time there is a timeout waiting for the response signal. (Defaults to 20 seconds--see above)

> [!WARNING]
> This is a TryCP-based scenario and needs to be run differently to other scenarios.

### Waiting for peer discovery

This scenario reads the environment variable `MIN_PEERS` and waits for at least that many peers to be available before
starting the agent behaviour. It will wait up to two minutes then proceed regardless.

The scenario is not able to check that you have configured more peers than the minimum you have set, so you should
ensure that you have configured enough peers to meet the minimum.

Note that the number of peers seen by each node includes itself. So having two nodes means that each node will
immediately see one peer after app installation.

This configuration defaults to 2 peers.

### Suggested command

You can run the scenario locally with the following command:

```bash
RUST_LOG=info CONDUCTOR_CONFIG="CI" TRYCP_RUST_LOG="info" MIN_PEERS=2 cargo run --package remote_signals -- --targets targets-ci.yaml --instances-per-target 2 --duration 300
```

This assumes that `trycp_server` is running. See the script `scripts/trycp.sh` and run with `start_trycp`.

To run the scenario against the current target list, you can run:

```bash
RUST_LOG=info MIN_PEERS=40 cargo run --package remote_signal_scenario -- --targets targets.yaml --duration 500
```
Loading