Skip to main content

Operators and Hooks for Airflow

Project description

airflow-plugin

Operators and Hooks for Airflow

Airflow at Earnest

We use heavily the KubernetesPodOperator for the following reasons:

  • Keep non-scheduling logic out of the scheduler.
  • Avoid locking logic inside Airflow (containers can run through other schedulers).
  • Avoid accumulating python dependencies in the Airflow image.
  • Align with our engineering culture (functional programming and strongly typed languages lead to more maintainable code, Haskell preferred :) ).

As such, you will find most of the Operators we share inherit from the KubernetesPodOperator.

Running the tests locally

  1. Install dev requirements

    pip install -r requirements_dev.txt
    
  2. Run the unit tests

    pytest -v -m "not kubernetes"
    
  3. Start a local kubernetes cluster through docker-for-desktop (Mac/Windows) or minikube (Linux)

  4. Bootstrap the cluster (it'll use the airflow namespace)

    tests/resources/kubernetes/bootstrap.sh
    
  5. Run the kubernetes tests

    AIRFLOW__KUBERNETES__IN_CLUSTER=False pytest -v -m "kubernetes"
    

Releasing

Currently, publishing a new version of the project is a manual process:

  1. Install dev requirements

    pip install -r requirements_dev.txt
    
  2. Edit the version in setup.cfg

  3. Create a new git release:

    # e.g.
    git tag -a v0.0.1
    

    There's a simple template in RELEASE_NOTES_TEMPLATE.md for a release message.

  4. Push the release:

    git push origin v0.0.1
    
  5. Create a source distribution:

    python setup.py sdist bdist_wheel
    
  6. Upload to PyPi

    twine upload dist/*
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

earnest-airflow-plugin-0.0.1.tar.gz (21.2 kB view hashes)

Uploaded Source

Built Distribution

earnest_airflow_plugin-0.0.1-py3-none-any.whl (21.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page