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
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
This patch set drops a redundant pep8 job from .zuul.yaml.
openstack-tox-pep8 is already as a job, so
airship-armada-lint-pep8 can be dropped.
Change-Id: Iaaa0c8d34a2de93b7f105f7c686951df4e3b6824
Fix an issue where release paging failed to break out of the loop when no
releases were found in tiller.
Change-Id: I4a25e58a7f6bdd88941f7f87cba2a0aee261f8be
This patch set is trivial: Drops armada/tests/unit/cli.py
because it is empty. This way it is apparent that Armada
needs CLI unit tests. When they are added this folder
can be re-recreated.
Change-Id: Ice9669aa5b21191d4de646b9035a135a2722a2f9
This patch set combines whitespace linter and pep8 together
(as both do code linting) into the same job by dropping the
.zuul.yaml whitespace-linter job and rolling it up into the
same pep8 tox.ini check, just like Deckhand [0].
[0] 0462b7b929/tox.ini (L106)
Change-Id: I31ed60adfd431157ffc96a0f4d5d77d54af37352
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
While authoring [0], a shell check utility revealed potentially
dangerous usage of quoting in the API entrypoint script. This commit
fixes the quoting to avoid unintentional shell globbing/splitting.
[0] https://review.openstack.org/#/c/609096/
Depends-On: https://review.openstack.org/#/c/609096/
Change-Id: I92877c5c83ea970d5c261e4a9b6a15c58ffc07e5
The Armada API relies on an environment variable, `ARMADA_API_PORT`,
to start uWSGI with the desired port; however, it conflicts with an
environment variable already in use. This causes the `entrypoint.sh`
script to use the wrong port value for uWSGI when using user-specified
`armada_api` values through Helm (i.e. the port is already set and the
`entrypoint.sh` script does not fallback on its default value). This
commit adds missing uWSGI configuration values to the Armada chart
values and changes their names to avoid potential conflicts.
Change-Id: I00ae3431e36593956705dcdb887025d688d804df
This adds a `wait.resources` key to chart documents which allows
waiting on a list of k8s type+labels configurations to wait on.
Initially supported types are pods, jobs, deployments, daemonsets, and
statefulsets. The behavior for controller types is similar to that of
`kubectl rollout status`.
If `wait.resources` is omitted, it waits on pods and jobs (if any exist)
as before.
The existing `wait.labels` key still have the same behavior, but if
`wait.resources` is also included, the labels are added to each resource
wait in that array. Thus they serve to specify base labels that apply
to all resources in the release, so as to not have to duplicate them.
This may also be useful later for example to use them as labels to wait
for when deleting a chart.
Controller types additionaly have a `min_ready` field which
represents the minimum amount of pods of the controller which must
be ready in order for the controller to be considered ready. The value
can either be an integer or a percent string e.g. "80%", similar to e.g.
`maxUnavailable` in k8s. Default is "100%".
This also wraps up moving the rest of the wait code into its own module.
Change-Id: If72881af0c74e8f765bbb57ac5ffc8d709cd3c16
This changes unsequenced chart group deployments, such that each chart
in the group is deployed in parallel, including the install/upgrade,
wait, and tests.
Previously, whether and when to wait was entangled with whether or not
the chart group was sequenced, since running helm install/upgrade's
native wait (which cannot be run later) and armada's labels based wait,
delayed (or even prevented in the case of failure) the next chart from
being deployed, which is the intention for sequenced, but not for
unsequenced. With this patchset, sequencing and waiting are now
orthogonal. Hence we can now allow the user to explictly specify whether
to wait, which this patchset does for the case of helm's native wait
via a new `wait.native.enabled` flag, which defaults to true.
Previously, armada's labels-based wait sometimes occurred both between
charts and at the end of the chart group. It now occurs once directly
after chart deployment.
Previously, passing armada's --wait was documented to be equivalent to
forcing sequencing of chart groups, however helm tests did not run in
sequence as they normally would with sequenced chart groups, they now
do.
Since chart deploys can now occur in parallel, log messages for each
become interleaved, and thus when armada is deploying a chart, log
messages are updated to contain identifying information about which
chart deployment they are for.
Change-Id: I9d13245c40887712333aaccfb044dcdc4b83988e
This patchset changes the wait logic as follows:
- Move wait logic to own module
- Add framework for waiting on arbitrary resource types
- Unify pod and job wait logic using above framework
- Pass resource_version to k8s watch API for cleaner event tracking
- Only sleep for `k8s_wait_attempt_sleep` when successes not met
- Update to use k8s apps_v1 API where applicable
- Allow passing kwargs to k8s APIs
- Logging cleanups
This is in preparation for adding wait logic for other types of resources
and new wait configurations.
Change-Id: I92e12fe5e0dc8e79c5dd5379799623cf3f471082
1) UCP -> Airship
2) readthedocs.org -> readthedocs.io (there is redirect)
3) http -> https
4) attcomdev -> airshipit (repo on quay.io)
5) att-comdev -> openstack/airship-* (repo on github/openstack git)
6) many URLs have been verified and adjusted to be current
7) no need for 'en/latest/' path in URL of the RTD
8) added more info to some setup.cfg and setup.py files
9) ucp-integration docs are now in airship-in-a-bottle
10) various other minor fixes
Change-Id: I1e2d133a701dc2dade5bfcbdab5c0950cbe7eed5
This patch set changes Armada's exceptions documentation
(contained underneath operators guide) because it isn't rendering
correctly as a list table on RTD (the autoexception information
is missing) [0].
The easy fix is to change the tabularized view (list table)
into basically a series of autoexception classes which sufficiently
captures the level of detail required, anyway.
Note that running `tox -e docs` locally and opening the resulting
index.html page appears to work -- but not when hosted on RTD.
[0] https://airship-armada.readthedocs.io/en/latest/operations/exceptions/guide-exceptions.html
Change-Id: Id7e6730ff1d57e609e8fc4f636645ea8667bd425
This is a mechanically generated patch to add a unit test job running
under Python 3.6 as part of the python3-first goal.
See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html
Change-Id: I99bd1097c3da97e77f33059a6adab41c45f53906
Story: #2002586
1) Use OCI Image Specs for labels instead of custom 'commit-id=xxxxx'
or legacy "Label Schema"
2) Fix missing git commit id labels on images (.revision)
3) Add human-readable title (.title) of the image, URL (.url), and
a few other properties (annotations) according to the latest Specs
Change-Id: I7029d7caf521c7f56c1046fff9ecdd4e81090618
This PS adds the ability to attach a release uuid to pods and rc
objects as desired. This can be used, for example, to force an
artificial manifest change in CICD scenarios, for upgradability
testing purposes.
Change-Id: I77147ca778d70ee6337c609185bbe421c040376a
In some use cases, some site level docs are only included in specific
manifests. This is so sites can call out what they want deployed, however
currently Armada is checking for all documents to exist and leads
to an invalid manifest exception.
This PS removes the '.build_charts_deps()' and 'build_chart_groups()' calls
in 'get_manifest()' so that only chart documents, and chart group documents
are built after finding them within 'build_armada_manfiest()' and
'build_chart_group()'. 'build_armada_manifest()' will now throw the
related 'Could not find chart group... exception' for related chart
and chart group issues. Additional subclass exceptions were added along
with adding traceback to capture the chained exceptions.
Change-Id: Idc8a75b290ac0afb1e177203535b012d589b708f
This patch set provides a trivial update to correct the yaml indentation.
Change-Id: I16797d0db330a4ebddb335d7a7bff254bbd9ae8c
Signed-off-by: Tin Lam <tin@irrational.io>
The output with yapf version 0.24.0 has some changes which are in
conflict with the flake8 E126 rule. Hence pinning to <=0.23.0 for now.
Change-Id: I80b4094673eeca6dddc4fde0c324e0f5d9ec5d99
This change modifies the internal Keystone API port in the Armada chart
from 80 to 5000 and removes the default admin port to match the
Keystone chart provided by OpenStack-Helm.
Change-Id: I689a3b2df36cca4a2f23385fdb294e0017bc7f35
This makes the following changes to release diffing:
* Move into own handler.
* Add unit tests.
* Include `chart.metadata.name` (from Chart.yaml / dependency dir name)
since that can affect the values passed to dependency charts, and
it's sometimes used by templates via `{{ .Chart.name }}` in ways
which may necessitate an upgrade.
Change-Id: I241384971ed85e5658d71348fee2d6320bbb3c45