Commit Graph

30 Commits

Author SHA1 Message Date
Brian Rosmaita c187a33b7b [docs] add autodoc_mock_imports
The docs job has recently begun failing with:

autodoc: failed to import module 'connector' from module
'os_brick.initiator'; the following exception was raised: No module
named 'cryptography'

We're not directly importing cryptography in os-brick, so address this
by adding 'cryptography' to the autodoc_mock_imports list.

Change-Id: I5128d717f7a31fb9042f690ed7c17a3191f1a99e
2023-07-21 08:27:57 -04:00
Gorka Eguileor 4c21b40df2 NVMe-oF: Consolidate code paths
We currently have 2 different connection information formats: The
initial one and the new one.

Within the new format we have 2 variants: Replicated and Not replicated.

Currently the nvmeof connector has multiple code paths and we end up
finding bugs that affect one path and not the other, and bugs that are
present in both may end up getting fixed in only one of them.

This patch consolidates both formats by converting the connection
information into a common internal representation, thus reducing the
number of code paths.

Thanks to this consolidation the Cinder drivers are less restricted on
how they can identify a volume in the connection information.  They are
no longer forced to pass the NVMe UUID (in case they cannot get that
information or the backend doesn't support it) and they can provide
other information instead (nguid or namespace id).

This connection properties format consolidation is explained in the new
NVMeOFConnProps class docstring.

By consolidating the code paths a number of bugs get fixed
automatically, because they were broken in one path but not in the
other.  As examples, the old code path didn't have rescans but the new
one did, and the old code path had device flush but the new one didn't.

Given the big refactoring needed to consolidate everything this patch
also accomplishes the following things:

- Uses Portal, Target, and NVMeOFConnProps classes instead of using the
  harder to read and error prone dictionaries and tuples.

- Adds method annotations.

- Documents most methods (exect the raid ones which I'm not familiar
  with)

- Adds the connector to the docs.

- Makes method signatures conform with Cinder team standards: no more
  static methods passing self and no more calling class methods using
  the class name instead of self.

Closes-Bug: #1964590
Closes-Bug: #1964395
Closes-Bug: #1964388
Closes-Bug: #1964385
Closes-Bug: #1964380
Closes-Bug: #1964383
Closes-Bug: #1965954
Closes-Bug: #1903032
Related-Bug: #1961102
Change-Id: I6c2a952f7e286f3e3890e3f2fcb2fdd1063f0c17
2022-07-19 12:40:57 +02:00
Gorka Eguileor b72c034885 Support independent file lock path
OS-Brick uses file locks to ensure single access to critital sections,
and uses the oslo concurrency "lock_path" configuration option to
determine where to create these locks.

This is fine when each host has a single service using os-brick, which
is the case of Compute nodes and Controller nodes where Glance is not
using Cinder as its backend.

The problem happens when we have an HCI deployment where Cinder and Nova
are collocated on the same host or when Glance uses Cinder as its
backend and is running on the same host.  In those scenarios os-brick
will create file locks in different paths for each service, which is not
the intended behavior.

A possible solutions is to set the "lock_path" of all the services to
the same location, which is not great, not only because we'll have all
nova, cinder, glance, and os-brick locks mixed in a single location
(service prefixes help a bit here), but also because then Cinder will
have permissions on the Nova and Glance locks, which doesn't seem right.

This patch introduces a new mechanism in os-brick to have its own
"lock_path" configuration option in the "os_brick" group.  It defaults
to the current behavior if not explicitly defined, so it will use olso
concurrency's "lock_path".

To do this the patch introduces the oslo.config dependency and adds a
new "setup" method that sets the default of the os_brick "lock_path".

This new "setup" method is required because the order in which
configuration options for the different namespaces are imported cannot
be guaranteed, so the setup must be called *after* the service has
already imported all (or at least the ones os-brick cares about)
configuration option namespaces.

In other words, when os-brick files are loaded the value for oslo
concurrency's "lock_path" is not yet known, so it cannot be used as a
default, and the oslo_config substitution feature does not support
values from other namespaces, so we cannot default the "lock_path" from
the os_brick namespace to the value in "oslo_concurrency".

Since the value that is going to be used as the "lock_path" is not known
until the "setup" method is called, we cannot use the standard
"synchronized" method from "oslo_concurrency.lock_utils" and we need to
use our own.

In the current os-brick code, each connector that requires a lock is
importing and creating its own "synchronized" instance, but this patch
changes this behavior and creates a single instance, just like Cinder
does.

This feature requires changes in multiple projects -os-brick, cinder,
nova, glance, glance_store, devstack- to be fully supported, but this is
the base of all this effort.

Change-Id: Ic52338278eb5bb3d90ce582fe6b23f37eb5568c4
2022-07-15 09:21:19 +00:00
Zuul 99b2c60fcc Merge "Dropping explicit unicode literal" 2021-03-12 23:36:22 +00:00
Brian Rosmaita 9a59547a4b Update requirements for wallaby release
Raise the minimum versions in the various requirements files to
reflect what we're actually testing with right now.

Change-Id: Ie7dcc859e1291bd1d50b1ae516be38d8732de836
2021-03-04 21:03:58 -05:00
tushargite96 7cfdb76edd Dropping explicit unicode literal
In python 3, all strings are considered as unicode string.

This patch drops the explicit unicode literal (u'...')
or (u"..") appearances from the unicode strings.

Change-Id: I833d797cdc14fc360575d7df5026b51e96c367ef
2021-02-17 19:06:56 +05:30
Lucian Petrut 4d4c5e82c9 Update requirements
The latest pip version has a stricter dependency resolver,
which broke the "lower-constraints" job for quite a few openstack
projects, including os-brick and cinder.

This change alings the os-brick dependency version constraints with
the ones used by Cinder, thus fixing the lower constraints job.

Change-Id: I4a6ac7ec0974372dc6f1585a797c7023c2fd8d78
2020-12-14 15:01:54 +00:00
Sean McGinnis 360154bbf9 Remove CORAID AOE connector
The CORAID driver was removed many cycles ago. This cleans up os-brick
and removes the unused connector.

Depends-on: https://review.opendev.org/745393

Change-Id: I45ac41509f8fec9eb8f57aa03bcfb439a361b561
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-08-25 16:41:54 -04:00
Andreas Jaeger 76c6b3ad96 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems

Update Sphinx version as well.

Set openstackdocs_pdf_link to link to PDF file. Note that
the link to the published document only works on docs.openstack.org
where the PDF file is placed in the top-level html directory. The
site-preview places the PDF in a pdf directory.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

Remove docs requirements from lower-constraints, they are not needed
during install or test but only for docs building.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I4ce76439f598b73d0520577bb3b47c7f28ed3663
2020-05-21 17:10:15 +02:00
Sean McGinnis 58fb18e1c2
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I4927ff7bbdb737884055dd584bc37bd9e93827be
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 16:22:50 -05:00
Zuul 3be101e628 Merge "doc/source/conf.py is not executable" 2020-03-06 17:35:31 +00:00
Eric Harney 2fa4c86cce doc/source/conf.py is not executable
Remove the executable bit from this file.

Change-Id: Ic50f5fc24dad672d9fbe09df635529716f5e9d75
2020-03-06 12:10:02 -05:00
Brian Rosmaita 304251007e Ussuri contrib docs community goal
This patch standardizes CONTRIBUTING.rst and adds
doc/source/contributor/contributing.rst

Change-Id: I0fb219c678991078a592ef4c06890c1a14e7af0d
2020-03-05 09:11:33 -05:00
Brian Rosmaita e883a65444 Drop requirements for unsupported python versions
We stopped testing against py2 with commit df2a396, so remove
unsupported python versions from the requirements files.

Change-Id: I2aca65d734d7b6089f0e3ad7836f509f4b968098
2020-01-09 09:03:55 -05:00
Andreas Jaeger 4467a594b8 Change PDF file name
The previously choosen PDF file name conflicts in some repos with the
project logos (badge). Thus change https://review.opendev.org/679777
renames the desired PDF name to be doc-PROJECT.pdf to allow using the
badge in PDF files.

Follow this rename.

Change-Id: I6fbddc841039a9a66998b4ca7ae81742852d12ae
2019-09-04 06:51:27 +02:00
Zuul 57caf9fffd Merge "Add pdf documentation build in tox" 2019-08-30 09:23:00 +00:00
Walter A. Boring IV 132a531e17 Add pdf documentation build in tox
This patch adds a tox command -e pdf-docs for building the pdf
documentation for os-brick.

Change-Id: Ib56ef75468bbbd39fcfec869c42ba4377ecbdd2c
2019-08-29 11:41:33 -07:00
pengyuesheng 7465d90254 Bump the openstackdocstheme extension to 1.20
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.

Change-Id: I2281904c98f574dc5f42f31a12ebf5d1a4bdb48c
2019-08-02 14:59:41 +08:00
caoyuan 255b5c8c8a Replace git.openstack.org URLs with opendev.org URLs
Change-Id: Ib380ce9533dc54544257418cef6449cf8525219d
2019-04-23 20:55:14 +08:00
Stephen Finucane 4fc0a51a17 doc: Restructure docs for doc-migration
We have three populated sections:

- install
- user
- reference

There are three docs removed, as they served little useful purpose and
were mostly unreferenced.

Sphinx's 'warning-is-error' option is enabled to catch the few issues
that has snuck into the docs.

Change-Id: I04e426faf337f0b03175f439c80b3369d4066733
2017-08-08 15:44:29 +01:00
Stephen Finucane f3eb28dcf6 doc: Remove cruft from conf.py
Clean up both the releasenotes 'conf.py' and some remaining pieces of
the main 'conf.py'. In the case of the former, it looks like this was
copied from Cinder's config, and retains a lot of unnecessary config for
same. Remove it all.

It is also necessary to remove a docstring from 'os_brick/__init__.py',
as this was causing build issues. No idea how this was building
previously.

Change-Id: I2ca913c2ebcf2030642b18c72af180bb8f03b288
2017-08-08 15:44:29 +01:00
Van Hung Pham b2cc3c99f7 doc: Switch from oslosphinx to openstackdocstheme
Change-Id: Iedc8d2b1f75701b7fa92c53629b60701e2a2e659
2017-08-08 15:44:21 +01:00
Alfredo Moralejo 45145eb9c9 Retire ISERConnector from documentation
ISERConnector was retired in https://review.openstack.org/#/c/193451
but it remains in the documentation. This produces errors at
build time.

Change-Id: I76918931264816a04fca981e02bdaafd59072dd9
2016-04-27 05:48:08 -04:00
Sean McGinnis 4b3dbdcb2f Add reno for release notes management
Adopt reno for release notes like we have done for cinder.
One difference for the client is we will not be backporting
to Liberty per recommendation here [1].

[1] http://lists.openstack.org/pipermail/openstack-dev/2015-November/080694.html

Change-Id: I8f0ea1e23cb60d9f5a2a41ee440c47716bb7a3f8
2016-01-20 19:19:36 -06:00
Doug Hellmann 11355ac583 Use pbr's automatically generated changelog
Manually maintaining the changelog leads to issues when the anticipated
version does not match the version actually tagged. Use pbr's facility
for building a rst changelog automatically instead, to ensure that the
published documentation matches the package.

Change-Id: I9cd8ff88aeebc15db48f47c731725a6b0da152b5
2015-07-17 17:33:42 +00:00
Mike Perez 3818872167 Update changelog to 0.3.0 being latest
Switch from 0.2.1 to 0.3.0 per recommendation of release team of this
introducing new drivers.

Change-Id: I20fdb683bd3fafcf0694ad6220ede86558fd3146
2015-07-14 12:23:09 -07:00
Mike Perez 7993a70a39 Prep for 0.2.1 release
Change-Id: Ic057bad9e7ab3816ffa7d5c4b7930adc685ab43a
2015-07-08 17:42:32 -07:00
Mike Perez 28f3d0950f Preparing for the 0.1.1 release
This is to resolve some conflict issues we're seeing in
global-requirements.

Change-Id: Ib523337c13c49e7fd63bab8ab8738a5b60c1cee2
2015-05-19 12:19:10 -07:00
Walter A. Boring IV b3a392e5a2 Update the documentation for os-brick
This patch intends to update the base documenation that is built
for the os-brick library.  It includes the API documentation,
changelog, tutorial.

You can generate the documentation by running:
tox -edocs

DocImpact
Change-Id: Ia0fe0118207bbdc3cf698dfe09c0b71ebddd57f3
2015-02-19 14:37:13 -08:00
Walter A. Boring IV 81b1dbebdf Created the Brick library from Cinder
This is the external Brick library that came from
Cinder's codebase.  It's intended to be used as a
standalone library and subproject of Cinder.
2015-01-22 19:09:30 +00:00