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

dmsg hypervisor #563

Open
wants to merge 22 commits into
base: mainnet-milestone2
Choose a base branch
from

Conversation

ivcosla
Copy link

@ivcosla ivcosla commented Sep 6, 2019

Working state, integration tests are working, but hypervisor tests need fix.

@ivcosla
Copy link
Author

ivcosla commented Sep 6, 2019

Closes #560

Copy link

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

Good start.

pkg/hypervisor/config.go Outdated Show resolved Hide resolved
Evan Lin added 5 commits September 9, 2019 01:59
* Reserving route IDs and adding rules to visors is now split into two communication steps.
* Improved readability and testability of the setup procedure but splitting responsibilities to additional structures; setup.idReservoir, setup.RulesMap
* Improved logging for setup procedure.
* Slightly tweaked setup.Protocol to accommodate aforementioned changes.
This was removed for some reason, but it needs to exist in order to reestablish transports on visor restart.
…sports

Re-added initTransports for transport.Manager
pkg/hypervisor/hypervisor.go Outdated Show resolved Hide resolved
@evanlinjin
Copy link

Btw, will be good if you can provide steps of how this can be tested.

@ivcosla
Copy link
Author

ivcosla commented Sep 9, 2019

This can be tested with skywire-services on feature/dmsg-hypervisor branch. Then:

  1. make integration-build
  2. make integration-run-generic

From now on you can test the hypervisor API, for example you can curl localhost:8080/api/nodes

@ivcosla
Copy link
Author

ivcosla commented Sep 9, 2019

Note however that by removing noise.RPCClientDialers now there is no retrial in the Dial operation between visor and hypervisor. It could be added if deemed necessary in line https://github.com/skycoin/skywire/pull/563/files#diff-8b79394cd85c849e746408355107d3b6R241 using an netutil.Retrier.

@ivcosla ivcosla changed the title [WIP] dmsg hypervisor dmsg hypervisor Sep 9, 2019
Copy link

@evanlinjin evanlinjin left a comment

Choose a reason for hiding this comment

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

Note however that by removing noise.RPCClientDialers now there is no retrial in the Dial operation between visor and hypervisor. It could be added if deemed necessary in line https://github.com/skycoin/skywire/pull/563/files#diff-8b79394cd85c849e746408355107d3b6R241 using an netutil.Retrier.

Yes, we will need retry logic. Please implement.

cmd/hypervisor/commands/root.go Outdated Show resolved Hide resolved
@evanlinjin
Copy link

make integration-build

Where is the endpoint documentation kept? Are we still updating this Postman file?

https://github.com/skycoin/skywire/blob/mainnet-milestone2/cmd/hypervisor/hypervisor.postman_collection.json

@ivcosla
Copy link
Author

ivcosla commented Sep 10, 2019

make integration-build

Where is the endpoint documentation kept? Are we still updating this Postman file?

https://github.com/skycoin/skywire/blob/mainnet-milestone2/cmd/hypervisor/hypervisor.postman_collection.json

I didn't update it, will do it as part of the requested changes.

var conn net.Conn
var err error

err = retrier.Do(func() error {

Choose a reason for hiding this comment

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

The redial logic here is not the same as what we had previously in:
https://github.com/skycoin/dmsg/blob/70f4c32a994fe7fa62c36049e3ce46d0dc5c8c20/noise/net.go#L55-L77

Please fix.

Choose a reason for hiding this comment

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

To elaborate, if something breaks during rpc communication, we want to redial.

Choose a reason for hiding this comment

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

To elaborate further, if hypervisor restarts, visor should be able to reconnect automatically to the hypervisor.

@evanlinjin
Copy link

evanlinjin commented Sep 11, 2019

@ivcosla Just gave it a test run and it is working very well. Please fix the last request, thank you.

for {
if err := d.establishConn(); err != nil {
// Only return if not network error.
if err != dmsg.ErrRequestRejected {
Copy link
Author

Choose a reason for hiding this comment

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

Similar to *noise.RPCClientDialer check for net.Error type assertion here I think it would be useful to group all of dmsg network errors under a custom error type. Or at least those that we consider meaningful for checking outside the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants