Giter Club home page Giter Club logo

data-pipelines-with-airflow's Introduction

Data Pipelines with Airflow

Contents

Data Source

Starting Airflow

Before we run Airflow, let's create these folders first:

mkdir -p mnt/dags mnt/logs mnt/plugins mnt/tests

On Linux, please make sure to configure the Airflow user for the docker-compose:

echo -e "AIRFLOW_UID=$(id -u)" > .env

With LocalExecutor

docker-compose build
docker-compose up

With CeleryExecutor

docker-compose -f docker-compose-celery.yml build
docker-compose -f docker-compose-celery.yml up

With SequentialExecutor (NOT recommended for production use)

docker-compose -f docker-compose-sequential.yml build
docker-compose -f docker-compose-sequential.yml up

To clean up the project, press Ctrl+C then run:

docker-compose down

Airflow S3 Connection to MinIO

Since MinIO offers S3 compatible object storage, we can set the connection type to S3. However, we'll need to set an extra option, so that Airflow connects to MinIO instead of S3.

  • Connection Name: minio or any name you like
  • Connection Type: S3
  • Login: <replace_here_with_your_minio_access_key>
  • Password: <replace_here_with_your_minio_secret_key>
  • Extra: a JSON object with the following properties:
    {
      "host": "http://minio:9000"
    }

Note: If we were using AWS S3, we don't need to specify the host in the extra.

Running Tests

First we need to install pytest:

pip install pytest

Run tests:

export PYTHONPATH=/opt/airflow/plugins
pytest

References

data-pipelines-with-airflow's People

Contributors

zkan avatar

Stargazers

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