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

Fix/web ui terminal hypervisor #612

Merged

Conversation

i-hate-nicknames
Copy link
Contributor

Did you run make format && make check?
yes

Fixes #605

Changes:

How to test this PR:
Go to hypervisor web api, select hypervisor in the list of visors, click actions button at the top right and select Terminal/Full Terminal

The issue with terminal in hypervisor had most likely appeared after merging visor and hypervisors under the same entity. Previously, hypervisor would connect to visors using dmesg. There is a package for that, called dmesgpty that offers exposing pty (pseudo terminal) over dmsg transport.

I played around for a while trying to create a pty locally and just serve it over websockets to the client, but it proved to be more architecturally difficult than I originally anticipated.

In this implementation I simply allowed a visor to connect to itself and created a dmsg pty at hypervisor start. This way it minimizes changes to the code (and therefore the risk introducing bugs), as well as no increase in the overall complexity.

On the other hand, we make from a node to itself over dmsg, which obviously is redundant. What are the shortcomings of this approach? Terminal interaction seems to me lightweight (infrequent request-response of small amount text). Could there be use-cases in which this would cause performance issues?

Additionally, I bumped creack/pty to 1.1.11, as the older version had a bug that didn't allow using the terminal.

Copy link
Member

@jdknives jdknives left a comment

Choose a reason for hiding this comment

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

Works. Code looks fine to me. But please fix linter. Good job!

@jdknives
Copy link
Member

@i-hate-nicknames regarding potential downsides of using pty over dmsg:

  • we do not use the pty too frequently and do not send an excessive amount of data over it

therefore the only downside which I can see is the inability of the visor to manage itself over dmsgpty when dmsg is unavailable. But in this case the user might as well use the local terminal. Because of this possibility, I actually think it is rather rare that a user would use the hypervisor UI for the hypervisor itself. But I would like to keep this option just to be consistent.

Copy link
Contributor

@Darkren Darkren left a comment

Choose a reason for hiding this comment

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

Great job!

@Darkren
Copy link
Contributor

Darkren commented Nov 23, 2020

@i-hate-nicknames @jdknives the only problem is that build keeps failing

@i-hate-nicknames i-hate-nicknames force-pushed the fix/web-ui-terminal-hypervisor branch from 9762a8c to 9fe7e97 Compare November 23, 2020 12:09
@jdknives jdknives merged commit 1d37a97 into skycoin:develop Nov 23, 2020
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.

3 participants