Commit 8df5e434 authored by Daniele Venzano's avatar Daniele Venzano

Add documentation for the backend abstraction

parent 2c64d0a7
.. _devel_backend:
Backend abstraction
===================
The container backend Zoe uses is configurable at runtime. Internally there is an API that Zoe, in particular the scheduler, uses to communicate with the container backend. This document explains the API, so that new backends can be created and maintained.
Package structure
-----------------
Backends are written in Python and live in the ``zoe_master/backends/`` directory. Inside there is one Python package for each backend implementation.
To let Zoe use a new backend, its class must be imported in ``zoe_master/backends/interface.py`` and the ``_get_backend()`` function should be modified accordingly. Then the choices in ``zoe_lib/config.py`` for the configuration file should be expanded to include the new backend name.
More options to the configuration file can be added to support the new backend. Use the ``--<backend name>-<option name>`` convention for them.
API
---
Whenever Zoe needs to access the container backend it will create a new instance of the backend class. The class must be a child of ``zoe_master.backends.base.BaseBackend``.
.. autoclass:: zoe_master.backends.base.BaseBackend
:members:
.. _developer_documentation:
Developer documentation
=======================
:ref:`modindex`
.. toctree::
:maxdepth: 2
introduction
rest-api
auth
api-endpoint
master-api
scheduler
backend
......@@ -68,14 +68,10 @@ Developer documentation
:ref:`modindex`
.. toctree::
:maxdepth: 2
:maxdepth: 1
developer/index
developer/introduction
developer/rest-api
developer/auth
developer/api-endpoint
developer/master-api
developer/scheduler
Contacts
========
......
......@@ -27,9 +27,12 @@ try:
except ImportError:
KazooClient = None
import docker
import docker.errors
import docker.utils
try:
import docker
import docker.errors
import docker.utils
except ImportError:
pass
import requests.packages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment