Commit Graph

40 Commits

Author SHA1 Message Date
songwenping 81ab269436 Add tempest config for devstack
Change-Id: If8a390aedaf3c2cfcf491a39daac5a2e636ec529
2024-01-23 09:22:15 +08:00
Ghanshyam Mann af49d0b30a Change default policy file from JSON to YAML
As Cyborg is switching to new policy, this is required
to avoid breaking the existing deployment using policy
file in json format and relying on default value of
'CONF.oslo_policy.policy_file'.

Default value of 'CONF.oslo_policy.policy_file' config option
has been changed from 'policy.json' to 'policy.yaml'. If new default
file 'policy.yaml' does not exist but old default 'policy.json' exist
then fallback to use old default file.

An upgrade checks is added to check the policy_file format and
fail upgrade checks if it is JSON formatted.

Added a warning in policy doc about JSON formatted file is deprecated,
also removed all the reference to policy.json file in doc as well as
in tests.

Related Blueprint: https://blueprints.launchpad.net/oslo.policy/+spec/policy-json-to-yaml

Change-Id: I865227e516dc7505c463ac279309169d95ea6a22
2020-09-18 14:16:31 +00:00
Zuul 8cf0310a75 Merge "Remove OPAE dependency in devstack" 2020-06-17 06:24:00 +00:00
zhurong e6cdf3ec8d Use uwsgi binary from path and docs job fix
All these uwsgi invocations assume that the uwsgi binary is in the
same directory as their project binaries are installed into (probably
/usr/bin).  That may not be correct -- for example if using a packaged
uwsgi on Fedora the binary will live in /usr/sbin/uwsgi (not /usr/bin
where the project files from pip are).

Switch invocations to just find it in the path.
Also fix the docs job

Change-Id: Ib56b4d3f4962466ea9e937b314e54014070e7adc
2020-06-16 18:16:34 +08:00
Yumeng Bao 7ee7de1ec9 Remove OPAE dependency in devstack
This patch removes OPAE driver package from cyborg-agent dependencies due to
the following reasons:

1. In the kolla cyborg-agent image we install OPAE, but OPAE is not
available for CentOS 8 for the moment. This will make the cyborg-agent image
unbuildable in Ussuri[0].

2. In devstack, due to the fact that OPAE packages depend on libjson0, which
is not available after Ubuntu 16.04, so cyborg can't be installed on Ubuntu
higher than 16.04 now(unless disable dependency manually). Moreover,from
cyborg's perspective, it does not need to contain any hardware driver
dependency, we can assume the admin should know about it and install the
correct version.

3. We had an agreement at Victoria PTG that we should remove.[1]

[0]http://lists.openstack.org/pipermail/openstack-discuss/2020-June/015428.html
[1]https://etherpad.opendev.org/p/cyborg-victoria-goals L261

Change-Id: If0c92ea6ed98f195f5645ae0260855ed50f4f2a8
Story: 2007810
Task: 40078
2020-06-15 19:56:36 +08:00
Dan Smith 96aa80acc4 Always stop cyborg-api process uwsgi container
Right now, devstack/clean.sh always leaves an orphaned cyborg-api
service running. This makes us always stop it to avoid that.

Change-Id: I1c40804a7b20d54da3c09e613597c388e9f330f7
2020-03-16 13:50:00 +00:00
Dan Smith f5a47abe5e Fix setting cyborg agent hostname
This removes the devstack plugin line which overrides the CONF.host in
the cyborg agent with the $LOCAL_HOSTNAME. The latter may be different
than what the nova-compute service generates (as the nova devstack
module does not override the host). Since these need to match, just
remove the override here so that both services use the hostname from
the service framework.

Closes Task: #38811

Change-Id: I393ccbf020cc4f80ce78b1ba4564a833abec02bf
2020-03-16 13:50:00 +00:00
Sean Mooney 76bdd3f8a3 add support for installing cyborg client
This change adds support for installing the
python-cyborgclient from git. By default it is installed
but it can be disabled by setting CYBORG_CLIENT_INSTALL=False.
The version and repo can be set using CYBORG_CLIENT_REPO and
CYBORG_CLIENT_BRANCH.

Change-Id: I1dd616fe1e0c5b03118a23fc5afe2a4d3bb3686d
2020-03-16 13:50:00 +00:00
Sean Mooney dd2024ee95 simplify devstack plugin
This change replaces the nested if used
in plugin.sh with nested case statements for
greater readablity.

This change removes an unnecessary check to determine
if services are enabled. By default all cyborg
service are enabled by the plugin. Since the plugin is
not loaded unless the user specifies the enable_plugin
line in there local.conf we can assume they want the plugin
to run and there for can remove the service check.

This change removes the install_agent function and renames
install_cyborg_in_controller function to
check_cyborg_service_deps to better reflect what the function
does.

Change-Id: Ia5ad1235ae4a5a76bcd498a743ca6be6b3634c5c
2020-03-16 13:50:00 +00:00
Sean Mooney b3aa875c3c move functions from devstack/plugin.sh to devstack/lib/cyborg
This change refactors the devstack plugin to call functions
provided by the devstack/lib/* files

Change-Id: I61e169d5723720236bcf5ce3883fae6164ef6352
2020-03-16 13:50:00 +00:00
Sean Mooney 67099829fa support standard devstack plugin cloning
This change removes the non standard mechanism
for specifying the cyborg repo and branch
via CYBORG_REPO and CYBORG_BRANCH.

in-tree devstack modules use the
<PROJECT NAME>_REPO and <PROJECT NAME>_BRANCH
convention for specifying revisions of project to clone
however devstack plugins should only use that convention
for cloning other git repos.

A devstack plugin should never clone the repo that contains
the plugin itself as doing so will replace the code while it
is executing. This can lead to the code that is running and the
code on disk being different if the plugin line and CYBORG_*
options do not match.

This change updates the devstack_setup docs with an example of
testing an unmerged change.

This change removes some commented out code and unneeded checks in
devstack/lib/*

Change-Id: I473ef276197ad6578f64a708f4b66562a2ff1d49
2020-03-16 13:49:52 +00:00
Sean Mooney 985b15287e move setting to devstack/settings
All user settable options should be stored the
devstack/setting file so they are defiend when it is
sourced early in devstack to allow values to be shared
between plugins if required.

This change moves the cyborg settings from
devstack/lib/cyborg to devstack/settings to conform to
the standard plugin interface.

The name of the folder where devstack clones the plugin
is specified in the first argument ot the enable_plugin
function invocation in the local.conf.
This change makes updates CYBORG_DIR to respect that
and adds TODOs for other issues that will be adressed in
follow up patches.

Change-Id: I5b6879e5ddb86659b8c7eb87b8d26cee33ed4754
2020-03-02 15:02:17 +00:00
chenke 48370628c4 Add procname for uwsgi based service cyborg-api
Code in grenade and elsewhere rely on the process/service name
when one runs "ps auxw" and they grep for example "grep -e cyborg-api"
to check if the service is running. with uwsgi, let us make sure
we use process name prefix so it is easier to spot the services
and be compatible with code elsewhere that relies on this.

Reference:
https://review.opendev.org/#/c/494531/

Change-Id: I7afa389160d3a2355e7a077fec2570423254c83d
2019-12-02 19:09:24 +08:00
chenke 92ff3f7ede Simplify devstack script for generating cyborg.conf
1. Put the same code in one function.

Change-Id: I1d543e224fd7c5629caf489e2eb28dfdd9c71442
2019-11-15 15:45:56 +08:00
chenke 9fb411e860 Remove useless glance api_servers define
According to nova's advice, api_servers is useless and
We should get rid of it[1].

[1]. https://review.opendev.org/#/c/682565/ PatchSet 16.

Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
Change-Id: I84cb846561fba941b2b2cdff422a94928f9bfda1
2019-10-23 16:15:14 +08:00
Zuul 1e69e91edf Merge "Fix the hardcoding of user role using sdk_adapter approach" 2019-09-29 04:20:37 +00:00
Zuul 0cd97ed559 Merge "Fix v1 API." 2019-09-26 13:51:32 +00:00
chenke 71df0a289d Fix the hardcoding of user role using sdk_adapter approach
1. Refer to nova's latest code, use get_sdk to create the client[1].

2. Move placement_client define from default to seperate placement file.

Note:
The new method for get nova and placement client has been tested in latest
cyborg devstack environment. And the test results are good.

Because now cyborg does not have unit tests for the common and conf directory,
unit tests related to this patch will be added in the future, but not in this patch.

Reference:
[1]. 3f019f2db3/nova/utils.py (L1013)

Change-Id: I2a335d47ee3cc24f78b4d49942f1cccd586a0dcc
2019-09-26 11:28:04 +08:00
zhurong 38d6b405bd Enable fake_driver by default
Change-Id: I931d29b4073afce9f4ca707eff21cbd8659c05a2
2019-09-25 04:26:44 -07:00
Sundar Nadathur 72df50f91e Fix v1 API.
http://<ip>/accelerator/v1 is unreachable without
this patch. But v1 API is supported, even if deprecated.

In devstack Cyborg plugin, v1 API enabling is commented out.
Interested developers can uncomment it before stacking.

To test this:
    token=$(openstack token issue -c id -f value)
    auth="X-Auth-Token: $token"
    ctype="Content-Type: application/json"
    curl -s -H "$ctype" -H "$auth" <url>

Expected output:
    http://192.168.122.4/accelerator/v1
{"id": "v1", "accelerator": [{"href":
 "http://192.168.122.4/accelerator/v2/accelerator", "rel": "self"},
 {"href": "http://192.168.122.4/accelerator/accelerator",
 "rel": "bookmark"}]}

    http://192.168.122.4/accelerator/v1/accelerators
    {}

    http://192.168.122.4/accelerator/v1/deployables
    {"deployables": []}

Change-Id: Ib0c9a235f4c86e60e38b8046904e83f2ea4f5383
2019-09-24 19:21:15 -07:00
Yumeng Bao 477b4f9a55 remove rootwrap in cyborg
On one hand, as discussed in this patch[0], rootwap was intented
to be replaced by privsep, especially for new project.
On the other hand, we need remove rootwrap to fix the following
cyborg-tempest job failure in patch [0]:
cannot stat '/opt/stack/cyborg/etc/cyborg/rootwrap.d/*.filters':
No such file or directory

[0]:https://review.opendev.org/#/c/673957/

Change-Id: I1aaf38da3a68c656616c7d701b8f815e17ed0152
2019-09-24 00:30:25 -07:00
Sundar Nadathur bc2483960c P9: Enable v2 API in devstack.
Change-Id: I55ec66b2f76116337ed49c458a6ebdbbd17d801a
2019-09-09 16:51:11 -07:00
Yumeng Bao f4758c9173 enable branch selection in devstack installation
With this patch, user can specify the installation version..

Change-Id: Icde4143d84f50b5b4199403070bf5dab12751682
2019-08-29 06:36:38 +00:00
Zuul 6f92643cbd Merge "bug fix: deploy every cyborg components correctly" 2019-07-11 22:56:56 +00:00
Shaohe Feng 34f8c6a147 bug fix: deploy every cyborg components correctly
Different components need different config.

Change-Id: Id73cd0dd7eb2abc2d411cc3d5abbbd4e3df58f0f
2019-06-19 03:41:12 +00:00
Yikun Jiang 9dc398c56c Fix the section of enabled_drivers
The "enabled_drivers" is a configuration of agent section [1], but
it's set to DEFAULT section in devstack.

This patch try to fix it to make the "enabled_drviers" work.

[1] https://github.com/openstack/cyborg/blob/4a96835/cyborg/conf/agent.py#L27

Change-Id: I05b8143cc54f80ddd87561cd20a70810d64e225b
2019-06-18 07:56:40 +00:00
Shaohe Feng dd8057211c add knob for OPAE install
Currently, OPAE is so picky about the OS.

Not every developer need OPAE.
In order to make them happy, add knot for OPAE install.

Change-Id: Ief2c75c4bc80bb7b01a812fd6f18abd6a3acfcc5
2019-04-10 10:29:40 +00:00
Sundar Nadathur e4264635dc Devstack enablement for OPAE FPGA driver.
This is partial refactor of https://review.openstack.org/#/c/584170
based on review comments.

Change-Id: Ia25df018ceae84c613f2f5dea1a6c3d175b4a551
Storyboard: https://storyboard.openstack.org/#!/story/2004250
2018-11-30 10:21:45 -08:00
Shaohe Feng 69c6b8a3a8 bug fix: fix 2 bugs for image client
1. missing glance config section

2. missing import keystoneauth1.exceptions
When call glance fail during download image, it will report:
 NameError: global name 'ks_exc' is not defined

Change-Id: I17f25368f3361b4fc20a0eda9d6b2788beaa6362
2018-10-26 08:49:06 +00:00
Yumeng Bao 95515c5c4b Deploy cyborg-api via uwsgi
The patch adds the devstack install cyborg-api via uwsgi.

Change-Id: I2dc39affb30505f616a6a275f45b497ba742e64b
2018-10-24 03:55:05 +00:00
Shaohe Feng 604e5b54fe support sub provider
With this patch, cyborg can report accelerators information into
placement. Then scheduer can find an appropriate host according to
user requirements.

This patch leverages Nova's code in order to avoid reinventing the wheel.

It is batter that nova can split the placement client to a separated lib.
So other projects can use it easily.

This new client can support provider trees, that is needed by cyborg's
different dirvers.
We can create a sub provider tree easily by the follow method.
class SchedulerReportClient(object):
    def get_provider_tree_and_ensure_root(
           self, context, rp_uuid, name=None,
           parent_provider_uuid=None)

The patch include:
1. add get_ksa_adapter for placement client

2. add placement client

3. update placement config

Missing testcase for this patch.

Change-Id: I1ad9d525fa070dfa0f7cbf374003a74c50de17b4
2018-08-10 07:49:37 +00:00
wangzh21 cc9da9a944 Load cyborg-api app with paste_deploy
Change-Id: I3976d05f737e09ceb88c40f65b445bad0b096516
Story: 2002121
Task: 19800
2018-06-07 21:42:52 +08:00
Shaohe Feng 2e10d20110 change service type to "accelerator"
As we discussed in irc meeting, we use "accelerator" as service type.

Change-Id: Ib932f9fe27bf7fc08c3f334acc6b3da6cfd0489f
2018-05-16 09:25:12 +00:00
Shaohe Feng a308525d38 bug fix: endpoint register, import and devstack broken issues.
1. amend keyston endpoint register info
Service type should acceleration instead of cyborg.
For cyborg is just the service name.
We do not support uwsgi at present, so we must indicate service
port explicitly.

2. Fix package import error
Add full path to import module, so that the reference can be
resolved.

Story: 2001887
Task: 14368

3. devstack broken
TypeError: launch_service() got an unexpected keyword argument 'restart_method'
When initialize cyborg api service launcher, we already pass restart_method.
So no need to pass restart_method to launcher.launch_service, and it has not
restart_method argument.

Co-Authored-By: jiapei <jiapei2@lenovo.com>
Co-Authored-By: Zhipeng Huang <huangzhipeng@huawei.com>

Change-Id: Ic69e76b7bf86bbd1382aff07694ea9fbafd0862a
2018-04-28 07:11:33 +00:00
Shaohe Feng 4e803eeee3 bug fix: devstack can not start cyborg
Change-Id: I56eaa55c3c9c81695a4d47fe396c48d1efce0925
2018-03-29 20:41:31 +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
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
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
Rushil Chugh 173a80718f Fix issues with devstack script
Change-Id: I3ebaacb54f0efde33c41c7f9ce53d72ceac0db32
2017-09-25 23:15:40 -04:00
Rushil Chugh d69a11bb4c Add devstack plugin for Cyborg
Change-Id: Ie6c5ca4b995bbdaa97c963cb7d1e0ba3f4e290ee
2017-09-12 22:43:47 -06:00