OpenNode Management Service
OpenNode Management Service (OMS) is a modular framework for creating management applications. Its initial target was hosting the OMS Knot cloud management platform.
OMS main documentation is generated and can be viewed online.
Currently the only requirements are Python 2.7, its headers, GCC and GNU Make.
Mac OS X
- Install Python 2.7 in one of the ways:
sudo port install python27
brew install python
On Ubuntu Python 2.7 is shipped out of the box, so no installation is needed.
To work-around version incompatibility between system-wide setuptools and the one needed for buildout, virtualenv is needed. This work-around, though, results in a warning
BROKEN_DASH_S_WARNING each time a script in
bin/ is run. It can be safely ignored.
Install build tools:
sudo apt-get install --yes g++ make
Install Python headers:
sudo apt-get install --yes python-dev
sudo apt-get install --yes python-virtualenv
Get the code:
git clone email@example.com:opennode/opennode-management.git cd opennode-management
python bootstrap.py -v 1.7.0
virtualenv --setuptools venv venv/bin/pip install setuptools==1.3 venv/bin/python bootstrap.py -v 1.7.0
Restrict access to Python egg cache to avoid future warnings:
chmod go-rwx -R $HOME/.python-eggs
Note: Steps 2 and 3 may fail with timeout error. It happens due to heavy load on PyPi package repository. It is safe to repeat the failed command once again.
Note: Steps 1, 2 and 4 must be done only once. The 3rd one must be done each time
buildout.cfg gets changed.
Setup user accounts with the
bin/omspasswd -g admins -a john bin/omspasswd -g users -a jane
Start OpenNode Management Service:
It should be possible to log into OMS shell using credentials specified in 1st step:
ssh -l john localhost -p 6022
You can quickly enable plugins by adding the plugin buildout snippet to the
eggnest dir, e.g:
bin/plugin install opennode.oms.onc
This will download the published egg for the plugin. If you want to use a development plugin you have to specify the plugin checkout:
bin/plugin install opennode.oms.knot -d ../opennode-knot
During development, you can use the autoreload mode with
If you make changes in the dependencies, just rerun
You can use
bin/buildout -o to avoid waiting for the network, if you already have the eggs in the cache.
You can get a python prompt with the correct python path with
High level architecture
The core consists of:
These are mostly ORM backed and some transient classes which contain CRUD and most of the domain logic.
Mapping of URIs/paths to model objects, i.e. /datacentres/123/computes/9 -> .
Interaction layers a.k.a endpoints (in Twisted terminology):
This is a thin layer that takes an incoming request/interaction (either SSH/vconsole, HTTP or WebSocket) which is always bound to a URI/path (cwd in SSH, request URI in HTTP/Websocket) and maps it, using traversal, to a domain object and executes appropriate methods and returns a result.
This layer can be thought of as the controller.
The interaction layer is as thin as possible as traversal, domain logic and security are in the core, and serialisation is generic.
The primary interaction layer is the HTTP REST endpoint which contains an HTTP request handler and a set of views, one for each content type. The views can either be generic over content types, or specialised for specific models. Generic is preferred over specialised though.
The WebSocket endpoint is in big part complementary to the HTTP REST endpoint. It is mostly an alternative carrier or transport mechanism for individual HTTP-like requests. In addition, it is used to push a stream of data/events to the browser for real time updates of the UI. As HTTP REST like requests can be transported from client to server over this layer, it also provides a performance boost over classic HTTP as it eliminates any request overhead both in terms of responsiveness and network/resource usage. It is also easier to manage than classic HTTP as browser security restrictions do not apply to WebSocket connections.
The SSH virtual console endpoint provides a bash-like pseudo shell
over SSH that exposes a filesystem-like hierarchy to navigate in and
manage the server infrastructure environment. It provides or will
provide all the basic shell-like commands such as
rm. It also provides the generic command
to modify attributes of objects.