Apache Airflow (Incubating)
Перейти к файлу
Jarek Potiuk d93c1fdb26
Disables --warn-unused-ignore flag for mypy (#10880)
There is a problem with MyPy's implementation of
--warn-unused-ignore flag, that depending on it's incremental
or full run it will sometimes throw an "unused ignore" error
(entirely randomly it seems). The problem is described
(but only workarounded) in
https://github.com/python/mypy/issues/2960.

The workaround is to disable --warn-unused-ignore flag.
There is little harm in having unused ignores and we can
clean them up from time to time easily.
2020-09-11 15:54:18 +02:00
.github Removes stable tests from quarantine (#10768) 2020-09-08 07:36:12 +02:00
airflow Disables --warn-unused-ignore flag for mypy (#10880) 2020-09-11 15:54:18 +02:00
backport_packages Adds 'cncf.kubernetes' package back to backport provider packages. (#10659) 2020-08-31 14:45:58 +02:00
chart Check all dockerfiles with hadolint (#10754) 2020-09-06 18:06:05 +02:00
clients point go client mod path to new repo (#9922) 2020-07-22 09:56:55 +02:00
dags [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
dev Remove redundant section from dev/README.md toc (#10689) 2020-09-02 11:39:38 +01:00
docs Added Plexus as an Airflow provider (#10591) 2020-09-10 19:54:38 +02:00
empty Prepare release candidate for backport packages (#8891) 2020-05-17 20:38:46 +02:00
hooks Group CI scripts in subdirectories (#9653) 2020-07-16 18:05:35 +02:00
images Updated documentation for the CI with mermaid sequence diagrams (#10380) 2020-08-24 22:45:28 +02:00
kubernetes_tests Move dev docker images to airflow registry (#9652) 2020-09-08 10:07:10 +02:00
license-templates [AIRFLOW-5234] Rst files have consistent, auto-added license 2019-08-18 19:51:02 -04:00
licenses [AIRFLOW-5277] Gantt chart respects per-user the Timezone UI setting (#8096) 2020-04-03 17:54:45 +01:00
manifests [AIRFLOW-7013] Automated check if Breeze image needs to be pulled (#7656) 2020-03-12 09:48:24 +01:00
metastore_browser Add PyDocstyle Precommit Hook (#9456) 2020-06-21 09:34:41 +01:00
scripts Make dockerfiles Google Shell Guide Compliant (#10734) 2020-09-09 14:04:16 +02:00
tests Update qubole_hook to not remove pool as an arg for qubole_operator (#10820) 2020-09-11 12:30:02 +05:30
.asf.yaml Disable wiki. (#10173) 2020-08-05 18:31:05 +02:00
.bash_completion [AIRFLOW-3611] Simplified development environment (#4932) 2019-08-27 14:39:36 -04:00
.coveragerc Bring back code coverage (#10143) 2020-08-05 09:44:24 +02:00
.dockerignore Do not override in_container scripts when building the image (#10442) 2020-08-21 17:21:57 +02:00
.editorconfig [AIRFLOW-6714] Remove magic comments about UTF-8 (#7338) 2020-02-02 22:18:19 +01:00
.flake8 Enable Black on Providers Packages (#10543) 2020-08-25 17:39:04 +01:00
.gitignore Adds pip-wheel metadata in .gitignore (#10657) 2020-08-31 12:45:13 +02:00
.hadolint.yaml [AIRFLOW-5180] Added static checks (yamllint) + auto-licences for yaml file (#5790) 2019-08-22 10:13:56 -04:00
.mailmap Remove duplicate entries from .mailmap (#10736) 2020-09-05 08:56:17 +02:00
.pre-commit-config.yaml Add new lint check to now allow realtive imports (#10825) 2020-09-10 18:07:50 +01:00
.rat-excludes Updated documentation for the CI with mermaid sequence diagrams (#10380) 2020-08-24 22:45:28 +02:00
.readthedocs.yml [AIRFLOW-5180] Added static checks (yamllint) + auto-licences for yaml file (#5790) 2019-08-22 10:13:56 -04:00
BREEZE.rst Add new lint check to now allow realtive imports (#10825) 2020-09-10 18:07:50 +01:00
CHANGELOG.txt Fix and remove some more typos from spelling_wordlist.txt (#10845) 2020-09-10 00:05:00 +01:00
CI.rst Updated documentation for the CI with mermaid sequence diagrams (#10380) 2020-08-24 22:45:28 +02:00
CODE_OF_CONDUCT.md Add Apache Airflow CODE_OF_CONDUCT.md (#9715) 2020-08-05 16:02:04 +02:00
CONTRIBUTING.rst Added Plexus as an Airflow provider (#10591) 2020-09-10 19:54:38 +02:00
Dockerfile The PIP version is not pinned to 19.0.2 any more (#10542) 2020-08-25 15:45:59 +02:00
Dockerfile.ci The PIP version is not pinned to 19.0.2 any more (#10542) 2020-08-25 15:45:59 +02:00
IMAGES.rst Unify command names in CLI (#10669) 2020-09-02 08:43:41 -04:00
INSTALL Added Plexus as an Airflow provider (#10591) 2020-09-10 19:54:38 +02:00
INTHEWILD.md Add USC Graduate School to INTHEWILD.md (#10843) 2020-09-10 13:03:49 +01:00
LICENSE Remove vendored nvd3 and slugify libraries (#9136) 2020-06-04 15:45:29 +01:00
LOCAL_VIRTUALENV.rst Constraint files are now maintained automatically (#9889) 2020-07-20 14:36:03 +02:00
MANIFEST.in Remove vendored nvd3 and slugify libraries (#9136) 2020-06-04 15:45:29 +01:00
NOTICE Housekeeping of auth backend & Update Security doc (#8071) 2020-04-03 18:20:39 +02:00
README.md Refactor content to a markdown table (#10863) 2020-09-10 12:35:16 -04:00
STATIC_CODE_CHECKS.rst Add new lint check to now allow realtive imports (#10825) 2020-09-10 18:07:50 +01:00
TESTING.rst Removes stable tests from quarantine (#10768) 2020-09-08 07:36:12 +02:00
UPDATING.md Fix grammar in UPDATING.md (#10841) 2020-09-09 20:39:16 +01:00
breeze The verbose functions will not exit immediately if not asked to (#10731) 2020-09-06 19:56:35 +02:00
breeze-complete Add new lint check to now allow realtive imports (#10825) 2020-09-10 18:07:50 +01:00
codecov.yml Improves stability of reported coverage and makes it nicer (#10208) 2020-08-07 12:47:15 +02:00
confirm Implement Google Shell Conventions for breeze script (#10695) 2020-09-02 21:55:50 +02:00
pylintrc Pylint checks should be way faster now (#10207) 2020-08-07 11:07:15 +02:00
pyproject.toml Enable Black on Connexion API folders (#10545) 2020-08-25 12:10:20 +01:00
pytest.ini [AIRFLOW-6460] - Reverting "Reduce timeout in pytest (#7051)" (#7062) 2020-01-05 13:33:35 +01:00
setup.cfg Disables --warn-unused-ignore flag for mypy (#10880) 2020-09-11 15:54:18 +02:00
setup.py Added Plexus as an Airflow provider (#10591) 2020-09-10 19:54:38 +02:00
yamllint-config.yml [AIRFLOW-5180] Added static checks (yamllint) + auto-licences for yaml file (#5790) 2019-08-22 10:13:56 -04:00

README.md

Apache Airflow

PyPI version GitHub Build Coverage Status Documentation Status License PyPI - Python Version Docker Pulls Docker Stars

Twitter Follow Slack Status

Apache Airflow (or simply Airflow) is a platform to programmatically author, schedule, and monitor workflows.

When workflows are defined as code, they become more maintainable, versionable, testable, and collaborative.

Use Airflow to author workflows as directed acyclic graphs (DAGs) of tasks. The Airflow scheduler executes your tasks on an array of workers while following the specified dependencies. Rich command line utilities make performing complex surgeries on DAGs a snap. The rich user interface makes it easy to visualize pipelines running in production, monitor progress, and troubleshoot issues when needed.

Table of contents

Requirements

Apache Airflow is tested with:

Master version (2.0.0dev) Stable version (1.10.12)
Python 3.6, 3.7, 3.8 2.7, 3.5, 3.6, 3.7, 3.8
PostgreSQL 9.6, 10 9.6, 10
MySQL 5.7 5.6, 5.7
SQLite latest stable latest stable
Kubernetes 1.16.2, 1.17.0 1.16.2, 1.17.0

Note: SQLite is used primarily for development purpose.

Additional notes on Python version requirements

  • Stable version requires at least Python 3.5.3 when using Python 3

Getting started

Visit the official Airflow website documentation (latest stable release) for help with installing Airflow, getting started, or walking through a more complete tutorial.

Note: If you're looking for documentation for master branch (latest development branch): you can find it on ReadTheDocs.

For more information on Airflow's Roadmap or Airflow Improvement Proposals (AIPs), visit the Airflow Wiki.

Official Docker (container) images for Apache Airflow are described in IMAGES.rst.

Installing from PyPI

Airflow is published as apache-airflow package in PyPI. Installing it however might be sometimes tricky because Airflow is a bit of both a library and application. Libraries usually keep their dependencies open and applications usually pin them, but we should do neither and both at the same time. We decided to keep our dependencies as open as possible (in setup.py) so users can install different versions of libraries if needed. This means that from time to time plain pip install apache-airflow will not work or will produce unusable Airflow installation.

In order to have repeatable installation, however, introduced in Airflow 1.10.10 and updated in Airflow 1.10.12 we also keep a set of "known-to-be-working" constraint files in the orphan constraints-master and constraints-1-10 branches. We keep those "known-to-be-working" constraints files separately per major/minor python version. You can use them as constraint files when installing Airflow from PyPI. Note that you have to specify correct Airflow tag/version/branch and python versions in the URL.

  1. Installing just airflow:
pip install apache-airflow==1.10.12 \
 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-1.10.12/constraints-3.7.txt"
  1. Installing with extras (for example postgres,google)
pip install apache-airflow[postgres,google]==1.10.12 \
 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-1.10.12/constraints-3.7.txt"

Official source code

Apache Airflow is an Apache Software Foundation (ASF) project, and our official source code releases:

Following the ASF rules, the source packages released must be sufficient for a user to build and test the release provided they have access to the appropriate platform and tools.

Other ways of retrieving source code are "convenience" methods. For example:

  • Tagging in GitHub to mark the git project sources that were used to generate official source packages

We also have binary "convenience" packages:

These artifacts are not official releases, but they are built using officially released sources.

Note: Airflow Summit 2020's "Production Docker Image talk" explains context, architecture and customization/extension methods.

Project Focus

Airflow works best with workflows that are mostly static and slowly changing. When the structure is similar from one run to the next, it allows for clarity around unit of work and continuity. Other similar projects include Luigi, Oozie and Azkaban.

Airflow is commonly used to process data, but has the opinion that tasks should ideally be idempotent, and should not pass large quantities of data from one task to the next (though tasks can pass metadata using Airflow's Xcom feature). For high-volume, data-intensive tasks, a best practice is to delegate to external services that specialize on that type of work.

Airflow is not a streaming solution. Airflow is not in the Spark Streaming or Storm space.

Principles

  • Dynamic: Airflow pipelines are configuration as code (Python), allowing for dynamic pipeline generation. This allows for writing code that instantiates pipelines dynamically.
  • Extensible: Easily define your own operators, executors and extend the library so that it fits the level of abstraction that suits your environment.
  • Elegant: Airflow pipelines are lean and explicit. Parameterizing your scripts is built into the core of Airflow using the powerful Jinja templating engine.
  • Scalable: Airflow has a modular architecture and uses a message queue to orchestrate an arbitrary number of workers.

User Interface

  • DAGs: Overview of all DAGs in your environment.

  • Tree View: Tree representation of a DAG that spans across time.

  • Graph View: Visualization of a DAG's dependencies and their current status for a specific run.

  • Task Duration: Total time spent on different tasks over time.

  • Gantt View: Duration and overlap of a DAG.

  • Code View: Quick way to view source code of a DAG.

Backport packages

Context: Airflow 2.0 operators, hooks, and secrets

Currently, stable Apache Airflow versions are from the 1.10.* series. We are working on the future, major version of Airflow from the 2.0.* series. It is going to be released in 2020. However, the exact time of release depends on many factors and is not yet confirmed.

We have already a lot of changes in the operators, transfers, hooks, sensors, secrets for many external systems, but they are not used nor tested widely because they are part of the master/2.0 release.

In the Airflow 2.0 - following AIP-21 "change in import paths" all the non-core interfaces to external systems of Apache Airflow have been moved to the "airflow.providers" package.

Thanks to that and automated backport effort we took, the operators from Airflow 2.0 can be used in Airflow 1.10 as separately installable packages, with the constraint that those packages can only be used in python3.6+ environment.

Installing Airflow 2.0 operators in Airflow 1.10

We released backport packages that can be installed for older Airflow versions. Those backport packages are going to be released more frequently that main Airflow 1.10.* releases.

You will not have to upgrade your Airflow version to use those packages. You can find those packages in the PyPI and install them separately for each provider.

Those packages are available now and can be used in the latest Airflow 1.10.* version. Most of those packages are also installable and usable in most Airflow 1.10.* releases but there is no extensive testing done beyond the latest released version, so you might expect more problems in earlier Airflow versions.

An easier migration path to 2.0

With backported providers package users can migrate their DAGs to the new providers package incrementally and once they convert to the new operators/sensors/hooks they can seamlessly migrate their environments to Airflow 2.0. The nice thing about providers backport packages is that you can use both old and new classes at the same time - even in the same DAG. So your migration can be gradual and smooth. Note that in Airflow 2.0 old classes raise deprecation warning and redirect to the new classes wherever it is possible. In some rare cases the new operators will not be fully backwards compatible - you will find information about those cases in UPDATING.md where we explained all such cases. Switching early to the Airflow 2.0 operators while still running Airflow 1.10 will make your migration much easier.

More information about the status and releases of the back-ported packages are available at Backported providers package page

Installing backport packages

Note that the backport packages might require extra dependencies. Pip installs the required dependencies automatically when it installs the backport package, but there are sometimes cross-dependencies between the backport packages. For example google package has cross-dependency with amazon package to allow transfers between those two cloud providers. You might need to install those packages in case you use cross-dependent packages. The easiest way to install them is to use "extras" when installing the package, for example the below will install both google and amazon backport packages:

pip install apache-airflow-backport-providers-google[amazon]

This is all documented in the PyPI description of the packages as well as in the README.md file available for each provider package. For example for google package you can find the readme in README.md. You will also find there the summary of both - new classes and moved classes as well as requirement information.

Troubleshooting installing backport packages

Backport providers only work when they are installed in the same namespace as the 'apache-airflow' 1.10 package. This is majority of cases when you simply run pip install - it installs all packages in the same folder (usually in /usr/local/lib/pythonX.Y/site-packages). But when you install the apache-airflow and apache-airflow-backport-package-* using different methods (for example using pip install -e . or pip install --user they might be installed in different namespaces. If that's the case, the provider packages will not be importable (the error in such case is ModuleNotFoundError: No module named 'airflow.providers').

If you experience the problem, you can easily fix it by creating symbolic link in your installed "airflow" folder to the "providers" folder where you installed your backport packages. If you installed it with -e, this link should be created in your airflow sources, if you installed it with the --user flag it should be from the ~/.local/lib/pythonX.Y/site-packages/airflow/ folder,

Contributing

Want to help build Apache Airflow? Check out our contributing documentation.

Who uses Apache Airflow?

More than 350 organizations are using Apache Airflow in the wild.

Who Maintains Apache Airflow?

Airflow is the work of the community, but the core committers/maintainers are responsible for reviewing and merging PRs as well as steering conversation around new feature requests. If you would like to become a maintainer, please review the Apache Airflow committer requirements.

Can I use the Apache Airflow logo in my presentation?

Yes! Be sure to abide by the Apache Foundation trademark policies and the Apache Airflow Brandbook. The most up to date logos are found in this repo and on the Apache Software Foundation website.

Airflow merchandise

If you would love to have Apache Airflow stickers, t-shirt etc. then check out Redbubble Shop.