This patch[1] added handler for mysql 8.0.19 duplicate key error update,
and in device_profile create progress, we should distinguish the name
and uuid duplicate exception, so update oslo.db version to adapt.
[1] https://review.opendev.org/c/openstack/oslo.db/+/792124
Change-Id: I810cf892545eccd6255b01813a44e2c069ae5a7a
Since 3.7.0, oslo policy started the DeprecationWarning[1] if
deprecated_reason and deprecated_since param are not passed
in DeprecatedRule or they are passed in RuleDefault object.
These warnings are logged for every test which increase the
log size and sometime can full the log buffer and fail the
job.
[1] https://github.com/openstack/oslo.policy/blob/3.7.0/oslo_policy/policy.py#L1538
Change-Id: I5f7b2027e9d015cef6e8e7b459ebf2005c432209
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
Every unit tests init the policy via fixture which will
log the deprecation warnings. As per our new policy defaults
work, we are going to deprecate almost all the policies due
to their change in default value.
Logging all the deprecation warning for every unit tests will
overflow the log files and leads to error.
Oslo policy has a way to supress the deprecation warning for tests,
so let's supress the deprecation warning for unti tests.
This will not be issue on production cloud as there are only
one time policy initialization.
Bump oslo.policy version tod 2.3.0 which includes the suppress warning
flag - https://docs.openstack.org/oslo.policy/latest/user/history.html#id3
Story: 2007024
Task: 40817
Change-Id: Icd0db14ad6e1cb717b6b6f482d9e4f7a4aad7d8a
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib. Most of this
is autogenerated, as described below, but there are three manual changes
necessary.
Change-Id: If9cd7eca3454d9e1d62a0a1753e157adbf965e8d
We removed python2 support in https://review.opendev.org/#/c/717521/,
but we are missing openstacksdk in reqirements, so when we using
python3, that will be raise "ModuleNotFoundError: No module named
'openstack'".
This commit add the openstacksdk>=0.46.0 to Cyborg to support python3.
Change-Id: I4d015b3723fb13c361cefe5eee6607f9cbe8f65d
Story: 2007533
This patch aims at support microversion in Cyborg API.
The work items is the following:
1. remove old api_version_request.py to avoid the redundancy.
2. add a header in every API request and support to parse it and
route to the correct API method.
3. depracate v1 API.
4. add related UT.
For testing:
CTYPE="Content-Type: application/json"
AUTH="X-Auth-Token: $(openstack token issue -c id -f value)"
curl -s -H "$CTYPE" -H "$AUTH" -H "OpenStack-API-Version: accelerator
2.0" http://localhost/accelerator/devices
This will execute sucessfully because 2.0 microversion is supported.
curl -s -H "$CTYPE" -H "$AUTH" -H "OpenStack-API-Version: accelerator
latest" http://localhost/accelerator/devices
This will execute sucessfully because "latest" will be parsed to 2.0.
curl -s -H "$CTYPE" -H "$AUTH" -H "OpenStack-API-Version: accelerator
2.99" http://localhost/accelerator/devices
This will failed because we don't support 2.99 microversion.
Change-Id: Id9c34dc134d59b2332cefbcae5bbd7e6632e970d
When I create a device profile use curl in devstack env by Cyborg
master branch, but there is a
"oslo_messaging.exceptions.MessagingTimeout: Timed out waiting for a
reply to message ID 3f84acee62794d03b2858921bb4950f2" [1] exception raised.
While I update the oslo.messaging that it runs ok, so I bump
oslo.messaging to >=10.3.0 to improve the interaction performance
with other components. Because Cyborg needs to interact with nova, I
keep the oslo.messaging version consistent with the minimum version
required by nova [2].
[1]http://paste.openstack.org/show/790502/
[2]https://opendev.org/openstack/nova/src/branch/master/requirements.txt#L47
Story: 2007396
Change-Id: I0bbeaa286b1add55f00b1059856c785dbf74d800
This is a series of optimization for exception.
In fact, we only need to use the ResourceNotFound exception
to fit NotFound Exception.
This patch also adds dependency package cursive which is used
in [1].
[1]. 6740c3c0c5/cyborg/image/glance.py (L30)
Change-Id: I9e80dcfed54147c942f90c696e483fa6db842dde
Story: 2007045
Task: 37968
This patch add the fake driver, this driver can be configured
in cyborg.cfg to enable it:
[agent]
enabled_drivers = fake_driver
It would be used in cyborg test.
Change-Id: I08c63d533fd5dbd4330c68a22d2ecafb38134766
Because in cyborg/image/glance.py line 33 hava "import glanceclient"
but requirements.txt not have python-glanceclient
Change-Id: I3ba7b9eb87ed799ad5ea61f842dd1bbe08d533a8
Story: 2005097
Task: 29710
This adds basic framework for cyborg-status upgrade
check commands. For now it has only "check_placeholder"
check implemented.
Real checks can be added to this tool in the future.
Change-Id: I4a180f9a1b25c75489ad3cfee30a7b55506e0bbd
Story: 2003657
Task: 26126
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: I8b0f96f05799b892acfae03522726c17010f0df3
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
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
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
Add authtoken middleware for integrating with the OpenStack Identity API
and handling authorization enforcement based upon the data within the
OpenStack Identity tokens
Change-Id: I8056d69657d0a98b4446a494877f7b965ceb786f