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

sim2h client in hc #1991

Merged
merged 22 commits into from Dec 22, 2019
Merged

sim2h client in hc #1991

merged 22 commits into from Dec 22, 2019

Conversation

@zippy
Copy link
Member

zippy commented Dec 18, 2019

PR summary

Adds commands to hc that we can use to connect to a sim2h server to get its health status.

testing/benchmarking notes

( if any manual testing or benchmarking was/should be done, add notes and/or screenshots here )

this needs to be tested manually atm

sim2h_client

  • in one tab run hc-sim2h-server-install && sim2h_server -p 3000
  • in another tab run hc-cli-install then:
[nix-shell:~/holochain-rust]$ hc sim2h-client -u wss://localhost:3000
url: wss://localhost:3000
message: ping
connecting to: wss://127.0.0.1:3000/
Generated agent id: HcSCiFa3hPh5Ikxnfn4c9Cmq5wjAPddzvGWcFC6kH3Jus6qo7SA6s65Dbvn3xoz
Pong

[nix-shell:~/holochain-rust]$ hc sim2h-client -u wss://localhost:3000 -m status
url: wss://localhost:3000
message: status
connecting to: wss://127.0.0.1:3000/
Generated agent id: HcSCjVagJyrrcvvdgxd8eIbfIp35o3tnren5j5k6ONc5qo7yGc7F7xoSUDpgw5r
StatusResponse(StatusData { spaces: 0, connections: 1 })

[nix-shell:~/holochain-rust]$ hc sim2h-client -u wss://localhost:3000 -m ping
url: wss://localhost:3000
message: ping
connecting to: wss://127.0.0.1:3000/
Generated agent id: HcScIY5J85FMHH4eztyWbkbHx9sb6gnftXC4Rb3kMXqbpta7UaFOkzFf7ve57ir
Pong

followups

( any new tickets/concerns that were discovered or created during this work but aren't in scope for review here )

changelog

  • if this is a code change that effects some consumer (e.g. zome developers) of holochain core, then it has been added to our between-release changelog with the format
- summary of change [PR#1234](https://github.com/holochain/holochain-rust/pull/1234)

documentation

zippy added 8 commits Dec 18, 2019
wip
fmt
fmt
@zippy zippy marked this pull request as ready for review Dec 18, 2019
zippy and others added 2 commits Dec 18, 2019
@zippy zippy requested review from neonphog and thedavidmeister Dec 18, 2019
@Connoropolous

This comment has been minimized.

Copy link
Collaborator

Connoropolous commented Dec 18, 2019

what does this do @zippy ?

@zippy

This comment has been minimized.

Copy link
Member Author

zippy commented Dec 19, 2019

what does this do @zippy ?

We want a tiny binary that we can run in a cron-job so that we can confirm that a sim2h server is working and accepting connections, and thus if it fails we can restart the sim2h server.

@@ -0,0 +1,187 @@
//! `cargo run --bin sim2h_admin -- --help`

This comment has been minimized.

Copy link
@thedavidmeister

thedavidmeister Dec 19, 2019

Contributor

🤔 adding more binaries adds more ops works, e.g. we now need to get this building and QA'd cross-platform and see if it has any shared dependencies/libs that need to be on people's machines and might need to add it to dockers and need to roll it into a dist/release process that checks shas in holonix, and need to document how people can interact with it without holonix, etc. (e.g. @samcooley chasing up a live sim2h server box going down recently)...

is there a viable "light touch" approach here, e.g. a bash script in holonix that could suffice for a simple web socket health check?

This comment has been minimized.

Copy link
@thedavidmeister

thedavidmeister Dec 19, 2019

Contributor

or alternatively, could this be implemented as a hc command?

This comment has been minimized.

Copy link
@zippy

zippy Dec 20, 2019

Author Member

yes, lets' move this to hc, that's great. I've updated the PR title.

@zippy zippy changed the title sim2h admin binary WIP: sim2h admin Dec 20, 2019
thedavidmeister and others added 5 commits Dec 20, 2019
fmt
@zippy

This comment has been minimized.

Copy link
Member Author

zippy commented Dec 20, 2019

Nice @thedavidmeister. I updated the timeout to 1 second after watching it fail when connecting to a live busy server...

@zippy zippy requested a review from thedavidmeister Dec 20, 2019
@thedavidmeister thedavidmeister changed the title WIP: sim2h admin sim2h client in hc Dec 21, 2019
@zippy zippy merged commit ad61928 into develop Dec 22, 2019
7 checks passed
7 checks passed
ci/circleci: app-spec-tests-sim2h Your tests passed on CircleCI!
Details
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: cli-tests Your tests passed on CircleCI!
Details
ci/circleci: cluster-tests Your tests passed on CircleCI!
Details
ci/circleci: fmt Your tests passed on CircleCI!
Details
ci/circleci: stress-tests-sim2h Your tests passed on CircleCI!
Details
ci/circleci: wasm-conductor-tests Your tests passed on CircleCI!
Details
@zippy zippy deleted the sim2h-admin branch Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.