Commit Graph

31 Commits

Author SHA1 Message Date
Tom Weininger 6bbdd48815 pyupgrade changes for Python3.8+ (7)
Result of running

$ pyupgrade --py38-plus $(git ls-files | grep ".py$")

This was inspired by Nova [1]

Fixed PEP8 errors introduced by pyupgrade by running:

$ autopep8 --select=E127,E128,E501 --max-line-length 79 -r \
  --in-place octavia

and manual updates.

[1]: https://review.opendev.org/c/openstack/nova/+/896986

Change-Id: I9399730fed16b85686caa586788a1bc03ebd123a
2024-04-10 10:35:37 +02:00
Gregory Thiemonge 6c0515c988 amphorav1 removal
Removing the amphorav1 provider, it was deprecated in Zed and can now be
removed in Bobcat 2023.2.

Change-Id: I2ecfc0f40549d80b3058b76c619ff4ef35aadb97
2023-04-05 09:23:06 +02:00
Spencer Harmon 70257eb6b3 Add event notifications for load balancers.
This patch creates tasks for load balancer notifications and adds them to the amphora loadbalancer create/delete/update flows.

Change-Id: I287d89cd83e91473f1375788c969521aa58ca567
2022-07-29 10:07:02 -05:00
Brian Haley 91ee39a9d6 Remove some miscellaneous sanity check code
Since the tempest tests are in another repository, this
code serves no purpose so remove it.

Change-Id: I73ede8d646cf874a433bc995bb25fc32c4fa04d8
2021-03-10 11:23:48 -05:00
Brian Haley a4aa03d3bc Fix the unit test tree structure
There were a few unit test files that didn't match their
code counterparts, so were a little hard to find. Moved
things around to line-up better, leaving only a handful
of exceptions to ignore. Added a test script to check
things so it won't happen again, copied from Neutron.

No actual code was changed, files were just moved around.

Change-Id: I6d84047b3481a2bf6bf9bd17d482fb504dbc752b
2021-01-14 15:55:35 -05:00
Michael Johnson 6c8c4f18fd Fix requirements.txt for Victoria
There are a couple of extra requirements no longer used and one
that was missing. This patch corrects that.

Change-Id: I5f45e6f0f15bca201c3ef63f2e42a183510f5977
2020-09-17 21:45:18 +00:00
Michael Johnson d5fe092a3e Update amphora v2 for the failover refactor
This patch will update the amphora v2 code for the failover refactor[1].

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

Change-Id: I43803d0b750e8ca4722ababe296f2725148da405
2020-09-03 11:48:14 +04:00
Michael Johnson 955bb88406 Refactor the failover flows
This patch refactors the failover flows to improve the performance
and reliability of failovers in Octavia.

Specific improvements are:
* More tasks and flows will retry when other OpenStack services are
  failing.
* Failover can now succeed even when all of the amphora are missing
  for a given load balancer.
* It will check and repair the load balancer VIP should the VIP
  port(s) become corrupted in neutron.
* It will cleanup extra resources that may be associated with a
  load balancer in the event of a cloud service failure.

This patch also removes some dead code.

Change-Id: I04cb2f1f10ec566298834f81df0cf8b100ca916c
Story: 2003084
Task: 23166
Story: 2004440
Task: 28108
2020-06-18 16:25:21 -07:00
Michael Johnson fafabad042 Switch oslo.policy over to yaml
Oslo.policy is moving away from using json format policy files[1].

This patch updates the Octavia documentation, policy configuration file, and
legacy admin-or-owner policy file to be in yaml format.

Octavia will continue to honor and support the json format file as long
as oslo.policy does, but this patch will encourage new deployments
to use the yaml format.

[1] https://docs.openstack.org/oslo.policy/latest/admin/policy-json-file.html

Change-Id: I925cc05981e677c0552b18f845fdbc512d2af22c
2020-06-08 08:54:07 -07:00
Brian Haley f6b957e8ee Remove all usage of six library
Convert all code to not require six library and instead
use python 3.x logic.

Created one helper method in common.utils for binary
representation to limit code changes.

Change-Id: I2716ce93691d11100ee951a3a3f491329a4073f0
2020-03-18 17:15:26 -04:00
Brian Haley 98448dce44 Add bash script style checker to pep8 check
Added the bashate script style checker to the pep8
check target in tox.ini. It actually found two valid
issues - a bad function declaration and a local variable
issue, but mostly just indentation noise. Fixed all the
complaints.

Change-Id: I43b60e7dcf53acf259c8a52b248fbb8c63d3c8d4
2019-10-10 13:54:58 -04:00
Zuul 3ab36c8a15 Merge "Generate PDF documentation" 2019-09-20 07:05:15 +00:00
Michael Johnson 97058e925b Generate PDF documentation
This patch sets up PDF document generation for Octavia.

Story: 2006101
Task: 35146
Change-Id: I076335d08d5411fd629c3e8860f14980b0dbcb5a
2019-09-19 13:12:37 -07:00
Michael Johnson 05f5257075 Fix a few nits from the main volume-based patch
I had a few minor nits on the volume-based patch. This patch
corrects those.

Co-Authored-By: Adam Harwell <flux.adam@gmail.com>

Change-Id: I5f9ce36c878973f4ed96527af6f1024a362421d8
2019-09-12 10:32:45 +00:00
Michael Johnson 0ab16921ae Create Amphora V2 provider driver
This patch creates an Amphora v2 provider driver as well as a
V2 controller worker.
This is in preparation for having the amphora driver use the new
provider driver data models and rely less on native Octavia database
access.
It is also a prepartion step for enabling TaskFlow JobBoard as
this work will move to storing dictionaries in the flows instead
of database models.

Change-Id: Ia65539a8c39560e2276750d8e79a637be4c0f265
Story: 2005072
Task: 30806
2019-06-05 14:30:29 -07:00
Michael Johnson 9ce614ad84 Speed up pylint by using multiple cores
This patch tells pylint to spawn multiple sub-processes to review the code.
The number of sub-processes is default to the number of cpu cores/threads.
On systems with multiple cores this will speed up the checks.
It adds the '-j 0' flag to the pylint run.

Change-Id: I57bb487542417ded264462996b89fbef9fc1df59
2019-02-17 14:09:20 +00:00
Michael Johnson 0139f12c2e Fix failover when multiple amphora have failed
If a load balancer loses more than one amphora at the same time
the failover process will fail and leave the load balancer in
provisioning status ERROR.

This patch resolves this by failing over one amphora at a time
marking any amphora that are also failed in status ERROR. The health
manager will then failover the other failed amphora in subsequent checks.

This patch will update multiple healthy amphora in parallel and will
timeout failed amphroa using the new "active_connection_max_retries"
configuration setting used for "fail-fast" connections.

The patch also updates the amphora failover flow documentation to
show the full flow and not just the spares failover flow.

It updates the amphora driver "get_diagnostics" method to pass instead
of error.

It also adds a AmphoraComputeConnectivityWait task to explicitly wait
for a compute instance to come up and be reachable. This allows a longer
timeout and clarifies this may fail due to compute (nova) failures.
Previously the first plug vip task would do this wait.

Change-Id: Ief97ddda8261b5bbc54c6824f90ae9c7a2d81701
Story: 2001481
Task: 6202
2018-07-22 16:08:45 -07:00
Doug Hellmann 0322cbc5c3 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

This patch also updates pylint to 1.5.6 which is compatible with
python3.
In updating pylint we have some issues to correct, this patch addresses
those issues so the Octavia code passes pylint 1.5.6.

Change-Id: Iec21f4c803a427059d595612336d67a35ebf9585
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-27 09:32:00 +08:00
Adam Harwell 96cce3ed74 Fix amp failover where failover already failed
If a failover ran on an amphora and was unsuccessful and reverted, it
would mark the amp status "DELETED" and un-busy the health record.
It would then be picked up on the next failover check, start failing
over, and break early since it appeared to be "unallocated".

Also, housekeeping can now clean up expired amphora records based on the
amphora's updated_at time instead of the health record's time, which
means the records won't be immediately cleaned up anymore after they go
through failover flows.

Change-Id: I848b7fc69b977fcb39f8a07e2ea5fc7bd37b5c7a
2018-06-05 14:10:00 -07:00
Carlos Goncalves 7f3506b295 Migrate to stestr
This patch updates tox.ini to directly call stestr instead of ostestr
[1]. ostestr is no longer installed by default by infra.

For more info on stestr, please refer to [2].

[1] http://lists.openstack.org/pipermail/openstack-dev/2017-September/122135.html
[2] http://stestr.readthedocs.io/en/latest/MANUAL.html

Depends-On: https://review.openstack.org/#/c/550282/
Change-Id: Ie6a275170ec6faf0db3976410660f52078710a54
2018-03-07 11:57:31 +00:00
Dong Jun 344b8fa871 Support pylint
Support pylint for octavia, some harmless rules are added to messages
control group.

Change-Id: I88577b1ab918fc7a19b2323ca652bde7ffad64ef
2017-10-16 09:32:41 +08:00
Adam Harwell 45e39fa216 Allow PUT to /pools/<id>/members to batch update members
Also fix an incorrect exposure of /healthmonitors on /pools and a badly
ordered flow for member updates.

Change-Id: Id256ea94293519b75983f7a44945ac9bbbf25cd1
Implements: blueprint member-put-list
2017-09-20 18:14:53 -07:00
Michael Johnson 93c8e006ce Update Octavia docs for documentation migration
This patch updates the Octavia documentation in support of the
OpenStack documentation migration[1].

[1] https://specs.openstack.org/openstack/docs-specs/specs \
    /pike/os-manuals-migration.html

Change-Id: I97fd038b8050bfe776c3fca8336d9090f8236362
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
2017-07-03 11:43:40 -07:00
johnsom 86698b2be2 Fix the amphora failover flow docs diagram
The spare pool failover patch changed the logic of the failover flow
and cause the flow diagram generation to only render part of the flow.
This patch updates the diagram generation to show the whole failover
flow.

Change-Id: I8dc49f0ca74054869ec42fee4236533acb24eb3a
2017-02-08 16:21:42 -08:00
Gary Kotton 4edcf3a8df Add context to unit tests
When running the unit tests we will now see which tests is being
run and the status of the test in question. This will help debugging,
triaging and cleaning things up.

Change-Id: I6d1458654d2fb6a8e814b17c4673bb9337fac4ec
2017-01-01 01:50:56 -08:00
Michael Johnson ad828709a7 Setup translation for octavia
This patch sets up octavia for translations.
It also includes some additional pep8 tests borrowed from neutron
that will be used in the future (tempest idempotent ids and policy.json)

Change-Id: Ia70506fa8cfdbcea7cc67b940761365093e94f2b
2016-12-15 00:48:02 +00:00
Henry Gessau 549b1ce29d Remove last vestiges of oslo-incubator
This is a community goal for Ocata.  We're already not using any of
the code, but there are some other files and references left over.

This file used to be installed from oslo-incubator:
  tools/install_venv_common.py
It was meant to be used by the legacy run_tests.sh, which does not
exist in this repo.

Change-Id: I5040101102167ae3c2701019ceaad8bf8833a3c1
Partial-Bug: #1639103
2016-11-03 22:43:47 -04:00
Stephen Balukoff a27b5c418a Add support for PKCS7 bundles and encrypted keys
This commit adds the ability for Octavia to make use of PKCS7
intermediate certificate bundles. These PKCS7 bundles may be in PEM or
DER format. This feature is being added since barbican specifies that
this is the preferred format for intermediate bundles in secret
containers.

This commit also re-arranges and/or strengthens several of our existing
tests of TLS / SNI functionality and in the process also fixes a bug
where encrypted private keys were not uploaded to amphorae in a format
that haproxy can readily parse. I have also added several sample or
dummy certificates which can be used for an up-coming scenario test
which exercises TLS-termination capabilities of Octavia.

Change-Id: I14e394bbf48456d2e2a7bbefcc777a1b6f4b83e4
Closes-Bug: #1627356
Closes-Bug: #1627367
2016-10-05 19:51:51 -07:00
Lubosz "diltram" Kosnik aae434e19a Rewrite create_load_balancer flow
Join two flows (create_lb_tf, post_lb_amp_assoc) into one

Change-Id: I68deb7a9795cbb135dbbef5dea0bfc6aa89db5b3
Closes-Bug: #1552599
2016-08-28 09:46:55 -05:00
Michael Johnson bc2e9beb3a Adds a process to generate key flow documentation
Octavia extensively uses TaskFlow flows for orchestration.
To make it easier for developers to understand these flows,
this patch adds a mechanism for generating graphviz representations
of the key Octavia TaskFlow flows.
It also updates our tox docs task to generate this documentation.

This patch depends on a fix to the TaskFlow export_to_dot method.

Added into conf.py as first step of configuration

Closes-Bug: #1561063
Change-Id: I914e1c062b400148565def37ccf618b3d2ea2573
Depends-On: I99f87af0b2bed959fcb43ef611b3186e23bd9549
2016-08-10 21:39:38 +00:00
Doug Wiegley 74eee09e4b Initial directory skeleton
Implements: blueprint initial-skeleton
Change-Id: If6559f5e1adf4aee70f5d92b5dfcf9fead86b205
2014-09-04 15:28:10 -06:00