2018-11-13 17:01:44 +03:00
<!--
2019-08-22 06:27:54 +03:00
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
2018-11-13 17:01:44 +03:00
-->
2020-11-10 12:36:45 +03:00
2019-01-05 17:05:25 +03:00
# Apache Airflow
2014-10-07 01:29:38 +04:00
2017-05-09 23:14:50 +03:00
[![PyPI version ](https://badge.fury.io/py/apache-airflow.svg )](https://badge.fury.io/py/apache-airflow)
2020-08-10 10:29:28 +03:00
[![GitHub Build ](https://github.com/apache/airflow/workflows/CI%20Build/badge.svg )](https://github.com/apache/airflow/actions)
2019-01-05 17:05:25 +03:00
[![Coverage Status ](https://img.shields.io/codecov/c/github/apache/airflow/master.svg )](https://codecov.io/github/apache/airflow?branch=master)
2018-05-02 09:36:59 +03:00
[![License ](http://img.shields.io/:license-Apache%202-blue.svg )](http://www.apache.org/licenses/LICENSE-2.0.txt)
2018-09-04 10:34:20 +03:00
[![PyPI - Python Version ](https://img.shields.io/pypi/pyversions/apache-airflow.svg )](https://pypi.org/project/apache-airflow/)
2020-07-24 22:31:36 +03:00
[![Docker Pulls ](https://img.shields.io/docker/pulls/apache/airflow.svg )](https://hub.docker.com/r/apache/airflow)
[![Docker Stars ](https://img.shields.io/docker/stars/apache/airflow.svg )](https://hub.docker.com/r/apache/airflow)
2020-11-04 03:06:37 +03:00
[![PyPI - Downloads ](https://img.shields.io/pypi/dm/apache-airflow )](https://pypi.org/project/apache-airflow/)
[![Code style: black ](https://img.shields.io/badge/code%20style-black-000000.svg )](https://github.com/psf/black)
2018-09-11 00:30:35 +03:00
[![Twitter Follow ](https://img.shields.io/twitter/follow/ApacheAirflow.svg?style=social&label=Follow )](https://twitter.com/ApacheAirflow)
2020-07-28 15:46:59 +03:00
[![Slack Status ](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social )](https://s.apache.org/airflow-slack)
2015-10-21 21:11:22 +03:00
2020-09-10 18:57:59 +03:00
[Apache Airflow ](https://airflow.apache.org/docs/stable/ ) (or simply Airflow) is a platform to programmatically author, schedule, and monitor workflows.
2015-07-22 03:45:33 +03:00
2020-09-10 18:57:59 +03:00
When workflows are defined as code, they become more maintainable, versionable, testable, and collaborative.
2015-08-19 18:51:30 +03:00
2018-09-06 21:57:15 +03:00
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.
2015-07-22 03:45:33 +03:00
2019-08-22 06:27:54 +03:00
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE - RUN doctoc TO UPDATE -->
**Table of contents**
2020-10-30 22:10:30 +03:00
- [Project Focus ](#project-focus )
- [Principles ](#principles )
2020-03-15 01:57:47 +03:00
- [Requirements ](#requirements )
2019-08-22 06:27:54 +03:00
- [Getting started ](#getting-started )
2020-04-22 16:05:37 +03:00
- [Installing from PyPI ](#installing-from-pypi )
2020-09-08 17:03:33 +03:00
- [Official source code ](#official-source-code )
2020-09-21 20:31:42 +03:00
- [Convenience packages ](#convenience-packages )
2019-08-22 06:27:54 +03:00
- [User Interface ](#user-interface )
- [Contributing ](#contributing )
- [Who uses Apache Airflow? ](#who-uses-apache-airflow )
- [Who Maintains Apache Airflow? ](#who-maintains-apache-airflow )
2019-10-18 22:18:44 +03:00
- [Can I use the Apache Airflow logo in my presentation? ](#can-i-use-the-apache-airflow-logo-in-my-presentation )
2020-08-17 22:12:26 +03:00
- [Airflow merchandise ](#airflow-merchandise )
2019-08-22 06:27:54 +03:00
- [Links ](#links )
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2020-10-30 22:10:30 +03:00
## Project Focus
2020-11-01 20:34:34 +03:00
Airflow works best with workflows that are mostly static and slowly changing. When DAG structure is similar from one run to the next, it allows for clarity around unit of work and continuity. Other similar projects include [Luigi ](https://github.com/spotify/luigi ), [Oozie ](https://oozie.apache.org/ ) and [Azkaban ](https://azkaban.github.io/ ).
2020-10-30 22:10:30 +03:00
2020-11-01 20:34:34 +03:00
Airflow is commonly used to process data, but has the opinion that tasks should ideally be idempotent (i.e. results of the task will be the same, and will not create duplicated data in a destination system), and should not pass large quantities of data from one task to the next (though tasks can pass metadata using Airflow's [Xcom feature ](https://airflow.apache.org/docs/stable/concepts.html#xcoms )). For high-volume, data-intensive tasks, a best practice is to delegate to external services that specialize on that type of work.
2020-10-30 22:10:30 +03:00
2020-11-01 20:34:34 +03:00
Airflow is not a streaming solution, but it is often used to process real-time data, pulling data off streams in batches.
2020-10-30 22:10:30 +03:00
## 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.
2020-03-15 01:57:47 +03:00
## Requirements
Apache Airflow is tested with:
2020-12-10 23:52:29 +03:00
| | Master version (2.0.0dev) | Stable version (1.10.14) |
2020-09-10 19:35:16 +03:00
| ------------ | ------------------------- | ------------------------ |
| Python | 3.6, 3.7, 3.8 | 2.7, 3.5, 3.6, 3.7, 3.8 |
2020-10-24 15:39:01 +03:00
| PostgreSQL | 9.6, 10, 11, 12, 13 | 9.6, 10, 11, 12, 13 |
2020-10-04 14:45:05 +03:00
| MySQL | 5.7, 8 | 5.6, 5.7 |
2020-09-10 19:35:16 +03:00
| SQLite | latest stable | latest stable |
2020-11-18 17:34:39 +03:00
| Kubernetes | 1.16.9, 1.17.5, 1.18.6 | 1.16.9, 1.17.5, 1.18.6 |
2020-09-10 19:35:16 +03:00
2020-11-18 17:34:39 +03:00
**Note:** MariaDB and MySQL 5.x are unable to or have limitations with
running multiple schedulers -- please see the "Scheduler" docs.
2020-10-28 23:27:10 +03:00
2020-12-01 12:01:07 +03:00
**Note:** SQLite is used in Airflow tests. Do not use it in production.
2020-10-28 23:27:10 +03:00
2020-04-19 21:46:40 +03:00
### Additional notes on Python version requirements
* Stable version [requires ](https://github.com/apache/airflow/issues/8162 ) at least Python 3.5.3 when using Python 3
2016-03-29 17:37:51 +03:00
## Getting started
2018-08-01 10:50:23 +03:00
2020-09-01 21:06:45 +03:00
Visit the official Airflow website documentation (latest **stable** release) for help with [installing Airflow ](https://airflow.apache.org/installation.html ), [getting started ](https://airflow.apache.org/start.html ), or walking through a more complete [tutorial ](https://airflow.apache.org/tutorial.html ).
2018-02-12 19:26:55 +03:00
2020-11-22 21:45:12 +03:00
> Note: If you're looking for documentation for master branch (latest development branch): you can find it on [s.apache.org/airflow-docs](https://s.apache.org/airflow-docs/).
2016-03-29 17:37:51 +03:00
2020-09-01 21:06:45 +03:00
For more information on Airflow's Roadmap or Airflow Improvement Proposals (AIPs), visit the [Airflow Wiki ](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Home ).
2016-03-28 02:03:39 +03:00
2020-09-01 21:06:45 +03:00
Official Docker (container) images for Apache Airflow are described in [IMAGES.rst ](IMAGES.rst ).
2020-04-02 20:52:11 +03:00
2020-04-22 16:05:37 +03:00
## Installing from PyPI
2020-09-21 20:31:42 +03:00
We publish Apache Airflow as `apache-airflow` package in PyPI. Installing it however might be sometimes tricky
2020-04-22 16:05:37 +03:00
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.
2020-07-20 15:36:03 +03:00
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.
2020-04-22 16:05:37 +03:00
2020-09-25 10:28:47 +03:00
1. Installing just Airflow:
2020-04-22 16:05:37 +03:00
2020-12-05 21:53:09 +03:00
NOTE!!!
On November 2020, new version of PIP (20.3) has been released with a new, 2020 resolver. This resolver
does not yet work with Apache Airflow and might leads to errors in installation - depends on your choice
of extras. In order to install Airflow you need to either downgrade pip to version 20.2.4
`pip upgrade --pip==20.2.4` or, in case you use Pip 20.3, you need to add option
`--use-deprecated legacy-resolver` to your pip install command.
2020-04-22 16:05:37 +03:00
```bash
2020-12-10 23:52:29 +03:00
pip install apache-airflow==1.10.14 \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-1.10.14/constraints-3.7.txt"
2020-04-22 16:05:37 +03:00
```
2020-07-15 21:19:13 +03:00
2. Installing with extras (for example postgres,google)
2020-11-10 06:15:40 +03:00
2020-04-22 16:05:37 +03:00
```bash
2020-12-10 23:52:29 +03:00
pip install apache-airflow[postgres,google]==1.10.14 \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-1.10.14/constraints-3.7.txt"
2020-04-22 16:05:37 +03:00
```
2020-11-20 17:35:56 +03:00
For information on installing backport providers check [/docs/backport-providers.rst][/docs/backport-providers.rst].
2020-09-25 10:28:47 +03:00
2020-09-08 17:03:33 +03:00
## Official source code
2020-07-11 22:21:19 +03:00
2020-09-21 20:31:42 +03:00
Apache Airflow is an [Apache Software Foundation ](http://www.apache.org ) (ASF) project,
and our official source code releases:
2020-09-08 17:50:07 +03:00
- Follow the [ASF Release Policy ](http://www.apache.org/legal/release-policy.html )
2020-09-25 00:28:00 +03:00
- Can be downloaded from [the ASF Distribution Directory ](https://downloads.apache.org/airflow )
2020-09-08 17:50:07 +03:00
- Are cryptographically signed by the release manager
2020-09-21 20:31:42 +03:00
- Are officially voted on by the PMC members during the
[Release Approval Process ](http://www.apache.org/legal/release-policy.html#release-approval )
2020-08-26 19:01:27 +03:00
2020-09-21 20:31:42 +03:00
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.
2020-08-26 19:01:27 +03:00
2020-09-21 20:31:42 +03:00
## Convenience packages
2020-09-08 17:50:07 +03:00
2020-09-21 20:31:42 +03:00
There are other ways of installing and using Airflow. Those are "convenience" methods - they are
not "official releases" as stated by the `ASF Release Policy` , but they can be used by the users
who do not want to build the software themselves.
2020-09-08 17:50:07 +03:00
2020-09-21 20:31:42 +03:00
Those are - in the order of most common ways people install Airflow:
2020-09-08 17:50:07 +03:00
2020-09-21 20:31:42 +03:00
- [PyPI releases ](https://pypi.org/project/apache-airflow/ ) to install Airflow using standard `pip` tool
- [Docker Images ](https://hub.docker.com/repository/docker/apache/airflow ) to install airflow via
`docker` tool, use them in Kubernetes, Helm Charts, `docker-compose` , `docker swarm` etc. You can
read more about using, customising, and extending the images in the
2020-12-07 03:05:21 +03:00
[Latest docs ](https://airflow.apache.org/docs/apache-airflow/stable/production-deployment.html ), and
2020-09-21 20:31:42 +03:00
learn details on the internals in the [IMAGES.rst ](IMAGES.rst ) document.
- [Tags in GitHub ](https://github.com/apache/airflow/tags ) to retrieve the git project sources that
were used to generate official source packages via git
2020-09-08 17:50:07 +03:00
2020-09-21 20:31:42 +03:00
All those artifacts are not official releases, but they are prepared using officially released sources.
Some of those artifacts are "development" or "pre-release" ones, and they are clearly marked as such
following the ASF Policy.
2020-07-11 22:21:19 +03:00
2016-03-19 23:29:17 +03:00
## User Interface
- **DAGs**: Overview of all DAGs in your environment.
2018-08-01 10:50:23 +03:00
2020-12-05 00:07:53 +03:00
![DAGs ](/docs/apache-airflow/img/dags.png )
2016-03-19 23:29:17 +03:00
- **Tree View**: Tree representation of a DAG that spans across time.
2018-08-01 10:50:23 +03:00
2020-12-05 00:07:53 +03:00
![Tree View ](/docs/apache-airflow/img/tree.png )
2016-03-19 23:29:17 +03:00
- **Graph View**: Visualization of a DAG's dependencies and their current status for a specific run.
2018-08-01 10:50:23 +03:00
2020-12-05 00:07:53 +03:00
![Graph View ](/docs/apache-airflow/img/graph.png )
2016-03-19 23:29:17 +03:00
- **Task Duration**: Total time spent on different tasks over time.
2018-08-01 10:50:23 +03:00
2020-12-05 00:07:53 +03:00
![Task Duration ](/docs/apache-airflow/img/duration.png )
2016-03-19 23:29:17 +03:00
- **Gantt View**: Duration and overlap of a DAG.
2018-08-01 10:50:23 +03:00
2020-12-05 00:07:53 +03:00
![Gantt View ](/docs/apache-airflow/img/gantt.png )
2016-03-19 23:29:17 +03:00
- **Code View**: Quick way to view source code of a DAG.
2018-08-01 10:50:23 +03:00
2020-12-05 00:07:53 +03:00
![Code View ](/docs/apache-airflow/img/code.png )
2016-03-19 23:29:17 +03:00
2018-08-22 11:26:54 +03:00
## Contributing
2019-10-13 23:20:31 +03:00
Want to help build Apache Airflow? Check out our [contributing documentation ](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst ).
2018-08-22 11:26:54 +03:00
2018-09-06 21:57:15 +03:00
## Who uses Apache Airflow?
2015-07-22 03:45:33 +03:00
2020-08-26 00:12:16 +03:00
More than 350 organizations are using Apache Airflow [in the wild ](https://github.com/apache/airflow/blob/master/INTHEWILD.md ).
2015-07-22 04:02:15 +03:00
2018-09-06 21:57:15 +03:00
## Who Maintains Apache Airflow?
2018-08-06 04:09:14 +03:00
2019-01-05 17:05:25 +03:00
Airflow is the work of the [community ](https://github.com/apache/airflow/graphs/contributors ),
2018-08-06 04:09:14 +03:00
but the [core committers/maintainers ](https://people.apache.org/committers-by-project.html#airflow )
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
2020-10-27 18:14:54 +03:00
[committer requirements ](https://airflow.apache.org/docs/stable/project.html#committers ).
2018-08-06 04:09:14 +03:00
2019-10-18 22:18:44 +03:00
## Can I use the Apache Airflow logo in my presentation?
2020-12-05 00:07:53 +03:00
Yes! Be sure to abide by the Apache Foundation [trademark policies ](https://www.apache.org/foundation/marks/#books ) and the Apache Airflow [Brandbook ](https://cwiki.apache.org/confluence/display/AIRFLOW/Brandbook ). The most up to date logos are found in [this repo ](/docs/apache-airflow/img/logos ) and on the Apache Software Foundation [website ](https://www.apache.org/logos/about.html ).
2019-10-18 22:18:44 +03:00
2020-08-17 22:12:26 +03:00
## Airflow merchandise
If you would love to have Apache Airflow stickers, t-shirt etc. then check out
[Redbubble Shop ](https://www.redbubble.com/i/sticker/Apache-Airflow-by-comdev/40497530.EJUG5 ).
2015-09-17 20:33:59 +03:00
## Links
2015-07-22 04:02:15 +03:00
2020-03-30 09:20:41 +03:00
- [Documentation ](https://airflow.apache.org/docs/stable/ )
2020-07-28 15:46:59 +03:00
- [Chat ](https://s.apache.org/airflow-slack )