Граф коммитов

50 Коммитов

Автор SHA1 Сообщение Дата
Kaxil Naik 7c6dfcb0bf
Use unittest.mock instead of backported mock library (#11643)
mock is now part of the Python standard library, available as unittest.mock in Python 3.3 onwards.
2020-10-22 13:23:15 +01:00
Kamil Breguła 53e6062105
Enforce strict rules for yamllint (#11709) 2020-10-21 12:24:32 +02:00
Michał Misiewicz 210a948658
Fix tcp keepalive parameters parsing (#11594) 2020-10-16 17:34:11 -07:00
Kaxil Naik 2345cd1f03
Fix Harcoded Airflow version (#11483)
This test will fail or will need fixing whenever we release new Airflow
version
2020-10-13 02:05:35 +01:00
Michał Misiewicz b7404b079a
KubernetesPodOperator should retry log tailing in case of interruption (#11325)
* KubernetesPodOperator can retry log tailing in case of interruption

* fix failing test

* change read_pod_logs method formatting

* KubernetesPodOperator retry log tailing based on last read log timestamp

* fix test_parse_log_line test  formatting

* add docstring to parse_log_line method

* fix kubernetes integration test
2020-10-09 15:59:47 -07:00
Daniel Imberman 49aad025b5
Users can specify sub-secrets and paths k8spodop (#11369)
Allows users to specify items for specific key path projections
when using the airflow.kubernetes.secret.Secret class
2020-10-09 09:00:09 -07:00
Daniel Imberman 3ca11eb9b0
Kubernetes executor can adopt tasks from other schedulers (#10996)
* KubernetesExecutor can adopt tasks from other schedulers

* simplify

* recreate tables properly

* fix pylint

Co-authored-by: Daniel Imberman <daniel@astronomer.io>
2020-10-01 12:07:38 -07:00
Daniel Imberman cba51d49ee
Simplify the K8sExecutor and K8sPodOperator (#10393)
* Simplify Airflow on Kubernetes Story

Removes thousands of lines of code that essentially ammount to us
re-creating the Kubernetes API. Will offer a faster, simpler
KubernetesExecutor for 2.0

* Fix podgen tests

* fix documentation

* simplify validate function

* @mik-laj comments

* spellcheck

* spellcheck

* Update airflow/executors/kubernetes_executor.py

Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>

Co-authored-by: Kaxil Naik <kaxilnaik@gmail.com>
2020-09-17 08:40:20 -07:00
Daniel Imberman 1294e15d44
KubernetesPodOperator template fix (#10963)
* Ensure that K8sPodOperator can pull namespace from pod_template_file

Fixes a bug where users who run K8sPodOperator could not run because
the operator was expecting a namespace parameter

* add test

* self.pod

* Update airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py

Co-authored-by: Kamil Breguła <mik-laj@users.noreply.github.com>

* don't create pod until run

* spellcheck

Co-authored-by: Kamil Breguła <mik-laj@users.noreply.github.com>
2020-09-16 07:58:32 -07:00
Daniel Imberman 56bd9b7d6b
Modify helm chart to use pod_template_file (#10872)
* Modify helm chart to use pod_template_file

Since we are deprecating most k8sexecutor arguments
we should use the pod_template_file when launching airflow
using the KubernetesExecutor

* fix tests

* one more nit

* fix dag command

* fix pylint
2020-09-11 10:47:59 -07:00
Daniel Imberman 20481c3caf
Add pod_override setting for KubernetesExecutor (#10756)
* Add podOverride setting for KubernetesExecutor

Users of the KubernetesExecutor will now have a "podOverride"
option in the executor_config. This option will allow users to
modify the pod launched by the KubernetesExecutor using a
`kubernetes.client.models.V1Pod` class. This is the first step
in deprecating the tradition executor_config.

* Fix k8s tests

* fix docs
2020-09-08 15:56:59 -07:00
Jarek Potiuk 4de67a6731
Move dev docker images to airflow registry (#9652)
Part of #9401
2020-09-08 10:07:10 +02:00
Ping Zhang db378c09b7
[k8s] Store the raw ti key info to pod annotations (#10568)
The value of annotations can store the raw dag_id, task_id and
execution_date so that k8s executor can easily map pod event back
to the task instance
2020-08-26 07:53:37 -07:00
Daniel Imberman e195c6a3d2
Make KubernetesExecutor recognize kubernetes_labels (#10412)
KubernetesExecutor needs to inject `kubernetes_labels` configs
into the worker_config
2020-08-20 00:06:56 +01:00
Daniel Imberman f76938c171
Make Kubernetes tests pass locally (#10407)
* Make Kubernetes tests pass locally

Currently Kuberentes tests only all pass within breeze.

This PR makes them read the local path so they can pass in any
system.

* static tests
2020-08-19 15:49:12 -07:00
Daniel Imberman 3c374a42c0
Add reconcile_metadata to reconcile_pods (#10266)
metadata objects require a more complex merge strategy
then a simple "merge pods" for merging labels and other
features
2020-08-11 07:49:44 -07:00
Jarek Potiuk 44d4ae809c
Upgrade to latest pre-commit checks (#9686) 2020-07-06 11:37:22 +02:00
Aneesh Joseph d93555b863
Add git sync option and unit tests for the Helm chart (#9371)
* add git sync sidecars

* add a helm test

* add more tests

* allow users to provide git username and pass via  a k8s secrets

* set default values for airflow worker repository & tag

* change ci timeout

* fix link

* add credentials_secret to airflow.cfg configmap

* set GIT_SYNC_ADD_USER on kubernetes worker pods, set uid

* add fsGroup to webserver and kubernete workers

* move gitSync to dags.gitSync

* rename valueFields

* turn off git sync and dag persistence by default

* provide option to specify known_hosts

* add git-sync details into the chart documentation

* Update .gitignore

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>

* make git sync max failures configurable

* Apply suggestions from code review

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>

* add back requirements.lock

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
2020-07-05 12:57:15 -07:00
Sumit Maheshwari 19ac45aacb
Add support for fetching logs from running pods (#8626)
When using KubernetesExecutor without any centralized PV for log storage, one has to wait until the logs get uploaded to cloud storage before viewing them on UI. With this change, the webserver will try to fetch logs from running worker pods and display them.
2020-05-03 13:27:11 +05:30
Stijn De Haes 510a377b50
[AIRFLOW-6561] Add possibility to specify default resources for airflow k8s workers (#7168)
Co-authored-by: Stijn De Haes <stijndehaes@gmail.com>
2020-04-07 13:45:46 -07:00
Brandon T. Willard 75896c30cf
[AIRFLOW-6778] Add a configurable DAGs volume mount path for Kubernetes (#8147) 2020-04-07 13:35:09 -07:00
Leonardo Alves Miguel dfb18adaf5
[AIRFLOW-5659] Add support for ephemeral storage on KubernetesPodOperator (#6337) 2020-02-27 10:25:24 +00:00
Pete DeJoy 676c8515f7
[AIRFLOW-6843] Add delete_option_kwargs to delete_namespaced_pod (#7523) 2020-02-26 18:59:27 +00:00
Kaxil Naik 14315fcd9c
[AIRFLOW-6516] Allow different configmaps for airflow.cfg & airflow_l… (#7518)
* [AIRFLOW-6516] Allow different configmaps for airflow.cfg & airflow_local_settings.py (#7109)

* Update test_worker_configuration.py
2020-02-24 11:11:14 -08:00
Matt Buell 4d03e33c11
[AIRFLOW-6817] remove imports from `airflow/__init__.py`, replaced implicit imports with explicit imports, added entry to `UPDATING.MD` - squashed/rebased (#7456) 2020-02-22 08:21:19 +01:00
davlum 967930c0cb
[AIRFLOW-5413] Allow K8S worker pod to be configured from JSON/YAML file (#6230)
* [AIRFLOW-5413] enable pod config from file

* Update airflow/kubernetes/pod_generator.py

Co-Authored-By: Ash Berlin-Taylor <ash_github@firemirror.com>

* Update airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py

Co-Authored-By: Ash Berlin-Taylor <ash_github@firemirror.com>

Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>
2020-02-11 09:47:32 -08:00
MatthewRBruce 96f834389e
[AIRFLOW-6678] Pull event logs from Kubernetes (#7292)
Adds an option (defaults to True) to pull and log events from a
Kubernetes pod that fails.
2020-02-03 22:01:44 +01:00
Kamil Breguła 97a429f9d0
[AIRFLOW-6714] Remove magic comments about UTF-8 (#7338) 2020-02-02 22:18:19 +01:00
davlum 51f262c65a [AIRFLOW-5413] Refactor worker config (#7114) 2020-01-09 12:39:05 -08:00
Kaxil Naik a0a02dfcd8
[AIRFLOW-6516] BugFix: airflow.cfg does not exist in Volume Mounts (#7109) 2020-01-09 03:15:30 +00:00
Kaxil Naik 4748a518ce
[AIRFLOW-6504] Allow specifying configmap for Airflow Local Setting (#7097) 2020-01-08 14:41:22 +00:00
Tomek b31ce50f74 [AIRFLOW-6365] Remove tests/compat (#6919) 2019-12-27 09:14:02 +01:00
George Miller 2645f9d0d9 [AIRFLOW-5681] Allow specification of a tag or hash for the git_sync init container (#6350)
Co-authored-by: Ash Berlin-Taylor <ash_github@firemirror.com>
2019-12-17 23:14:15 +00:00
Ke Zhu b9de267204 [AIRFLOW-5532] Fix imagePullSecrets in pod created from k8s executor (#6166)
* [AIRFLOW-5532] Fix imagePullSecrets in pod created from k8s executor

* Keeps using PodGenerator constructor for setting up image_pull_secrets
2019-12-17 12:04:18 -08:00
Kaxil Naik 5e5685a0e9
[AIRFLOW-6025] Add label to uniquely identify creator of Pod (#6621) 2019-11-22 12:34:33 +00:00
Qingping Hou d5f648807c [AIRFLOW-5117] Automatically refresh EKS API tokens when needed (#5731) 2019-11-12 10:58:02 +00:00
Qingping Hou 133085eb47 [AIRFLOW-5641] Support running git sync container as root (#6312) 2019-10-15 11:58:31 +01:00
Kevin Yang d719e1fd67 [AIRFLOW-5362] Reorder imports (#5944) 2019-10-02 16:30:03 +01:00
Andrei deec7548c2 [AIRFLOW-5147] extended character set for for k8s worker pods annotations (#5819)
* [AIRFLOW-5147] extended character set for for k8s worker pods annotations

* updated UPDATING.md with new breaking changes

* excluded pylint too-many-statement check from constructor due to its nature
2019-09-18 09:49:00 -07:00
Jarek Potiuk 4780105798 [AIRFLOW-5256] Related pylint changes for common licences in python files (#5786) 2019-09-17 13:16:32 +02:00
Kamil Breguła 7b5cf442e4
[AIRFLOW-5445] Reduce the required resources for the Kubernetes's sidecar (#6062) 2019-09-15 23:15:53 +02:00
Kamil Breguła 6b2a290ddf
[AIRFLOW-5443] Use alpine image in Kubernetes's sidecar (#6059) 2019-09-09 14:42:06 +02:00
davlum 17d4179db2 [AIRFLOW-4851] Refactor K8S codebase with k8s API models (#5481)
* [AIRLFOW-4851] refactor Airflow kubernetes

* [AIRFLOW-4851] refactor Airflow k8s models

* [AIRFLOW-4851] Fix linting and tests
* Refactor and add some tests

* [AIRLFOW-4851] Add assertions to PodOperator tests
2019-09-04 16:24:31 -05:00
Marcin Szymański 4dfe2497fb [AIRFLOW-5048] Improve display of Kubernetes resources (#5665) 2019-08-05 13:25:06 +02:00
CatarinaSilva 7c5c3b9377 [AIRFLOW-3617] Add gpu limits option in configurations for executor and pod (#5643) 2019-07-26 17:55:01 +02:00
Andrii Soldatenko d168cdcde6 [AIRFLOW-XXX] fix copy/pasta in k8s request factory extract resources (#5657)
* fix copy/pasta in k8s request factory extract resorces

* fix test KubernetesPodOperatorTest.test_pod_resources
2019-07-25 10:21:08 -07:00
Ron van Weverwijk 6eb326255d [AIRFLOW-4781] Add the ability to specify ports in kubernetesOperator (#5410)
* [AIRFLOW-4781] Added the ability to specify ports in kubernetesOperator

* [AIRFLOW-4781] Added the ability to specify ports in kubernetesOperator

* [AIRFLOW-4781] Added the ability to specify ports in kubernetesOperator

added docstring

* [AIRFLOW-4781] Added the ability to specify ports in kubernetesOperator

add typehints

Co-Authored-By: Fokko Driesprong <fokko@driesprong.frl>

* [AIRFLOW-4781] Added the ability to specify ports in kubernetesOperator

fixed docstrings and typehints
2019-06-18 13:09:15 +02:00
Bruno Campos 0224105343 [AIRFLOW-3729] Support "DownwardAPI" in env variables for KubernetesPodOperator (#4554)
https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/#the-downward-api
2019-06-10 10:26:06 +01:00
Olivier Van Goethem 3882beaf85 [AIRFLOW-4393] Add exponential backoff retry (#5284) 2019-05-20 08:43:15 -07:00
Daniel Imberman f153bf5367
[AIRFLOW-4487] Move k8s executor from contrib folder to main project (#5261)
* Move k8s executor from contrib folder

Considering that the k8s executor is now fully supported by core
committers, we should move it from contrib to the primary executor
directory.
2019-05-09 16:05:31 -07:00