Add cyborg driver development guide
Change-Id: I0a235b1f7a08a608c4ad943b53adf41e4495fa77
This commit is contained in:
parent
0160a6b3bb
commit
a94c3a9ccb
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/devstack_setup
|
||||
contributor/driver-development-guide
|
||||
specs/index
|
||||
|
||||
Indices and tables
|
||||
|
Loading…
Reference in New Issue
Block a user