Metadata-Version: 2.1
Name: airflow-docker
Version: 0.2.2
Summary: An opinionated implementation of exclusively using airflow DockerOperators for all Operators
Home-page: https://github.com/huntcsg/airflow-docker
Author: Hunter Senft-Grupp
Author-email: huntcsg@gmail.com
License: Apache License 2.0
Keywords: airflow docker
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: System :: Monitoring
Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
Description-Content-Type: text/markdown
Provides-Extra: testing
Provides-Extra: docs
Provides-Extra: linting
Requires-Dist: apache-airflow[docker] (==1.10.2)
Requires-Dist: airflow-docker-helper (>=0.2.0)
Provides-Extra: docs
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
Provides-Extra: linting
Requires-Dist: isort; extra == 'linting'
Requires-Dist: black; extra == 'linting'
Requires-Dist: flake8; extra == 'linting'
Provides-Extra: testing
Requires-Dist: pytest; extra == 'testing'
Requires-Dist: pytest-cov; extra == 'testing'
Provides-Extra: testing
Requires-Dist: mock; (python_version < "3") and extra == 'testing'

# airflow-docker
[![CircleCI](https://circleci.com/gh/huntcsg/airflow-docker.svg?style=svg)](https://circleci.com/gh/huntcsg/airflow-docker) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/fd30a7ce26094c2b9f2e4d80d671a3d0)](https://www.codacy.com/app/fool.of.god/airflow-docker?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=huntcsg/airflow-docker&amp;utm_campaign=Badge_Grade) [![codecov](https://codecov.io/gh/huntcsg/airflow-docker/branch/master/graph/badge.svg)](https://codecov.io/gh/huntcsg/airflow-docker)

## Description
An opinionated implementation of exclusively using airflow DockerOperators for all Operators.

## Default Operator

```python
from airflow_docker.operator import Operator

task = Operator(
    image='some-image:latest',
    ...
)

```

## Default Sensor

```python
from airflow_docker.operator import Sensor

sensor = Sensor(
    image='some-image:latest',
    ...
)
```

Task Code

```python
from airflow_docker_helper import client

client.sensor(True)
```

## Branch Operator

Dag Task 

```python
from airflow_docker.operator import BranchOperator

branching_task = BranchOperator(
    image='some-image:latest',
    ...
)
```

Task Code

```python
from airflow_docker_helper import client

client.branch_to_tasks(['task1', 'task2'])
```

## Short Circuit Operator

Dag Task 

```python
from airflow_docker.operator import ShortCircuitOperator

short_circuit = ShortCircuitOperator(
    image='some-image:latest',
    ...
)
```

Task Code

```python
from airflow_docker_helper import client

client.short_circuit()  # This task will short circuit if this function gets called
```

## Context Usage

Dag Task 

```python
from airflow_docker.operator import Operator

task = Operator(
    image='some-image:latest',
    provide_context=True,
    ...
)
```

Task Code

```python
from airflow_docker_helper import client

context = client.context()

```

## Configuration

The following operator defaults can be set under the `airflowdocker` namespace:

* force_pull (boolean true/false)
* auto_remove (boolean true/false)
* network_mode

For example, to set `force_pull` to False by default set the following environment variable like so:

```bash
export AIRFLOW__AIRFLOWDOCKER__FORCE_PULL=false

```


