Coder Social home page Coder Social logo

airflow_templates's Introduction

Overview (local Airflow)

Simple instructions for a local install of Airflow (see the Makefile).

To create a local install of Airflow containing the prerequisite files, run make!

Note: template_dag is also timezone-aware (i.e., uses the python module pendulum).


Contents

  • How-to run
    • Local Airflow install
    • Running Airflow locally, post-install
    • Scripted Airflow variable creation via CLI
    • Scripted Airflow connection creation via CLI

How-to run

Local Airflow install

To create a local install of Airflow containing the prerequisite files, run make!


Scripted Airflow variable creation via CLI

To create an Airflow variable, add / change the entries listed in the Makefile recipe create_airflow_variables

Scripted Airflow connection creation via CLI

To create an Airflow connection, add / change the entries listed in the Makefile recipe create_airflow_connections

As well as containing a Makefile to script the install of a local Airflow instance, the Makefile shows the commands to script the creation of Airflow variables and connections.


Airflow config airflow.cfg

Some of the Airflow config changes that have been applied include:

Note: Many of these changes have been applied/come from this Medium.com blog post.

Config change Config section Description
dags_folder core To obviously point to the correct DAGs folder!
default_timezone core To use the local/desired timezone, as opposed to UTC
load_examples core This is set to False to prevent loading the examples
hide_sensitive_variable_fields core This is set to True to hide values from some variables.
colored_console_log logging This is set to False to help resolve some Airflow logging errors produced
auth_backend api For local dev purposes, this is set to basic_auth. This allows API calls to be made without needing to generate tokens
default_ui_timezone webserver Similar to the 2nd point, this ensures the time used on the UI uses this timezone rather than UTC time
dag_default_view webserver I use the graph! Saves an extra click
min_file_process_interval scheduler Reduce the number of seconds Airflow waits to look for DAG changes. I set this to 5 for local dev work
dag_dir_list_interval scheduler Same as the above, I set this to 5 for the same reason.
catchup_by_default scheduler This value is set to True by default. It means each time you unpause the DAG all the missed dagruns will start immediately.

Todo

  1. Done - Fetch DAG metadata.
  2. Done - For a given DAG, get the corresponding TASK metadata
  3. Done - Create task groups
  4. In progress - Create unit tests
  5. Not started - Use task decorators
  6. Airflow templates

Reading / links (note to self)

https://marclamberti.com/blog/templates-macros-apache-airflow/ https://stackoverflow.com/questions/46059161/airflow-how-to-pass-xcom-variable-into-python-function

airflow_templates's People

Contributors

paulf-999 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.