Merge "Add cyborg driver development guide"
This commit is contained in:
commit
80f638ac51
58
doc/source/contributor/driver-development-guide.rst
Normal file
58
doc/source/contributor/driver-development-guide.rst
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
:title: Driver Development Guide
|
||||||
|
|
||||||
|
Driver Development Guide
|
||||||
|
########################
|
||||||
|
|
||||||
|
The goal of this document is to explain how to develop a new kind of Cyborg
|
||||||
|
accelerator driver.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Make sure you have installed Openstack environment using devstack_ before development.
|
||||||
|
|
||||||
|
.. _devstack: https://docs.openstack.org/cyborg/latest/contributor/devstack_setup.html
|
||||||
|
|
||||||
|
Derive a new driver class
|
||||||
|
=========================
|
||||||
|
|
||||||
|
Imply the necessary interface, the list of interfaces is as follows:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
class NewCyborgDriver(object):
|
||||||
|
"""Cyborg new accelerator driver.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def discover(self):
|
||||||
|
"""Discover specific accelerator
|
||||||
|
:return: list of cyborg.objects.driver_objects.driver_device.
|
||||||
|
DriverDevice
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
Modify setup.cfg
|
||||||
|
================
|
||||||
|
|
||||||
|
Add the new driver map into file ``cyborg/setup.cfg``:
|
||||||
|
|
||||||
|
.. code-block:: cfg
|
||||||
|
|
||||||
|
[entry_points]
|
||||||
|
cyborg.accelerator.driver =
|
||||||
|
intel_fpga_driver = cyborg.accelerator.drivers.fpga.intel.driver:IntelFPGADriver
|
||||||
|
new_driver_name = cyborg.accelerator.drivers.example.driver:NewCyborgDriver
|
||||||
|
|
||||||
|
Reinstall and Test
|
||||||
|
==================
|
||||||
|
|
||||||
|
Reinstall cyborg:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ python setup.py develop
|
||||||
|
|
||||||
|
Restart cyborg-agent:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
$ sudo systemctl restart devstack@cyborg-agent
|
@ -64,6 +64,7 @@ Developer Documentation
|
|||||||
|
|
||||||
contributor/contributing
|
contributor/contributing
|
||||||
contributor/devstack_setup
|
contributor/devstack_setup
|
||||||
|
contributor/driver-development-guide
|
||||||
specs/index
|
specs/index
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
|
Loading…
Reference in New Issue
Block a user