Commit Graph

25 Commits

Author SHA1 Message Date
Sean Eagan a5730f8db8 Remove Tiller
For now we leave the tiller status enpdpoint, until
Shipyard has had a release to stop depending on it [0].

[0]: https://review.opendev.org/c/airship/shipyard/+/802718

Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
Change-Id: If8a02d7118f6840fdbbe088b4086aee9a18ababb
2021-10-05 02:41:32 +00:00
Sean Eagan 8c5e5c7d24 Remove unused commands
This removes release rollback/delete functionality. This functionality
was likely not being used and thus was likely not working.

This primary driver for this change is to ease introduction of Helm 3
support. Particularly to avoid having to make API changes related to
the namespacing of helm releases in Helm 3.

This also removes the swagger api documentation as it was not
maintained.

Change-Id: I7edb1c449d43690c87e5bb24726a9fcaf428c00b
2021-09-30 17:22:16 -05:00
Sean Eagan 58c0df5201 Extract pre-update actions out of tiller handler
This is a pre-requisite for Helm 3 integration, so that these
actions run regardless of whether we are going through the
tiller handler.

Change-Id: I97d7bcc823d11b527fcdaa7967fcab62af1c8161
2021-09-30 17:22:16 -05:00
Drew Walters 764e99e325 handlers: Remove dry-run functionality
Armada's dry-run option is incomplete, no longer maintained, and offers
little value for the complexity required to maintain it.

This commit is the final in a series of changes to remove the dry-run
feature. Specifically, this change removes the functionality associated
with the dry-run feature.

Story: 2005121

Change-Id: I7dfe5ab27511debe2b8ac01f8e0a696c6126a9f7
Signed-off-by: Drew Walters <andrew.walters@att.com>
2019-09-05 16:29:04 +00:00
HUGHES, ALEXANDER (ah8742) b787c418e3 Standardize Armada code with YAPF
From recently merged document updates in [0] there is a desire to
standardize the Airship project python codebase.  This is the effort
to do so for the Armada project.

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

Change-Id: I4fe916d6e330618ea3a1fccfa4bdfdfabb9ffcb2
2019-07-31 10:16:15 -05:00
Michael Beaver 3625acc1aa Fix gate failures for Docker and Pep8
- Zuul updated ansible to 2.7, no longer uses missing variables.
- Using an if to try and address.
- Fixes a few formatting problems that are causing the gates to fail

Docker fix based on Aaron Sheffield's PS for Pegleg:
https://review.openstack.org/#/c/645631/

Change-Id: I14e8f3aac0af7a3abc4e2b6c4ece292a24bc4c6a
2019-03-22 13:46:32 -05:00
Sean Eagan c31a961bf1 Automate deletion of test pods
When running helm tests for a chart release multiple times in a site,
if the previous test pod is not deleted, then the test pod creation
can fail due to a name conflict. Armada/helm support immediate test pod
cleanup, but using this means that upon test failure, the test pod logs will
not be available for debugging purposes. Due to this, the recommended approach
for deleting test pods in Armada has been using `upgrade.pre.delete` actions.
So chart authors can accomplish test pod deletion using this
feature, however, it often takes awhile, usually not until they test upgrading
the chart for chart authors to realize that this is necessary and to get it
implemented.

This patchset automates deletion of test pods directly before running tests by
using the `wait.labels` field in the chart doc when they exist to find all pods
in the release and then using their annotations to determine if they are test
pods and deleting them if so.

A later patchset is planned to implement defaulting of the wait labels when
they are not defined.

Change-Id: I2092f448acb88b5ade3b31b397f9c874c0061668
2019-01-28 13:19:09 -06:00
Sean Eagan 7af22df7dc Implement tiller gRPC channel clean up
We have seen issues with dangling threads in Armada. This is likely due to
a bug [0] in the version of gRPC that we were pinned to.

This patchset:

- moves us to the latest versions of the gRPC python libraries which add
  a new `channel.close()` method to cleanup channels.
- implements the python context manager api in the tiller handler
- uses the context manager api to explicitly scope tiller channel creation
  and cleanup to each Armada API and CLI call.

This also fixes a couples issues with error handling introduced in [1].

[0]: https://github.com/grpc/grpc/issues/14338
[1]: https://review.openstack.org/#/c/610384

Change-Id: I2577a20fc76c397aa33157dc12a0e1d36f49733e
2018-11-12 13:32:52 -06:00
Sean Eagan 6b96bbf28d Correctly identify latest release
This fixes the following issues with listing releases from tiller,
which could cause Armada to be confused about the state of the
latest release, and do the wrong thing.

- Was not filtering out old releases, so we could find both a
  FAILED and DEPLOYED release for the same chart. When this is the
  case it likely means the FAILED release is the latest, since
  otherwise armada would have purged the release (and all its
  history) upon seeing the FAILED release in a previous run.
  The issue is that after the purge it would try to upgrade
  rather than re-install, since it also sees the old DEPLOYED
  release. Also if a release gets manually fixed (DEPLOYED)
  outside of armada, armada still sees the old FAILED release,
  and will purge the fixed release.
- Was only fetching DEPLOYED and FAILED releases from tiller, so if
  the latest release has another status Armada won't see it at all.

This changes to:

- Fetch releases with all statuses.
- Filter out old releases.
- Raise an error if latest release has status other than DEPLOYED
  or FAILED, since it's not clear what other action to take in
  this scenario.

Change-Id: I84712c1486c19d2bba302bf3420df916265ba70c
2018-10-19 09:14:15 -05:00
Sean Eagan 5e7c36d2a1 Avoid bug in tiller when both sorting and paging releases
The tiller list releases command has a bug when using sorting
and paging simultaneously. Armada was passing sorting parameters,
but it doesn't really care about the order, so this removes the
sorting parameters to avoid the tiller issue.

Change-Id: If8349a8093d4b79d5e056d988b710372705eb669
2018-10-17 14:47:16 -05:00
Sean Eagan e149afdcbe Use paging to list releases from tiller
Tiller has a non-configurable gRPC max response message size. If the
list releases response reaches this size it silently truncates the
results to be below this size. Thus for armada to be able to reliably
get back all the releases it requests, this patchset implements paging
with what should be a small enough page size to avoid the truncation.

Change-Id: Ic2de85f6eabcea8655b18b411b79a863160b0c81
2018-10-12 21:28:22 -05:00
Marshall Margenau c7c7dc671c Removing dead code.
Change-Id: I7121a6d29691cf8d3e779f2afe9ada7d263c6c9d
2018-07-18 16:04:26 -05:00
Marshall Margenau f235512d57 Adding yapf config, plus formatted code.
- Adding yapf diff to pep8 target
- Adding yapf tox target to do actual format

** The rest of this PS contains formatted code only, no other changes

Change-Id: Idfef60f53565add2d0cf65bb8e5b91072cf0aded
2018-06-22 14:56:04 -05:00
Sean Eagan d91dd8ad70 Fix and overhaul helm test integration
The helm test integration was severely broken, this fixes it by:

* correctly handle tiller test call response
* removes unnecessary call to tiller to get release content
* removes unnecessary call to k8s to check for test pod completion
* moves common logic into a test handler
* adds test coverage for the above
* adds logging for test results streamed from tiller

Change-Id: I09062387a1abc2fc3f6960f987c97248d9e1cb69
2018-06-21 14:41:52 -05:00
Sean Eagan ae690ef828 Expose helm's upgrade/rollback force and recreate pods flags
This exposes helm's force and recreate pods flags for upgrade and
rollback.  It exposes in the chart manifest an options field underneath
the upgrade field to hold options to pass through to helm, and
initializes it with these two flags.  Since rollback is currently a
standalone operation which does not consume manifests, these flags are
directly exposed as api and cli arguments there.

Change-Id: If65c1e97d437d9cf9d5838111fd485c80c76aa1d
2018-06-13 11:28:20 -05:00
Sean Eagan 571c0b77f9 Add command to rollback release to CLI and API
This adds a command to the CLI and API to rollback a release name to a
specified version.

Change-Id: Ie1434da42ccc75c658b7bde7164b3f4c909be7c4
2018-06-06 09:40:31 -05:00
Marshall Margenau d770640b95 Revise wait timeouts plus dry-run.
- revise wait on namespace+label, only wait on ns+label for
  charts we've touched in the current apply loop
- skipping any actions that would change system during dry-run
- skip 'test' and 'wait' during dry-run
- tweaking some logs for insight and readability

Change-Id: I1223f01690832c26ce2faa96e7e64620cf413ac9
2018-05-30 16:19:35 -05:00
hifzasakhi 4758420a2a Add unit tests for Tiller handler
Change-Id: Ic10b26618d8bcec1c4b89387834de4944f099461
2018-02-23 15:12:43 -05:00
Felipe Monteiro 39b5a876fe Add unit tests for Manifest handler
Change-Id: Ia7e1c0861cb79b78a65ad95f50729a85a874a892
2018-02-05 17:14:12 -05:00
gardlt 328592686f fix(tiller): grpc call terminates prematurely
- enhance tiller install grpc timeout
- enhance tiller update grpc timeout

Closes #182

Change-Id: I98d6246f8a09ce3b805cbad18122e269472a1b34
2017-12-08 11:08:38 -05:00
gardlt 0663a308d9 feat(tiller): updating-helm-version-2.6.0
- updated hapi lib
- implemented wait-resource-is-ready

Change-Id: Ia547bec0c83e5dca19c87a99dd2cdbe413d78c06
2017-10-27 16:08:47 +00:00
Omar Rivera 498cf6c98f Fix oslo_config and oslo_log configurations
* Ensure that configurations are done via the global `cfg` object
* Ensure that the logger is configure through the global object
* Upload a configuration sample file with DEFAULT section having
  the armada.conf and oslo_log namespace
2017-08-07 21:43:32 -05:00
gardlt d175e5ef92 [feat] upgrading daemonsets
- rolling update for daemonsets
- search pods by labels
2017-08-01 11:30:54 -05:00
drewwalters96 f4303037cc [Bug] Adds required Oslo configuration to API and unit tests
- Register Oslo logging configurations in server.py, test_armada.py, test_chartbuilder.py, and test_tiller.py
- Add mock to test-requirements.txt
- Update .travis.yml
- Add mock case for tiller IP
2017-06-28 18:03:27 -05:00
Tim Heyer a22d2d0bb0 Implement native tiller timeout support
-Update tiller.py and armada.py to support native tiller timeout
-Update documentation with the new yaml timeout keyword
-Update tiller version to 2.4.2
-Create tests for timeout ability, as well as structure for further test development
-Fix gRPC message size bug
2017-06-27 15:46:30 -05:00