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 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
27 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
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
10 changes: 8 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,14 @@ jobs:

- name: Smoke test - write_read
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 &"

# 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 && echo "1234" | hc s --piped -f 8888 run &"
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
Expand Down Expand Up @@ -245,4 +251,4 @@ jobs:
with:
name: scenario-bundles
if-no-files-found: error
path: dist/*
path: dist/*
c12i marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions conductor-config-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ network:
- type: webrtc
signal_url: "ws://localhost:4423"
bootstrap_service: "http://localhost:4422"
# chc_url: "http://localhost:8181"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are we going to do about needing different config for some scenarios?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the embed_conductor_config function might need to be refactored slightly, it should return a type rather than the yaml in the form of a string, so that values can be mutated by scenarios that need custom conductor config different from the one in the yaml files.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the scenario modifying the config. We want to be able to run scenarios with different config. In this case that means we want to run with CHC on and off. We don't then want to be modifying the scenario code to run in different environments etc.

What would be really nice is if you could provide a conductor configuration "overlay". So the embed_conductor_config would load a base configuration then at runtime you could configure which overlay to load. It might make sense to merge those as conductor configuration objects rather than yaml.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I am late, got distracted with other work

I'm not sure about the scenario modifying the config. We want to be able to run scenarios with different config. In this case that means we want to run with CHC on and off. We don't then want to be modifying the scenario code to run in different environments etc.

I see what you mean, what would a good compromise be? perhaps having -chcvariants of the existing yaml configs, not the cleanest approach.

Or rather than reading from the conductor config files, we programmatically build the conductor configs from the scenario, with an env var i.e CHC_ENABLED determining whether a chc_url should be set.

I am open to discuss this further

Copy link
Member

@ThetaSinner ThetaSinner Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I'm talking about overlays, I mean this kind concept -> https://carvel.dev/ytt/

Not necessarily that tool but something along those lines. So we could have a with-chc.yaml and a with-dpki.yaml that we can choose to load.

I think choosing to load that with an environment variable like CHC_ENABLED is good. So the current macro can load all the config files and embed them. Then we can choose at runtime which ones we merge with the base conductor config.

I know that YAML merging is a bit of a pain in general but if it's purely additive for now, then it shouldn't be so bad I hope.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, would the contents of the with-chc.yaml and with-dpki.yaml only contain the CHC and DPKI configurations?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly that, they'd just bring in the piece that they configure. So we might do other things the same way, like different tunings of the network or the conductor itself.

We probably couldn't easily guarantee that a given combination of overlays makes sense but I'm okay with leaving that up to the user for now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. The only question I have now is how to run scenarios with CHC enabled via trycp. I believe the holoports would need to have the reference implementation running?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to deploy somewhere that the HoloPorts can see yes. We have a couple of servers but nowhere ideal really. I think this might need to be a question we ask to techops

1 change: 1 addition & 0 deletions conductor-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ network:
- type: webrtc
signal_url: "wss://sbd.holo.host"
bootstrap_service: "https://bootstrap.holo.host"
# chc_url: "http://localhost:8181"
56 changes: 43 additions & 13 deletions flake.lock

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

14 changes: 14 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
flake-parts.follows = "flake-parts";
crane.follows = "crane";
rust-overlay.follows = "rust-overlay";
# TODO: Revert when new release of holochain is made with updated hc-sandbox cli
holochain.url = "github:holochain/holochain?ref=develop";
c12i marked this conversation as resolved.
Show resolved Hide resolved
};
};

Expand All @@ -25,6 +27,16 @@
};
};

chc-service = {
url = "github:holochain/hc-chc-service";
inputs = {
nixpkgs.follows = "nixpkgs";
crane.follows = "crane";
rust-overlay.follows = "rust-overlay";
holonix.follows = "holonix";
};
};

crane = {
url = "github:ipetkov/crane";
};
Expand Down Expand Up @@ -81,6 +93,7 @@
inputs'.holonix.packages.hn-introspect
inputs'.holonix.packages.rust
inputs'.tryorama.packages.trycp-server
inputs'.chc-service.packages.hc-chc-service
inputs'.amber.packages.default
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.Security
Expand All @@ -105,6 +118,7 @@
inputs'.holonix.packages.holochain
inputs'.holonix.packages.lair-keystore
inputs'.tryorama.packages.trycp-server
inputs'.chc-service.packages.hc-chc-service
];
};

Expand Down