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

Add server abstraction #30

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Add server abstraction #30

wants to merge 11 commits into from

Conversation

darnfish
Copy link
Contributor

This new feature now adds an abstraction between a VM instance and a Portal

  • A portal is now a link from a Room to a VM instance (the repo name for a VM is still @cryb/portal)
  • A server is a running VM instance

Here's how the flow of things works now:

  • A server connects to @cryb/portals over WebSocket and verifies itself using a signed JWT token with a common secret
  • Portals then created a DB entry in both Mongo and Redis for the server. This DB entry is destroyed when the server disconnects
  • When a server connects over WS, a check is made to see if there is a Portal that needs to be assigned a server. If there is, the server is automatically assigned.
  • When a portal is requested by @cryb/api, a check is made to see if there is a server/VM available. If there is, it's automatically assigned.

This change comes with some major benefits:

  • We won't have to worry about --portalId anymore as that's handled automatically.
  • Hopefully there won't be any repeat NoPortalFound errors

There's also an option to dynamically spawn VM instances to be added to the pool when Portals runs out of instances that are currently connected. This will use the Driver format.

Let me know what you think! There are several other pull requests in the following repositories which need to be merged at the same time as this PR:

  • @cryb/api
  • @cryb/portal
  • @cryb/aperture

@darnfish
Copy link
Contributor Author

darnfish commented Oct 22, 2019

Here's a to-do list of things to do before this can be merged:

  • Add support for dynamic VMs
  • Add separate model for deployed VMs on cloud services
  • Add reset command support

I'll add to this if anything else pops into mind

@JeDaYoshi JeDaYoshi self-assigned this Oct 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants