Giter Site home page Giter Site logo

josesaribeiro / airflow-dags Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kavisek/demo-airflow

0.0 0.0 0.0 433 KB

This is a repo for my peers in Toronto, that are curious on how Apache Airflow work. I have uploaded some DAGs that I created for reference.

Jupyter Notebook 52.36% Python 47.64%

airflow-dags's Introduction

Automating Workflows with Airflow

Apache Airflow is a like a crontab on steroids. Its a pipeline framework that can be used for ETL processing and model training if your are dealing with very large complex setups. The framework allows you to run multiple jobs across different workers. I have a simple implementation of Airflow running on my local machine. If you want to set up an instance on your local machine use the small tutorial found below

This repo contains some useful DAGs (dynamic acyclic graphs) in Python that I use to automate my workflow. Feel free to modify these DAGs to your use case.

DAG Descriptions

  • train_models.py - Run notebooks and the model within them overnight every night
  • update_blog.py - Run a python script that generates the content for my blog overnight
  • update_logs.py - Output a log every hours to makes sure the Airflow Scheduler is working

Local Airflow Setup Instructions

  1. Create a virtual environment using conda.

conda create --name airflow

  1. Activate and enter your new virtual environment

source activate airflow

  1. Conda Install Airflow into the "airflow" environment

conda install -c conda-forge airflow

  1. Start the Airflow web server.

airflow webserver -p 8080

  1. Start the Airflow scheduler

airflow scheduler

  1. Visit "http://localhost:8080/admin/" to view the Airflow Dashboard to run your DAGs

Image

General Notes

As I learn more through my experimentation. I will be adding to these notes below.

  • You can modify Airflow paths and DAG locations in the Airflow config file.
  • If you are running bash script using the Bash Operator place an extra space at the end of the Python script.
  • If you modify or add a DAG to Airflow, it can take up to 5 minutes so show up in the web server.
  • If you change the name of a DAG, unlink the DAG in Airflow before renaming it within the Python file.

Sources

airflow-dags's People

Contributors

kavisek 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.