104 Commits

Author SHA1 Message Date
zhipengh
fe04417036 Add release pkg related files
Change-Id: I88a259c05b5e13dbe06f0f00c4f73cbc413cd3ee
Signed-off-by: zhipengh <huangzhipeng@huawei.com>
2018-02-10 10:51:47 +08:00
Zuul
a437d56680 Merge "add test case for agent resource tracker" 2018-02-08 15:52:48 +00:00
Zuul
e6d198a60e Merge "Added Unit tests for object Accelerator and Deployable" 2018-02-08 15:17:31 +00:00
Zuul
c95b5e1686 Merge "bug fix: missing i18n._()" 2018-02-08 15:09:17 +00:00
Zuul
ce8b3091b6 Merge "bug fix: rename accelerator to Accelerator" 2018-02-08 14:26:52 +00:00
Shaohe Feng
a35598b1a5 bug fix: devstack adds cyborg account and endpoint.
Co-Authored-By: Jinghan Sun <jinghan.sun@intel.com>

Change-Id: I01f0e79fbbc85b0e8318baf0fca11fd0036277ec
2018-02-08 10:57:42 +00:00
Shaohe Feng
709f79ce6d bug fix: rename accelerator to Accelerator
When run:
$ python -m unittest cyborg.tests.unit.accelerator.drivers.modules.test_generic

It will report the follow error:
  File "cyborg/tests/unit/accelerator/drivers/modules/test_generic.py", line 20, in <module>
    from cyborg.accelerator.drivers.generic_driver import GenericDriver as generic
  File "cyborg/accelerator/drivers/generic_driver.py", line 24, in <module>
    from cyborg.accelerator import accelerator
  File "cyborg/accelerator/accelerator.py", line 23, in <module>
    class accelerator(Base):
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/api.py", line 64, in __init__
    _as_declarative(cls, classname, cls.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/base.py", line 88, in _as_declarative
    _MapperConfig.setup_mapping(cls, classname, dict_)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/base.py", line 103, in setup_mapping
    cfg_cls(cls_, classname, dict_)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/base.py", line 125, in __init__
    clsregistry.add_class(self.classname, self.cls)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/clsregistry.py", line 65, in add_class
    module.add_class(classname, cls)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/clsregistry.py", line 172, in add_class
    existing.add_item(cls)
AttributeError: '_ModuleMarker' object has no attribute 'add_item'

That's because:
_ModuleMarker will add the module name and class name in to same contents dict.
_MultipleClassMarker refers to multiple classes of the same name within _decl_class_registry.
It has add_item attribute.
_ModuleMarker refers to a module name within _decl_class_registry.
It does not have add_item attribute.

So the class name should be different with module name.

REF:
https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/ext/declarative/clsregistry.py

Change-Id: I8d8aa8809f6afd5b9eaace832a06ba7f3770e652
2018-02-08 09:31:23 +00:00
Shaohe Feng
a1a5ad95cd bug fix: missing i18n._()
Change-Id: If1de4e857dd3b08dc9db754341cbe008291dd990
2018-02-08 06:22:23 +00:00
Shaohe Feng
805f96d1e1 add test case for agent resource tracker
Co-Authored-By: Dolpher Du <Dolpher.Du@intel.com>

Change-Id: I17a69fca393367c4dc4d1fd27bcb4984d6ce6ad0
2018-02-07 15:43:46 +00:00
zhipengh
2e78e10e5a queens release doc fix part 1
More patches might follow

Update 0(pacth 1):
1.remove unnecessary files
2.reorg doc directory

Update 1(patch 2):
add releasenotes and cleanup the internal-api spec

Update 2(patch 3):
1.added a new releasenote for generic-driver
2.fixed errors in the other four earlier releasenotes
3.add comment in cyborg/object/accelerator.py and deployable.py to
let user better know the meanings of the table entries.

Change-Id: I45a104f9f77a0a163008657c681cf109f941dd11
Signed-off-by: zhipengh <huangzhipeng@huawei.com>
2018-02-07 20:53:38 +08:00
Zuul
74dfb65aa8 Merge "Provide reference implementation for Cyborg" 2018-02-05 07:42:47 +00:00
Rushil Chugh
71e4a39f93 Provide reference implementation for Cyborg
This patch proposes to provide a reference implementation
for other drivers

Change-Id: I997b817ef58b77aa439e14902dc0ee104a163b66
2018-02-05 00:28:50 -05:00
Zuul
4e9dd99c29 Merge "Add Cyborg SPDK Driver" 2018-02-05 04:07:44 +00:00
Li Liu
2ae19254bb Added Unit tests for object Accelerator and Deployable
Change-Id: I9cf93306e7770172a95825d320de15e2d60c4d45
2018-02-04 18:31:50 -05:00
Zuul
6ee7ed802f Merge "FPGA driver support" 2018-02-04 17:18:52 +00:00
Zuul
af5dd8e1ed Merge "aggent support resource tracker for FPGA" 2018-02-04 17:09:07 +00:00
heluwei
488cc340ef Add Cyborg SPDK Driver
SPDKDRIVER is a virtual interface which provides common methods
for specific drivers (such as: VHOSTDRIVER, NVMFDRIVER, etc.).
For this reason, the Cyborg agent should invoke these drivers
via py-spdk[0] to communicate with the backend SPDK-base app server.
The py-spdk is management lib for SPDK applications which need to
be imported into the cyborg, so we put the pyspdk lib into cyborg/
cyborg/accelerator/drivers/spdk/util/. There are some unit tests
we added in cyborg/cyborg/tests/unit/accelerator/drivers/spdk/.
Now We are first implementing the unit tests of
test_discover_accelerator() and test_accelerator_list(),
and the rest will be added later.

For example:
When the Cyborg agent call the NVMFDRIVER.discover_accelerator(),
the return value we get is:
{
    'server': 'nvmf_tgt',
    'bdevs': [{
       "num_blocks": 131072,
       "name": "nvme1",
       "block_size": 512,
       ......
     }]
    'subsystems': [{
       "core": 0,
       "nqn": "nqn.2018-01.org.nvmexpress.discovery",
       "hosts": [],
       ......
     }]
}

[0] The implementation of py-spdk is subbmitted to
https://review.gerrithub.io/#/c/379741/, please visit it.

Change-Id: I2d0e4dc6b58e725584d22ee85961877a870c68a7
2018-02-05 00:57:30 +08:00
zhuli
aee55527a9 Implement FPGA data model and corresponding API
This patch implements the Deployables data model and provides corresponding
CRUD REST/RPC API.

Since the CREATE/UPDATE/DELETE method of Deployables should only be used
by internal component, currently keep these in code is just for convenient
test purpose, which will be removed later.

blueprint cyborg-fpga-modelling

Change-Id: I8a028954bd27d015c0b062f730673ea39701774d
2018-02-04 21:45:26 +08:00
Shaohe Feng
5b72422930 FPGA driver support
This patch is not a plugin implementation

Cyborg agent can call driver as follow:
from cyborg.accelerator.drivers.fpga import base
fdriver = base.FPGADriver
 # There maybe more than one vendor fpga card on a host.
venders = fdriver.discover_vendors()
for v in venders:
    dr = fdriver.create(v)
    dr.discover()

intel = base.FPGADriver.create("intel")
intel.program("/fpga/device/path", "/local/path/image")

When call IntelFPGADriver.discover(), we can get the result as follow:
    [{'assignable': False,
      'devices': '0000:5e:00.0',
      'function': 'pf',
      'parent_devices': '',
      'path': '/sys/class/fpga/intel-fpga-dev.0',
      'pr_num': '1',
      'product_id': '0xbcc0',
      'regions': [{'assignable': True,
        'devices': '0000:5e:00.1',
        'function': 'vf',
        'parent_devices': '0000:5e:00.0',
        'path': '/sys/class/fpga/intel-fpga-dev.2',
        'product_id': '0xbcc1',
        'vendor_id': '0x8086'}],
      'vendor_id': '0x8086'},
     {'assignable': True,
      'devices': '0000:be:00.0',
      'function': 'pf',
      'parent_devices': '',
      'path': '/sys/class/fpga/intel-fpga-dev.1',
      'pr_num': '0',
      'product_id': '0xbcc0',
      'vendor_id': '0x8086'}]

Cyborg agent can use it to form it's DB.

Co-Authored-By: Dolpher Du <Dolpher.Du@intel.com>

Change-Id: I132be5ecdb90b385b68b0cdf306d1402ef4bfc04
2018-02-04 12:45:53 +00:00
Shaohe Feng
b96d0e2570 aggent support resource tracker for FPGA
use PeriodicTasks to track resources.

Info:
 https://docs.openstack.org/oslo.service/latest/reference/periodic_task.html

Aggent is a bridge for FPGA driver and conductor.
It gets the lastest informations and update them to conductor.

This patch we call conductor API directly instead of object
remotable method.  Will support it in the next version.

This patch depends on the FPGA driver patch and conductor patch.

How to test this patch:
1. apply the fpga driver patch
   https://review.openstack.org/#/c/531129
2. generate a sysfs fpga data
   $ ./cyborg/tests/unit/accelerator/drivers/fpga/intel/prepare_test_data.py
3. Change the SYS_FPGA in cyborg/accelerator/drivers/fpga/intel/sysinfo.py to
   "/tmp/sys/class/fpga"
4. change the SYS_FPGA_PATH in cyborg/accelerator/drivers/fpga/utils.py to
   "/tmp/sys/class/fpga"
5. restart agent.

The unittest for this patch will be in a separated patch, and comes out ASAP.

Co-Authored-By: Dolpher Du <Dolpher.Du@intel.com>

Change-Id: I5e487cf939aa65d0fc79399ddd5d1337a8c2fa98
2018-02-04 11:54:20 +00:00
Zuul
b22761ab0d Merge "Zuul: Remove project name" 2018-02-03 01:32:38 +00:00
James E. Blair
3febc582af Zuul: Remove project name
Zuul no longer requires the project-name for in-repo configuration.
Omitting it makes forking or renaming projects easier.

Change-Id: I3066f4fdf016d26f43a34ecd60c64ec6423f31fd
2018-02-02 06:09:51 -08:00
Zuul
6c64f63ba7 Merge "Added NOVA Placement API Client and unit tests. This feature is used for updating the placement DB on NOVA side Cyborg DB should be kept up to date with the placement DB all the time." 2018-01-31 07:48:30 +00:00
Li Liu
34aa0b8b2c Added NOVA Placement API Client and unit tests.
This feature is used for updating the placement DB on NOVA side
Cyborg DB should be kept up to date with the placement DB all
the time.

Here is an example on how to use it:

    from cyborg.services import report as placement_report_client
    p_client = placement_report_client.SchedulerReportClient()

    resource_provider = {'name': 'rp_name', 'uuid': 'uuid'}
    p_client.create_resource_provider(resource_provider)

Change-Id: I04f5e3fc283074212841e62dde54df496db535ec
2018-01-29 12:37:26 -05:00
Jinghan Sun
28eb9bb704 Fix bug in cyborg/devstack script
(1) Define undefined local variables.
(2) Correct script commands that create and migrates database

Change-Id: I2c140bedf5e89c88ae1de72511e5068e35fd2fad
Closes-bug: #1744630
2018-01-22 08:40:55 +00:00
Zuul
d421f978f0 Merge "Added proposal for fpga modelling" 2018-01-18 02:18:59 +00:00
Zuul
52e31bb6bb Merge "Supplementing accelerator CRUD api" 2018-01-17 15:47:59 +00:00
Li Liu
f683bd19d8 Added proposal for fpga modelling
Change-Id: I23dd57fea320aabeac4d1982f5c9d9a818bcbfb5
2018-01-17 09:57:29 -05:00
Zuul
0cb64ac038 Merge "Internal API spec" 2018-01-16 15:45:11 +00:00
Zuul
6590e9a6c9 Merge "Cyborg FPGA driver support" 2018-01-16 15:02:23 +00:00
jkilpatr
9d40c88d0e Internal API spec
This is my attempt at whipping up some internal API calls
for Crushil, there's some assumptions in here we should talk
about. Hopefully this will also be a good place to keep track
of the internal API in general.

Change-Id: I59f3706190d0abed2997a8302717308ea5974ac5
2018-01-16 14:06:14 +00:00
Jinghan Sun
c6c40568e3 Let user to setup and run Cyborg by devstack
The related bug was spotted when I tried to setup cyborg environment by devstack but failed to start cyborg.

It is result from the permission change in devstack/lib/cyborg.

Closes-bug: #1742643
Change-Id: I54426aea597119253f07acf243d6616cd27935ac
2018-01-15 08:00:27 +00:00
zhuli
b860aef110 Supplementing accelerator CRUD api
with this patch, we are able to do CRUD via accelerator api

POST /accelerators
    Create a new accelerator
GET /accelerators/{uuid}
    Retrieve information about the given accelerator
GET /accelerators
    Retrieve a list of accelerators
PATCH /accelerators/{uuid}
    Update information about the given accelerator
DELETE /accelerators/{uuid}
    Delete the given accelerator

Change-Id: Ibc97ec49f557cac69dfd38f99f28bc7b205732b9
2018-01-14 02:03:24 +08:00
Shaohe Feng
9db9994f57 Cyborg FPGA driver support
Co-Authored-By: Dolpher Du <Dolpher.Du@intel.com>

Change-Id: I5b27063a2644e067da0fb6ddbc39d82b4a9a244e
2018-01-12 08:46:41 +00:00
Zuul
288b7c75f1 Merge "Move legacy jobs to project" 2018-01-02 06:52:00 +00:00
Duong Ha-Quang
a2fb9b4f42 Move legacy jobs to project
This patch implements first step in zuulv3 migration guide [1]:

Move jobs to Cyborg repo

[1] https://docs.openstack.org/infra/manual/zuulv3.html#legacy-job-migration-details

Change-Id: I31d5d7aed511aca18c1096b9f5eb7572f683d613
Needed-By: If816cfec5ace8f9fd7293c0749948d2c0dcb817a
Needed-By: I40e9380d049f541bf34488a3010d95f4a6835179
2017-12-29 09:27:59 +01:00
Zuul
feacb2e5ab Merge "Fix 500 error when creating accelerators" 2017-12-27 05:38:55 +00:00
Zuul
6aff6027fa Merge "Auto generate cyborg.conf with oslo-config-generator" 2017-12-27 04:31:42 +00:00
zhuli
acdfafa083 Fix 500 error when creating accelerators
Change-Id: Id0d5616c8e962699ae6435966a9b79b0aaaef54d
Closes-Bug: #1737575
2017-12-12 00:41:36 +08:00
Nguyen Van Trung
be6b4860fd Indicating the location tests directory in oslo_debug_helper
According to [1], we can passing a "-t" argument to
oslo_debug_helper to indicate the directory where tests
are located. This will solves ImportError exception.

[1] https://docs.openstack.org/developer/oslotest/features.html

Change-Id: I13b7a11bc1a3e76709352a248d9eaa64aeba8bc3
2017-12-11 08:10:55 +07:00
zhuli
a1e4b44797 Auto generate cyborg.conf with oslo-config-generator
Change-Id: If7cbf3701bb7b5ef0e0536339f8c1df9557f0688
2017-12-08 10:58:25 +08:00
Nguyen Van Trung
111630aa07 Replace jsonutils by common json package
Should remove oslo.serialization which only use at one test-case.
This change will help project do not depends this package,
and let's use the regular json attribute anyway.

Change-Id: I01af1e1b09fb9866acf54fc7a19aedfaab34a684
2017-11-29 03:21:39 +00:00
Zuul
9f70a04d5c Merge "Cyborg Nova interaction take 2" 2017-11-27 15:49:04 +00:00
jkilpatr
5a3aa4a9c7 Cyborg Nova interaction take 2
Dramatically revised from this

https://review.openstack.org/#/c/448228/3/specs/proposal/cyborg-nova-interaction.rst

My goal with this spec is to have it be only where we interact with nova without
details of other components, otherwise we just get into a monolithic spec for
everything.

I plan to expand this into exact api calls and a detailed workflow, especially
for the new API call we will have to make in nova to register whitelisted
devices live.  That being said we may need to reboot the machine to change the
grub config anyways so maybe we should be looking at how to make that work
first.

Change-Id: I22037109b613d7b33d7c620b78493ec7e96e735e
2017-11-23 02:07:32 +00:00
Nguyen Van Trung
7d9524c7b3 Cleanup test-requirements
python-subunit is not used directly anywhere
and it is dependency of both testrepository
and os-testr.

Change-Id: I2136b810c2c304064dfd5dbe178a4c53b8860020
2017-11-06 14:38:14 +07:00
Jenkins
103f07e70c Merge "Add Cyborg SPDK driver" 2017-10-11 15:37:57 +00:00
heluwei
3b489507f0 Add Cyborg SPDK driver
In a general, Cyborg, as the hardware (like FPGA) and software
(like DPDK, SPDK) acceleration framework, can help backend to
improve performance. And SPDK driver can help Cyborg to manage
SPDK accelerator through calling the py-spdk[0].

Based upon the above reasoning, this patch accomplish two things:
(1) When Cinder uses Ceph as its backend, the Cyborg SPDK driver
can discover, list the SPDK accelerator backend.
(2) When Cinder directly uses SPDK blobstore as its backend, the
Cyborg SPDK driver can discover, list, attach, detach and update
the SPDK accelerator backend.

[0] https://review.gerrithub.io/#/c/379741/

Change-Id: I76a40327bf5c267888fd6293f0ed918bc8cca7ae
Signed-off-by: heluwei <heluwei@huawei.com>
2017-10-09 10:18:36 +08:00
Jenkins
3d0655a179 Merge "Fix issues with devstack script" 2017-09-26 11:58:06 +00:00
Rushil Chugh
173a80718f Fix issues with devstack script
Change-Id: I3ebaacb54f0efde33c41c7f9ce53d72ceac0db32
2017-09-25 23:15:40 -04:00
Jenkins
98ac0131cf Merge "add api unit test" 2017-09-15 01:25:09 +00:00