Skip to content

How SubutaiTray works? [For Testers]

Alex O. Karasulu edited this page Mar 10, 2018 · 3 revisions

Bazaar

Every 20 seconds, tray gets the information about current user via REST API from bazaar.subutai.io. Following REST endpoints are used by SubutaiTray:

  1. To get info about Environments - https://bazaar.subutai.io/rest/v1/tray/environments
  2. To get info about Peers - https://bazaar.subutai.io/rest/v1/tray/my-peers

P2P

Every 15 seconds, tray checks if environments of a user is connected to swarm, if it is connected, then it checks the status of each Peer.

Following commands are used to check status:

  1. To check if the environment is connected to swarm:
    • p2p show gives the list of swarms
    • if the list contains the environment, then it is connected to swarm
  2. To check the status of Containers in Environment:
    • p2p show -hash some_hash -check resource_host_ip

SSHing into Container

Tray uses sockets to connect to the container by Resource Host IP and Port. If it can connect, then it makes the button for SSHing active. Same with EZ-Desktop, if tray can connect to host via sockets, then it makes button active.

Peers

Every 1 minutes, tray uses SSDP to find Resource hosts in a local network.

SSHing into Peer

And it uses libssh2 to check if provided credentials for a Peer are correct/