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

Run scenarios with CHC enabled #92

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9d851bf
add chc-service nix package
c12i Aug 28, 2024
4ab6425
nix flake update
c12i Aug 29, 2024
8a58cbb
update holonix
c12i Sep 6, 2024
230fa4f
initial scenario setup
c12i Sep 6, 2024
5a28705
nix flake update
c12i Sep 9, 2024
8505e06
nix flake update
c12i Sep 11, 2024
3a51e5f
update conductor config
c12i Sep 11, 2024
5438ca5
update ci workflow
c12i Sep 11, 2024
a704319
update ci nixpkgs
c12i Sep 11, 2024
32f4077
add script to run sandbox conductor and chc service concurrently
c12i Sep 12, 2024
9287afb
run run.sh as a background process in ci
c12i Sep 12, 2024
ecbb71b
fix CI; only start chc service on write_read scenario
c12i Sep 16, 2024
7665694
wait for CHC service to be available before running sandbox
c12i Sep 16, 2024
0e098b4
split write_read scenarios
c12i Sep 17, 2024
d4e1cd8
revert inadvertedly removed newlines at the end of file
c12i Sep 17, 2024
6301aec
remove commented out chc_url from conductor config yaml files
c12i Sep 17, 2024
b550110
remove overridden holochain flake input
c12i Sep 17, 2024
96b0635
revert newlines in conductor config yaml file
c12i Sep 17, 2024
e145c02
run more scenarios with CHC enabled
c12i Sep 19, 2024
218d62b
Merge remote-tracking branch 'holochain/main' into holochain-chc-perf…
c12i Sep 19, 2024
21300d9
derive a with-chc conductor config and embed conditionally to base co…
c12i Sep 25, 2024
bc11dfb
Merge remote-tracking branch 'holochain/main' into holochain-chc-perf…
c12i Sep 26, 2024
adedffb
update workspace.nix
c12i Sep 26, 2024
7e0f152
Merge remote-tracking branch 'holochain/main' into holochain-chc-perf…
c12i Oct 29, 2024
6f84ccb
Remove some CHC test runs
c12i Oct 29, 2024
2a25434
Clean up embed_conductor_config
c12i Oct 29, 2024
c720e1b
Fix fmt
c12i Oct 29, 2024
b243b05
Fix nonCargoBuildFiles
c12i Oct 30, 2024
8c28d97
Update conductor-config
c12i Oct 31, 2024
a53b456
Enable the chc feature on holochain
c12i Oct 31, 2024
1ca424f
Merge remote-tracking branch 'holochain/main' into holochain-chc-perf…
c12i Oct 31, 2024
ade10a4
Add instruction for running the CHC service in the README
c12i Oct 31, 2024
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
197 changes: 185 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "test"

on:
push:
branches: [ main, develop ]
branches: [main, develop]
pull_request:
branches: [ main, develop ]
branches: [main, develop]
merge_group:

concurrency:
Expand All @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -26,10 +26,10 @@ jobs:
if: runner.os == 'Linux'
uses: AdityaGarg8/remove-unwanted-software@v2
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
remove-dotnet: "true"
remove-android: "true"
remove-codeql: "true"
remove-docker-images: "true"

- name: Install nix
uses: cachix/install-nix-action@v27
Expand Down Expand Up @@ -74,20 +74,47 @@ jobs:
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"

# Run the scenario for 5 seconds
RUST_LOG=info nix run .#zome_call_single_value -- --connection-string ws://localhost:8888 --duration 5 --no-progress


pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - zome_call_single_value with CHC enabled
c12i marked this conversation as resolved.
Show resolved Hide resolved
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"

# TODO using `localhost` is resolving to an IPv6 address, but why is that giving a connection refused?
# Run the scenario for 5 seconds
RUST_LOG=info nix run .#zome_call_single_value -- --connection-string ws://localhost:8888 --duration 5 --no-progress

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - single_write_many_read
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"

# Run the scenario for 5 seconds
RUST_LOG=info nix run .#single_write_many_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress


pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - single_write_many_read with CHC enabled
c12i marked this conversation as resolved.
Show resolved Hide resolved
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"

# Run the scenario for 5 seconds
RUST_LOG=info nix run .#single_write_many_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - dht_sync_lag
Expand All @@ -100,6 +127,19 @@ jobs:

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - dht_sync_lag with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"

# Run the scenario for 5 seconds
RUST_LOG=info nix run .#dht_sync_lag -- --connection-string ws://localhost:8888 --agents 2 --behaviour write:1 --behaviour record_lag:1 --duration 5 --no-progress

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - app_install
run: |
# Start a sandbox conductor and run it in the background
Expand Down Expand Up @@ -130,6 +170,22 @@ jobs:

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - write_read with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# wait for the CHC service to be available
sleep 2

# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"

# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - write_query
run: |
# Start a sandbox conductor and run it in the background
Expand All @@ -140,6 +196,19 @@ jobs:

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - write_query with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"

# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_query -- --connection-string ws://localhost:8888 --duration 5 --no-progress

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - local_signals
run: |
# Start a sandbox conductor and run it in the background
Expand All @@ -150,6 +219,19 @@ jobs:

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - local_signals with CHC enabled
c12i marked this conversation as resolved.
Show resolved Hide resolved
run: |
# start the chc reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"

# Run the scenario for 5 seconds
RUST_LOG=info nix run .#local_signals -- --connection-string ws://localhost:8888 --duration 5 --no-progress

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - write_validated
run: |
# Start a sandbox conductor and run it in the background
Expand All @@ -160,6 +242,19 @@ jobs:

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - write_validated with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create --chc-url http://localhost:8181 && echo "1234" | hc s --piped -f 8888 run &"

# Run the scenario for 5 seconds
RUST_LOG=info nix run .#write_validated -- --connection-string ws://localhost:8888 --duration 5 --no-progress

pkill hc && pkill holochain && pkill lair-keystore

- name: Smoke test - trycp_write_validated
run: |
set -x
Expand All @@ -177,10 +272,30 @@ jobs:
# Stop local network services
pkill hc-run-local

- name: Smoke test - trycp_write_validated with CHC enabled
run: |
set -x

# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"
c12i marked this conversation as resolved.
Show resolved Hide resolved

# 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" CHC_ENABLED="1" MIN_PEERS=2 nix run .#trycp_write_validated -- --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: Smoke test - remote_call_rate
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
Expand All @@ -194,6 +309,26 @@ jobs:
# Stop local network services
pkill hc-run-local

- name: Smoke test - remote_call_rate with CHC enabled
c12i marked this conversation as resolved.
Show resolved Hide resolved
run: |
set -x

# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# 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" CHC_ENABLED="1" MIN_PEERS=2 nix run .#remote_call_rate -- --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: Smoke test - two_party_countersigning
run: |
# Start local network services
Expand All @@ -209,6 +344,24 @@ jobs:
# Stop local network services
pkill hc-run-local

- name: Smoke test - two_party_countersigning with CHC enabled
run: |
# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# 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" CHC_ENABLED="1" MIN_PEERS=2 nix run .#two_party_countersigning -- --targets targets-ci.yaml --behaviour initiate:1 --behaviour participate:1 --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: Smoke test - validation_receipts
run: |
set -x
Expand All @@ -226,6 +379,26 @@ jobs:
# Stop local network services
pkill hc-run-local

- name: Smoke test - validation_receipts with CHC enabled
run: |
set -x

# start the CHC reference implementation service
nix develop .#ci -c bash -c "hc-chc-service --port 8181 &"

# 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" CHC_ENABLED="1" MIN_PEERS=2 nix run .#validation_receipts -- --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
31 changes: 26 additions & 5 deletions bindings/trycp_runner/src/macros.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
#[macro_export]
macro_rules! embed_conductor_config {
() => {
fn conductor_config() -> &'static str {
static CONDUCTOR_CONFIG: &str = include_str!("../../../conductor-config.yaml");
static CONDUCTOR_CONFIG_CI: &str = include_str!("../../../conductor-config-ci.yaml");
fn conductor_config() -> String {
static BASE_CONDUCTOR_CONFIG: &str =
include_str!("../../../conductor-config/conductor-config.yaml");
static BASE_CONDUCTOR_CONFIG_CI: &str =
include_str!("../../../conductor-config/conductor-config-ci.yaml");

static CHC_CONDUCTOR_CONFIG: &str =
include_str!("../../../conductor-config/with_chc.yaml");

match std::env::var("CONDUCTOR_CONFIG") {
Ok(value) if value == "CI" => CONDUCTOR_CONFIG_CI,
_ => CONDUCTOR_CONFIG,
Ok(value) if value == "CI" => {
if std::env::var("CHC_ENABLED")
c12i marked this conversation as resolved.
Show resolved Hide resolved
.map(|v| v == "1")
.unwrap_or(false)
{
return format!("{}\n{}", BASE_CONDUCTOR_CONFIG_CI, CHC_CONDUCTOR_CONFIG);
}
BASE_CONDUCTOR_CONFIG_CI.into()
}
_ => {
if std::env::var("CHC_ENABLED")
.map(|v| v == "1")
.unwrap_or(false)
{
return format!("{}\n{}", BASE_CONDUCTOR_CONFIG, CHC_CONDUCTOR_CONFIG);
}
BASE_CONDUCTOR_CONFIG.into()
}
}
}
};
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions conductor-config/with_chc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
chc_url: http://localhost:8181
Loading