Sign inSign up

year4000/pycloud

By year4000

•Updated over 9 years ago

Dockerfile: https://github.com/Year4000/PyCloud/blob/master/Dockerfile

Image
0

1.0K

year4000/pycloud repository overview

⁠PyCloud

A python wrapper daemon that manages tmux sessions and provides a json control over the sessions with redis messaging channels.

⁠Installation and Updating

To install or update PyCloud it as simple of running pip3. Run the following command as root to get started.

⁠Daemon Script

When installing there is a daemon script that is a wrapper for the commands bellow.

⁠Running

In single session mode

python3 -m pycloud.app

In system daemon mode

python3 -m pycloud.app --daemon

⁠Redis Channels

  • year4000.pycloud.rank Used for internal tracking of servers
  • year4000.pycloud.create Used to create a node, the payload is a JSON string
  • year4000.pycloud.status Used to get the status a node, the payload is a JSON string
  • year4000.pycloud.remove Used to remove a node, the payload is a JSON string

⁠API Messaging Channel

PyCloud runs with Redis to trigger the creation of nodes from multiple servers all running PyCloud. A service can use publish a JSON string on the channels above and one of the instances will process it.

⁠Create
  • Request Channel year4000.pycloud.create
{
  "id": "RANDOMLY_GENERATED_BY_USER",
  "script": "SCRIPT TO RUN ON SERVER AFTER REQUEST IS RECEIVED"
}
  • Response Channel year4000.pycloud.create.RANDOMLY_GENERATED_BY_USER
{
  "cloud": "PYCLOUD_HASH",
  "id": "SESSION_HASH"
}
⁠Status / Remove

At this moment both Status and Remove calls are the same Request and Response but Status grabs the status while Remove removes the node.

  • Request Channel year4000.pycloud.status
  • Request Channel year4000.pycloud.remove
{
  "id": "RANDOMLY_GENERATED_BY_USER",
  "session": "SESSION_HASH"
}
  • Response Channel year4000.pycloud.status.RANDOMLY_GENERATED_BY_USER
  • Response Channel year4000.pycloud.remove.RANDOMLY_GENERATED_BY_USER
{
  "cloud": "PYCLOUD_HASH",
  "id": "SESSION_HASH",
  "status": true
}

Tag summary

Content type

Image

Digest

Size

260.7 MB

Last updated

over 9 years ago

docker pull year4000/pycloud