GithubHelp home page GithubHelp logo

dea-airflow's Introduction

Geoscience Australia DEA Airflow DAGs repository

Deployment Workflow

This repository contains two branches, master and develop.

The master branch requires Pull Requests and code reviews to merge code into it. It deploys automatically to the Production (Sandbox) Airflow deployment.

The develop branch accepts pushes directly, or via Pull Request, and deploys automatically to the Development Airflow.

We're not happy with this strategy, and are looking for an alternative that doesn't have us deploying and inadvertently running code in multiple places by accident, but haven't come up with anything yet.

Development Using Docker

If you have Docker available, by far the easiest development setup is to use Docker Compose.

First, initialise some environment variables:

python -c 'from cryptography.fernet import Fernet; print("FERNET_KEY=" + Fernet.generate_key().decode())' > .env
echo UID=`id -u` >> .env
echo GID=`id -g` >> .env

Then start up docker-compose:

docker-compose up

Local Editing of DAG's

DAGs can be locally edited and validated. Development can be done in conda or venv according to developer preference. Grab everything airflow and write DAGs. Use autopep8 and pylint to achieve import validation and consistent formatting as the CI pipeline for this repository matures.

pip install apache-airflow[aws,kubernetes,postgres,redis,ssh,celery]
pip install pylint pylint-airflow

pylint dags plugins

Pre-commit setup

A pre-commit config is provided to automatically format and check your code changes. This allows you to immediately catch and fix issues before you raise a failing pull request (which run the same checks under Travis).

If you don't use Conda, install pre-commit from pip:

pip install pre-commit

If you do use Conda, install from conda-forge (required because the pip version uses virtualenvs which are incompatible with Conda's environments)

conda install pre_commit

Now install the pre-commit hook to the current repository:

pre-commit install

Your code will now be formatted and validated before each commit. You can also invoke it manually by running pre-commit run --all-files

dea-airflow's People

Contributors

omad avatar pindge avatar whatnick avatar nikitagandhi avatar alexgleith avatar uchchwhash avatar dunkgray avatar bluetyson avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.