Commit Graph

43 Commits

Author SHA1 Message Date
Riccardo Pittau 6513d3db37 Fix CI
Sync with ironic configuration to fix grenade job
Drop lower-constraints.txt and its testing (was [1])
Fix ironic-inspector-tempest-managed-non-standalone sine we're here

[1] https://review.opendev.org/c/openstack/ironic-inspector/+/840075

Change-Id: I9b08c6e61c39a0e5616e51256f76a19dc5fd00c0
2022-05-09 09:31:55 +02:00
Riccardo Pittau 424b53e55d Add lower-constraints job to current development branch
The lower-constraints test was removed because of an issue where pip
could not correctly determine the required packages versions to install,
ending in an almost infinite loop that would end up in timeout, failure,
and general mayhem.
Recently the issue has been fixed and, if properly configured, the
lower-constraints test can provide good indication of which minimum
versions are required to support the current code.
This patch adds the test back to the current development branch, and it
runs only on master.
The lower-constraints file will stay in the future stable branches.

Change-Id: I2e247ff2d68705d04d40c7ea653a8d3e0daf17d8
2021-08-05 12:20:59 +02:00
Riccardo Pittau c6fdf25116 Remove lower-constraints job
As discussed during the upstream ironic community meeting on
Monday Dec 14 2020, the lower-constraints job is being removed.

Change-Id: I943b63b9c6a980011b35bb028c64bee18d772750
2020-12-15 18:43:48 +01:00
Riccardo Pittau caf9256b22 Fix lower-constraints with the new pip resolver
Remove pep8 dependencies from test-requirements, they're not
needed there and are hard to constraint properly.

Change lower-constraints to make pip happy and not require infinite
time to calculate dependencies.

Change-Id: Id524ad2bd2994fefadd6a3ad728123a0a1a49dc8
2020-12-10 06:04:30 -08:00
Iury Gregory Melo Ferreira 9a89c30479 Fix l-c and mysql GRANT syntex for Ubuntu Focal
Also fixing user creation with GRANT in MySQL 8.0(Ubuntu Focal)
Ubuntu Focal (20.04) has mysql 8.0 and with mysql 8.0 there
is no implicit user creation with GRANT. We need to
create the user first before using GRANT command.
Change-Id: I4c0469628e82e86b4023a9b011d09f20f9b66aac
2020-09-11 14:36:56 -05:00
Riccardo Pittau f4648facf7 Replace retrying with tenacity
We are replacing all usages of the 'retrying' package with
'tenacity' as the author of retrying is not actively maintaining
the project. Tenacity is a fork of retrying, but has improved the
interface and extensibility (see [1] for more details). Our end
goal here is removing the retrying package from our requirements.

[1] https://github.com/jd/tenacity

Change-Id: I660192549918b9cd9738810cbfaf3dc4456f97fa
Story: #1635390
Task: #40647
2020-08-18 15:11:16 +02:00
Julia Kreger 6e2cb60e77 Respond so Apache HTTPd doesn't think the request failed
When sending a literal empty response, Flask does not include a
ContentType in the response. While in many cases, we don't need
need a ContentType nor expect one on the API client, Apache
webserver can treat this as an error and generate an Error
indicating a Bad Gateway. When doing this, we also now include
an empty JSON body in the response for 202 messages. For 204
message errors, the message body is expected to be empty.

However, when this Bad Gateway error occurs, the API/Conductor
were proceeding like there was no issue. The API client on the
other hand thinks that a hard failure has occured.

Also adds some additional catches to provide additional logging
which turned out not to be needed in this case, but it would be
useful for others.

Change-Id: If2e7697e3fde58ab0a4193787e29d3acdca81ebf
2020-07-22 10:18:00 -07:00
Steve Baker 2532be9e05 Document [ironic] auth options for inspector
This change documents configuring inspector for client-side
authentication with a standalone Ironic API service.

Since this documention refers to a keystone auth feature which is
about to be released, requirements and lower-constraints are updated
to reflect the required release (see https://review.opendev.org/737365 ).

Change-Id: I567fc8c7f2147339856563ad880334791f93d99b
2020-06-23 13:35:12 +12:00
Hervé Beraud 80167d4908 Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: Iccf78a04a66dcef383d9e38ac3990f3c838bdf84
2020-06-10 20:21:00 +02:00
Steve Baker 196c019771 Enable Basic HTTP authentication middleware.
When the config option ``auth_strategy`` is set to ``http_basic`` then
non-public API calls require a valid HTTP Basic authentication header to be
set. The config option ``http_basic_auth_user_file`` defaults to
``/etc/ironic-inspector/htpasswd`` and points to a file which supports the
Apache htpasswd syntax[1]. This file is read for every request, so no
service restart is required when changes are made.

The only password digest supported is bcrypt, and the ``bcrypt``
python library is used for password checks since it supports ``$2y$``
prefixed bcrypt passwords as generated by the Apache htpasswd utility.

To try basic authentication, the following can be done:

* Set ``/etc/ironic-inspector/inspector.conf`` ``DEFAULT`` ``auth_strategy``
  to ``http_basic``
* Populate the htpasswd file with entries, for example:
  ``htpasswd -nbB myName myPassword >> /etc/ironic-inspector/htpasswd``
* Make basic authenticated HTTP requests, for example:
  ``curl --user myName:myPassword http://localhost:6385/v1/introspection``

[1] https://httpd.apache.org/docs/current/misc/password_encryptions.html

Change-Id: If50dfbfc18445ad9fe27e17cb0ee1b317ff25a0b
Depends-On: https://review.opendev.org/729070
Story: 2007656
Task: 39826
2020-06-05 01:28:40 +12:00
Riccardo Pittau 5004f93867 Update lower-constraints.txt
We need to list all dependencies in lower-constraints

Change-Id: I5b213248be3a522accb48c2698a42f547fc9698a
2020-05-27 16:48:20 +02:00
Hervé Beraud 5960cde402 Cap jsonschema 3.2.0 as the minimal version
Previous versions of jsonschema (<3.2.0) doesn't support python 3.8 [1].
Python 3.8 is part of the victoria supported runtimes [2] so we now force
to use jsonschema version 3.2.0 to avoid issues, remove ambiguity and ensure
that everything works with python 3 in general.

[1] https://github.com/Julian/jsonschema/pull/627
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: I944e60f8c1962bfa3b6478b14e682eeca7948098
2020-05-26 21:50:42 +02:00
Zuul e15cfae6a7 Merge "Bump hacking min version to 3.0.1" 2020-05-26 05:39:53 +00:00
Zuul ace96c47c9 Merge "Stop configuring install_command in tox." 2020-05-25 22:49:39 +00:00
zhangbailin c2224fde50 Bump hacking min version to 3.0.1
flake8 new release 3.8.0 added new checks and gate pep8
job start failing. hacking 3.0.1 fix the pinning of flake8 to
avoid bringing in a new version with new checks.

Though it is fixed in latest hacking but 2.0 and 3.0 has cap for
flake8 as <4.0.0 which mean flake8 new version 3.9.0 can also
break the pep8 job if new check are added.

To avoid similar gate break in future, we need to bump the hacking min
version.

- http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014828.html

Change-Id: I2a903c90d72cd596ef976d9aab478f96a2750680
2020-05-21 07:47:46 +08:00
Andreas Jaeger 68ab6a01b6 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.0 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.

Set openstackdocs_auto_version to not auto-version the documents.

Set openstackdocs_auto_name to use 'project' as name.

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.

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.

Change-Id: I9591e0f0215e9eb790ec2e3ea1a7ccbd55bb76d0
2020-05-20 10:59:56 +02:00
Iury Gregory Melo Ferreira b9f1746643 Stop configuring install_command in tox.
Currently, we are overriding 'install_command' to use 'pip'. This is
considered poor behavior and 'python -m pip' should be used instead:

https://snarky.ca/why-you-should-use-python-m-pip/

It turns out that this is the the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

So we can remove the line and simply use the default value.

openstack-discuss thread
http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014237.html

Bumping requirements and l-c with:
keystoneauth1 3.18.0
alembic 0.9.6
pika 0.10.0 (necessary for installation)
Change-Id: I849342bd077ab2f8bbda4e0a228c308eb7a4908b
2020-05-14 14:56:26 +02:00
Riccardo Pittau 721bd814a6 Use latest version of python construct
Also increasing minimum version to 2.9.39 for String class name
change to PaddedString.

Change-Id: Ie7b80f4698a77208c89797b82f7e41fcd8dbf168
2020-05-14 10:37:07 +02:00
Zuul 1299bdc322 Merge "Upgrade flake8-import-order version to 0.17.1" 2020-04-27 22:53:48 +00:00
Riccardo Pittau 61cd2af2cb Upgrade flake8-import-order version to 0.17.1
Full py3 compatible version.
Add all Python3 modules to stdlib list.
Also includes fix to an enum34 dependency bug.

Change-Id: I26bc2d06e04f85fff05e4af5e0d16e7f9db3a1e7
2020-04-21 15:15:21 +02:00
Andreas Jaeger 1a8c1bb370 Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Switch to using sphinx-build with apidoc extension
- Use newer openstackdocstheme version
- Remove Babel requirement, this is not needed.

Change-Id: I4176d8002d45449171aa5f7a7caef196ab7900d0
2020-04-20 08:18:51 +02:00
Riccardo Pittau 75437072da Bump hacking to 3.0.0
Change-Id: I6adf3234faa93bc186c892d3e9f1a54a6d70d41d
2020-03-30 11:46:20 +02:00
Riccardo Pittau 4eefb42550 Finalize ironicclient removal
Completely remove dependency from ironicclient in favor of
openstacksdk.

Change-Id: I9b98ddb05fe867a0d3884f736a2edd7b4d61b00c
2020-03-25 10:08:38 +01:00
Riccardo Pittau 3accdfbbc6 Use openstacksdk for ironic module
This patches removes the ironic-client dependency from the
ironic module in favor of openstacksdk.

Increase minimum required version of openstacksdk to use
recent added features.

Change-Id: I31964179835ad454e8205a59f483b419de4fb62d
2020-03-23 14:28:09 +01:00
Riccardo Pittau ba8ecd3cf5 Stop supporting Flask < 1.0
Latest version of Werkzeug (1.0.0 at the moment) broke
compatibility with older Flask, actually causing issues when
running lower-constraints tests, since Flask will install
highest version of Werkzueg after 0.7.
With this patch we require Flask to be at least version 1.0
to re-establish compatibility.

See failed test https://review.opendev.org/706701 or run
lower-constraints test locally for confirmation.

Change-Id: Id05b4a205379fdf1b26cb239757bd370f3fe88e3
2020-02-10 10:59:43 +01:00
Riccardo Pittau 9b1450398c Stop using six library
Since we've dropped support for Python 2.7, it's time to look at
the bright future that Python 3.x will bring and stop forcing
compatibility with older versions.
This patch removes the six library from requirements, not
looking back.

Change-Id: Ic443c7e4d5a5a849c4dc220207f8957e4c90bf53
2019-12-17 09:23:01 +01:00
Riccardo Pittau 96c5e6516c Limit lower-constraints.txt to only direct dependencies
Also increasing lower version of keystoneauth1 to a recommended
version for openstacksdk >= 0.30.0

Change-Id: Ifb9bbb8d091f28a8d65444caaeba301e2f707a14
2019-11-22 12:30:36 +01:00
Riccardo Pittau d3aee899a1 Raising minimum version of oslo.db
oslo.db was not compatible with Python 3.7 until version 4.40.0
because Python 3.7 makes "async" a keyword [1].
To prevent bad surprises, this patch increases the minumum version
required for oslo.db to 4.40.0.

[1] https://review.opendev.org/574833

Change-Id: I6b915a0b0f78690defa962be96c8ae9d35d69345
2019-10-07 14:46:26 +02:00
Zuul e98dd384de Merge "Build pdf doc" 2019-09-13 13:10:25 +00:00
Kaifeng Wang 76cbd2dbbb Build pdf doc
The is one of community goals that each project could produce a
single PDF file. The pdf should be in the output of openstack-tox-docs
job.

TeX packages are required to build PDF locally, following is recommended:

* inkscape
* texlive-latex-base
* texlive-latex-extra
* texlive-fonts-recommended

More about the goal:
https://governance.openstack.org/tc/goals/train/pdf-doc-generation.html
https://etherpad.openstack.org/p/train-pdf-support-goal
https://etherpad.openstack.org/p/pdf-goal-train-common-problems

Change-Id: I784be3f2462184ce951cb27e68e578f8befaa580
2019-09-06 15:58:06 +08:00
Kaifeng Wang 9b92204ef1 Adds job to run inspector in non-standalone mode
The job uses memcached for coordination backend, etcd3gw still has issue
on retrieving members.

Story: 2001842
Task: 30376

Change-Id: I76c359d6835e435968cbfb1a3f4318e73f0203ec
2019-08-22 11:27:45 +08:00
Kaifeng Wang 1bed475409 Adds tooz locking driver
Adds tooz requirements, configuration options and locking support.

Story: 2001842
Task: 30376

Change-Id: I78ffdeeb502cbed0550152b19efbb224f47c65af
2019-08-02 09:58:10 +08:00
Kaifeng Wang f979456c16 testenv does not install requirements
Fix testenv which only installs test-requirement, also updated
upper constraint url.

mock minimum version is bumped to 3.0.0,
keystonemiddleware minimum version is bumped to 4.18.0.

Change-Id: I162bcf372598c2268c9c5e30947e49eedb0147e3
2019-07-16 10:38:14 +08:00
Dmitry Tantsur 85a3186d50 Use openstacksdk for accessing Swift
This change replaces the swiftclient dependency with openstacksdk.
The ultimate goal is to use only openstacksdk for all cross-service
interactions.

The configuration option max_retires has been broken for several
releases since commit 7e8cdc0d0f,
this change deprecates it.

Change-Id: I635519f88e90f4267ff7a9cb063a697ff39e4710
2019-06-19 14:49:03 +02:00
Kaifeng Wang 52349c6c0a Incorporate bandit support in CI
Change-Id: I1beded7e0198a5b5b43df00a355cf1c59cf2dc27
Story: 2005791
Task: 33563
2019-06-05 08:44:38 +08:00
Dmitry Tantsur 258d7388a4 Expose baremetal-introspection endpoint via mdns
This change adds an option to publish the endpoint via mDNS on start
up and clean it up on tear down.

Story: #2005393
Task: #30384
Change-Id: Ia9407cb065979aac6761d3e4122d3884e45b559d
2019-05-22 13:58:55 +02:00
Kaifeng Wang edd6810c3d Wrap Flask into oslo.service
This patch is part of inspector HA work, which wraps inspector api into
oslo service.

oslo.service has also provided support to signal processing like SIGHUP or
SIGTERM, so these code were removed in this patch.

Deprecated current SSL cert/key options used by ironic-inspector, code
manually creates ssl context were removed. These options will be fed
from [ssl] section.

Change-Id: Ia5e16fcb9104556d62c90f5507f17b41f73a5208
Story: #2001842
Task: #12609
2018-10-23 09:20:16 +08:00
Anton Arefiev 05a86b3d57 Add API reference
Add initial API reference, which covers all inspector endpoits.

The conf.py and the tox environment are stolen from ironic.

Co-Authored-By: Kaifeng Wang <kaifeng.w@gmail.com>
Change-Id: I5009e8708dcad8ab25380f7bf574125d6e758ef5
2018-10-16 16:50:01 +08:00
Dirk Mueller 9be2d68820 Remove unused pydot3 dependency
https://review.openstack.org/#/c/460938 switched from pydot2
to pydot3, but also removed the last remaining use of pydot2/3.

Drop the dependency alltogether.

Change-Id: I678cbe65a283b7562bef399c34ddde02c500648f
2018-08-08 15:39:08 +02:00
Chuck Short cce25ed22e Switch to using stestr
According to Openstack summit session [1] stestr is maintained project
to which all Openstack projects should migrate.

Let's switch it then.

Also adjust requirements to pass the gate.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I79b2220c20a04e2e33360bc330b5b4b4124caf71
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-07-14 07:49:50 -04:00
Kaifeng Wang 6469a1fc0f Introduce oslo.messaging and sync rpc call
Adds oslo.messaging to ironic-inspector, and convert
inspect, abort and reapply to synchronized rpc calls.

This is the first step of API and worker seperation.

Change-Id: I15e86d7feb623b6b2889891b9700e5de6b3164cd
Story: #2001842
Task: # 12609
2018-05-06 21:07:25 +08:00
Doug Hellmann 3b3a3ef20b Fix lower constraints and uncap eventlet
Fix the lower constraints settings to match the expected values.

We will manage the eventlet version using constraints now. See the
thread starting at
http://lists.openstack.org/pipermail/openstack-dev/2018-April/129096.html
for more details.

Change-Id: Ic44a750002943920c2f517f22df670989460dbc9
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-23 10:53:07 -04:00
Doug Hellmann 5113ef51c5 add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: I8a5c47cb8e4d623776cd4335754184f6f7f0d398
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 13:44:49 -04:00