Commit Graph

340 Commits

Author SHA1 Message Date
Sergiy Markin b3b8d05fe7 Airflow stable 2.8.1
Change-Id: I46c97108d50304fd4e3417f6057d999c891b0661
2024-02-21 22:24:46 +00:00
Ruslan Aliev d9e2248172 Add configurable support of armada-operator for armada-api
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: I76fb41062d152bf360a85d781c19ab5b204769b8
2024-02-12 11:09:18 -06:00
Sergiy Markin cdcdbd292d Airflow stable 2.6.2
This PS updates python modules and code to match Airflow 2.6.2:

- bionic py36 gates  were removed
- python code corrected to match new modules versions
- selection of python modules versions was perfoemed based on
  airflow-2.6.2 constraints
- airskiff deploy pipeline was aligned with latest in treasuremap v1.9

Change-Id: If6f57325339995216d2553c7a5ff56e7673b5acc
2023-08-19 00:37:37 +00:00
Sergiy Markin 4be7fa44a7 Armada timeout adjustment
This PS set read/connection timeout to None for http requests.

Change-Id: Ic874485bb82a9c386224f5adc530e366b01ae24e
2023-05-11 21:15:22 +00:00
Sergiy Markin 386a686e69 [focal] Python modules sync with Airship project
- armada-airskiff-deploy is voting gate again
- fixed falcon.API deprecation - -> falcon.App
- fixed collections.abc.defaultdict not found error
- fixed tox4 requirements
- implemented requirements-frozen.txt approach to make allike as other
  Airship projects
- uplifted docker version in the image building and publishing gate

Change-Id: I337ec07cd6d082acabd9ad65dd9eefb728a43b12
2023-04-21 23:49:14 +00:00
SPEARS, DUSTIN (ds443n) 0e9d828fe6 Update armada to focal
Update kubernetes client to v26.1.0
Updating armada to focal base image
Remove xenial and opensuse dockerfiles
Update tox python from py35 to py38
Add apparmor for docker build
Uplift HTK chart version 0.2.52
Bumping up some python dependencies to get in sync with shipyard
Added clear-firewall role for airskiff-deploy playbook

Change-Id: If06a3f60466702d05a21c24a7cb8041bed41507a
2023-03-20 11:30:37 -04:00
SPEARS, DUSTIN (ds443n) 099de8aaf4 Bump k8s client to v25.3.0
Bumping k8s client to v25.3.0
Cronjob batch v1beta1 no longer available in k8s 1.25
Update tox.ini file to be compatible with v4

Change-Id: Iac79c52c97c9ef1223ae8d502da1572ef8d068fa
2023-01-18 11:25:05 -05:00
Ruslan Aliev 379c88d619 Bump helm to v3.9.4 and k8s client to 24.2.0
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
Change-Id: I55d7b34e7525fe6359157d0fa042332a91ac9c95
2022-09-19 11:21:50 -05:00
Phil Sphicas 416eff4e52 Armada client: Enable TCP keepalives
This change enables TCP keepalives in the transport adapter used by the
Armada client.

Change-Id: I44d9fe0f29dfb1c00250a76452f4db610ea377ad
2022-03-14 13:40:23 -07:00
Phil Sphicas c5d39f27ca Create lock CRD as apiextensions.k8s.io/v1 object
Kubernetes v1.22 stopped serving the apiextensions.k8s.io/v1beta1 API
version of CustomResourceDefinition.

This change ensures that the locks.armada.process CRD is created using
the apiextensions.k8s.io/v1 API.

The kubernetes client package is also updated to take advantage of the
dynamic client.

Change-Id: Icd518ab5cbb78e8b15f63d19c51b5f5b9a67e995
2022-03-09 16:36:40 -08:00
francisy 790af88d61 Remove diff
Getting rid of logs that will show diff in results

Change-Id: I8994506f517928c1a945b794e72b2b7cbb960ab7
2021-12-09 10:47:50 -05:00
francisy 82a138f11b Remove Log Info
Passwords are shown in logs that need to be removed

Change-Id: I0be2d53c9e613ecb4b4f62c5164266fbaa596944
2021-12-08 13:32:17 -05:00
Sean Eagan b5b519f66a Fix list_release_ids()
Change-Id: I8ad7c95a11e74858803d779e99afda6670a3f198
2021-10-07 22:56:11 -05:00
Sean Eagan 862c289e4b Fix dependency symlink idempotency
Previously, existing dependency symlinks were causing
FileExistsErrors. This simplifies the logic to ensure
they do get deleted before being recreated. It also
moves to erroring if a chart's `charts` directory is
not a directory, since this is something a chart author
ought to fix, since it needs to be a directory in order
to add dependency sub-directories to it.

Change-Id: I7cc1d50f2bf09602866ce2cf13a4d6c8f6e118ce
2021-10-05 12:59:48 -05:00
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 68747d0815 Use helm 3 CLI as backend
Helm 3 breaking changes (likely non-exhaustive):

- crd-install hook removed and replaced with crds directory in
  chart where all CRDs defined in it will be installed before
  any rendering of the chart
- test-failure hook annotation value removed, and test-success
  deprecated. Use test instead
- `--force` no longer handles recreating resources which
  cannot be updated due to e.g. immutability [0]
- `--recreate-pods` removed, use declarative approach instead [1]

[0]: https://github.com/helm/helm/issues/7082
[1]: https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments

Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
Change-Id: I20ff40ba55197de3d37e5fd647e7d2524a53248f
2021-10-04 21:40:26 -05: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
Sean Eagan 5f1ffbbbbe Revert "Airship 2 support features"
This reverts commit c75898cd6a.

Airship 2 ended up using the Flux helm-controller instead:
https://github.com/fluxcd/helm-controller

So this is no longer needed. Removing it to get rid of tech
debt to ease introduction of Helm 3 support.

This retains the part of the commit which extracts the
chart download logic to its own handler as this is still useful.

Change-Id: Icb468be2d4916620fd78df250fd038ab58840182
2021-09-30 17:22:16 -05:00
DeJaeger, Darren (dd118r) e9a2309e0a Changes for new version of falcon
Moving to falcon 3.0.0+ brings in some changes to the response
object. One of those is the deprecation of the "body" response
field. This PS attempts to get ahead and make the necessary
changes to no longer use deprecated fields.

Change-Id: Iac5d8cd2c658c337dfe7937db8124f3107d77e91
2021-06-24 15:02:42 +00:00
DeJaeger, Darren (dd118r) 9aadc14777 Armada improved logging, uplift dependency
This PS:

1) Looks to improve specific logging in Armada, so that
it's easier to debug deployment related issues
2) Uplifts the k8s Python dependency to 12.0.0
3) Enforces 'watch' timeouts more strictly, as the call to
the Kubernetes Python watch function seemed unreliable.
4) Adds a field selector to the 'watch' stream to look for
the DELETE action to have been completed on the specific
pod/job/cronjob, rather than looking across the whole
namespace or via labels. This will narrow what the watch
is looking at, making the logs less busy.

Change-Id: I1952b0db32fb0b56ffffcddeae0532beb5a27b67
2021-06-24 10:53:06 -04:00
DeJaeger, Darren (dd118r) 8e947c720c Improve release upgrade "diff" debug log readability
This adds the release name to the beginning of the diff debug
log so that it's easier to correlate which diffs belong to which
components when reading the Armada logs.

Change-Id: If096f049a8057a46951ea70f2223a7a987636f5c
2021-06-03 11:21:06 -04:00
Thiago Brito 1e5d781fe9 Fixing Armada waits for Evicted pods undefinetly
In the occasion of a pod being evicted due to low resource availability,
armada keeps waiting for the Evicted pod to be ready. This commit
removes that behavior since Kubernetes will spun up a new pod.

Story: 2008645
Task: 41906
Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
Change-Id: I7263eebe357b0952375d538555536dc9f7cceff4
2021-03-22 16:45:08 -03:00
Phil Sphicas ce5964a594 Accelerate YAML operations with LibYAML
Patch PyYAML (via the pylibyaml library) to automatically enable the
LibYAML parser and emitter, which are faster than the Python versions.

https://pypi.org/project/pylibyaml/

Change-Id: I4a3045e15df909fb4760800ce1fb87e298dd1e67
2020-09-25 14:29:41 +00:00
KAVVA, JAGAN MOHAN REDDY (jk330k) 36efc4828d Move Tiller version to 2.16.9
Update Helm chart for Armada to use Tiller version 2.16.9.

depends on: https://review.opendev.org/#/c/749497/

Change-Id: I16f7a5e8e571f067154e79a5f2ceb18be7d8db2d
2020-09-17 10:48:44 -05:00
Yadav, Satender (sy336r) ce353b61f0 Adding space in logger warning message
This commit will fix below warning message.

 "Post upgrade actions are ignored by Armadaand will not affect deployment.:

Change-Id: I1a8397aa892815bdc96f94a8e49280a4b73a484c
2020-08-28 10:39:01 -05:00
Zuul 55cf2bc92b Merge "[chart_deploy] Handle unknow chart status in a more resilient manner" 2020-08-03 13:01:53 +00:00
Drew Walters 7bf1423752 Add documentation to docs.airshipit.org
This change adds publishing to docs.airshipit.org and updates the theme
to match the other Airship projects on the site. This change also
updates orphaned links and removes the Read the Docs jobs.

The documentation can be found at docs.airshipit.org/armada when this
change merges.

Change-Id: I9641753f6084f911e3286c623d0c2de7b3f6040a
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-08-03 10:33:13 +00:00
Nishant Kumar 88c200fc18 [chart_deploy] Handle unknow chart status in a more resilient manner
In cases when chart is in a pending state and last deployment age
for chart is less than the chart wait timeout, armada can consume
all the retries without attempting to purge and re-install the
chart.

This PS addresses the above issue by waiting for the chart until
the wait timeout is met and then proceeding ahead with usual
armada process of purging and re-installing the chart if the status
is not DEPLOYED.

Other code changes in this PS is just re-arranging the existing logic to
fix some edge cases and solve pep8 issues.

Change-Id: Id11d0fb06201264015b3064a43e83903f99a30b1
2020-07-30 17:19:11 +00:00
DODDA, PRATEEK REDDY (pd2839) bbfe30e4a4 Address PEP8 Failures in Armada
Flake8 version recently updated to include new PEP8 rules. Some of
the codebase is not compliant with the new rules.

Change-Id: Ieb9de200535b6e3fd743e1c0f2e851e81cae79f3
2020-05-29 18:02:11 -05:00
Phil Sphicas 6b2c7245de Reestablish watch and retry wait for some errors
Armada uses a Kubernetes watch to implement its chart wait logic. This
can be a fairly long-lived connection to the Kubernetes API server, and
is vulnerable to disruption (if, for example, the kubernetes apiserver
chart is being upgraded).

This change allows Armada to retry the wait for some specific errors,
including the establishment of a new watch, until the overall chart
timeout is reached.

https://github.com/kubernetes-client/python/issues/972
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read)', IncompleteRead(0 bytes read))

Change-Id: I3e68a54becadd5b2a2343960a120bdc3de8e8515
2020-04-19 18:54:03 +00:00
Phil Sphicas ae1281d874 Fix: wait.resources: [] should disable waits
The mechanism to disable waits is to explictly set
    wait.resources: []

After a recent update [https://review.opendev.org/#/c/697728/], this
configuration results in the default waits (pods and jobs).

This change restores the original functionality.

Change-Id: If5d09f649ca037855c88f928aee6b4dc35ca8b48
2020-04-19 18:54:03 +00:00
Sean Eagan c75898cd6a Airship 2 support features
Airship 2 is using Argo for workflow management, rather
than the builtin Armada workflow functionality. Hence, this
adds an apply_chart CLI command to apply a single chart at
a time, so that Argo can manage the higher level orchestration.

Airship 2 is also using kubernetes as opposed to Deckhand as the
document store. Hence this adds an ArmadaChart kubernetes CRD,
which can be consumed by the apply_chart CLI command. The chart
`dependencies` feature is intentionally not supported by the CRD,
as there are additional complexities to make that work, and ideally
this feature should be deprecated as charts should be building in
there dependencies before consumption by Armada.

Functional tests are included to excercise these features
against a minikube cluster.

Change-Id: I2bbed83d6d80091322a7e60b918a534188467239
2020-03-25 13:56:32 -05:00
Sean Eagan 268d7a3958 Move kubernetes client to >=11.0.0
This version had a breaking api change [0], which this
aligns with. This version also adds support for kubernetes
1.14 and 1.15 apis.

[0]: https://github.com/kubernetes-client/python/blob/master/CHANGELOG.md#v1100

Change-Id: I01866bd5739e4eebb3166cb583d07efb046360aa
2020-03-20 08:49:45 -05:00
Sean Eagan 1d9d645a5e Remove makeMockThreadSafe()
It doesn't appear to be compatible with newer versions of python
and the mock library, and wasn't working correctly anyways.

Change-Id: I117d01bed40849587b2d0337aad56fccdf77e192
2020-02-06 08:55:25 -06:00
Tin Lam 253da9331f [LOG] Fix log message
This patch set adds in a missing space in a log message so it can be more
easily parsed, as the previous fields were separated by space.

Change-Id: I96cceb644c8193909a91fb42e13c43db0f83ba8d
Signed-off-by: Tin Lam <tin@irrational.io>
2020-01-31 21:50:30 -06:00
Phil Sphicas 6a9b3bf9c9 Fix: Use Foreground deletion
Armada intends to use `propagationPolicy: Foreground` when deleting
resources. However, the empty V1DeleteOptions object in the body of the
delete API call takes priority over the propogation_policy specified as
a query param, resulting in the per-resouce default. For Job and CronJob
resources, the default is Orphan, and for others it is Background.

This change includes the desired propogation_policy in V1DeleteOptions.

Reference: https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/#setting-the-cascading-deletion-policy

Change-Id: Iffee12b426ba1e7741eb5bd687ca1b2c11cb071d
2019-11-14 16:12:43 +00:00
Sean Eagan aa75c3eb45 fix: Align template file naming with Helm CLI
Armada has previously named template files relative to the
`templates` dir, whereas the Helm CLI names them relative
to the chart root. This causes `include`s of these templates
to fail.

This change fixes this, for armada/Chart/v2 docs only, since it
is a breaking change, as some charts may have already aligned
with the existing Armada behavior. When updating a release
previously deployed with armada/Chart/v1, the fixed template
names alone will not cause the release to be updated, as the
diff logic accounts for this.

Change-Id: I243073ca4c2e1edbcb0d8f649475f568fc7c818f
2019-10-03 20:32:43 +00:00
Sphicas, Phil (ps3910) 4e76d15eda Allow proxy_server use for chart tarball downloads
Currently the chart `source` schema allows for a proxy server to be
specified, but it is only used for git repos. This patchset allows
the `proxy_server` to also be used for tarball url sources.

Change-Id: I6f90d056fa46f596b1fb248b6c596c58b6513d64
2019-09-17 14:56:08 -07: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
Drew Walters df97ff59a6 cli: Remove dry-run flag
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 second in a series of changes to remove the dry-run
feature. Specifically, this change removes the flag as an option for the
CLI.

Story: 2005121

Change-Id: If0b512dcf5520e8a53521fbb5e4e83e06984c889
Signed-off-by: Drew Walters <andrew.walters@att.com>
2019-09-05 16:29:04 +00:00
Drew Walters d6ad0e5e46 api: Remove dry-run parameter
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 first in a series of changes to remove the dry-run
feature. Specifically, this change removes the parameter as an option
for the API.

Story: 2005121

Change-Id: If5bd2639fe3e9af3f4cc669cd627b47c1d8fec16
Signed-off-by: Drew Walters <andrew.walters@att.com>
2019-09-05 16:29:04 +00:00
Zuul 0dbfdcb2e6 Merge "Don't log metrics HTTP data" 2019-08-22 21:54:37 +00:00
Sean Eagan 5d2447560b Support builtin chart dependencies
This adds support for using the same builtin chart dependencies [0]
as `helm install|upgrade ...` would use.

[0]: https://helm.sh/docs/developing_charts/#chart-dependencies

Change-Id: Ifc541dc273fa2a5c5b4e43125f468ea3fdb0f379
2019-08-22 08:13:03 -05:00
Sean Eagan 4596e6c0f1 Don't log metrics HTTP data
The metrics endpoint can be scraped frequently and produces a large
response body, hence this turns off logging of this data to prevent
the drowning out of other more salient logging.

Change-Id: I399480726ae39963b010bf5b054ce26d73fb28c5
2019-08-21 11:25:20 -05:00
Sean Eagan 0721ed43aa Implement Prometheus metric integration
This implements Prometheus metric integration, including metric
definition, collection, and exportation.

End user documentation for supported metric data and exportation
interface is included.

Change-Id: Ia0837f28073d6cd8e0220ac84cdd261b32704ae4
2019-08-15 16:12:17 +00:00
Robert Church 8a1638098f Fix --enable-chart-cleanup option
The current logic to find valid releases is incorrect resulting in zero
valid releases being found and all currently installed chart releases
with the release_prefix being removed.

The data passed to this method is a list of chart groups with the
following format:
[{'data':
  {'chart_group':
    [{'data':
        {'chart_name': 'ingress',
         'release': 'kube-system-ingress'
  ...

This update adapts the code to the expected format of the data provided.

Change-Id: Ib285cdf21283b8ec73d583fb107ba49514a9dda7
Signed-off-by: Robert Church <robert.church@windriver.com>
2019-07-31 23:54:49 -04: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
Roman Gorshunov d404e3c034 Change various URLs for the OpenDev migration
Change-Id: I3d345cfe1b3cf6134f5aad69ce639ddd21dc101f
2019-07-26 16:32:02 +02:00
Dustin Specker caa75e403e fix: improve error message when user passes in only api and url
Also change enable to enabled.

Before if a user passed in --api and --url TEXT the error message would
return a confusing message that the user must pass in url when api is
enabled.

Now the error message says the user must provide url and token when api
is enabled.

Change-Id: I3284a7e1f920217dc476abcdd1fc17701c85655e
2019-07-17 13:12:07 -05:00