GithubHelp home page GithubHelp logo

rslngtn / airflow-dokku Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ohld/airflow-dokku

0.0 0.0 0.0 21 KB

My attempt to run Airflow with Dokku PaaS. Production ready.

License: MIT License

airflow-dokku's Introduction

airflow-dokku

My attempt to run Airflow with Dokku PaaS. In production-ready mode (with Postgres, Redis). This code should also work with Heroku (so this can be called airflow-heroku) but I have not tested it.

Production

I really love to book a small droplet on Digital Ocean, install there a Dokku instance and then to try to run everything as Dokku apps.

Create Dokku app for Airflow

dokku apps:create airflow

Plugins for production-ready Airflow

You need to install & attach Postgres and Redis (this is my random choice, you can try to replace these to Mysql & RabbitMQ).

dokku postgres:create airflow
dokku postgres:link airflow airflow --alias "AIRFLOW__CORE__SQL_ALCHEMY_CONN"

I don't need to scale Airflow's Celery now so I'll skip the Redis installation and attachment (but it is almost the same as for Postgres).

Setup the env variables

dokku config:set airflow \
AIRFLOW__CORE__EXECUTOR=LocalExecutor \
AIRFLOW__CORE__FERNET_KEY='<any large random secret string>' \
AIRFLOW__CORE__LOAD_EXAMPLES=False \
AIRFLOW__CORE__SQL_ALCHEMY_CONN=<copy of DATABASE_URL value from Postgres>

Create Airflow superuser

Open Dokku app's shell:

dokku enter airflow web

And then call the proper airflow CLI command:

airflow users create \
    --username admin \
    --firstname Peter \
    --lastname Parker \
    --role Admin \
    --email [email protected]

Activate Dokku auto deploys with Github Actions CI

Open the file at .github/workflows/dokku.yml and add there the URL to the machine where your Dokku runs. Then open Github repo's Settings tab -> Secrets and add SHH_PRIVATE_KEY variable. GitHub Action CI will use this key to connect to your machine via ssh.

HTTPs with Letsencrypt

If you attach a domain to a Dokku app you can add a HTTPs security to your service. This can be done with Dokku Letsencrypt plugin.

dokku letsencrypt:enable airflow

Contact me if you have any questions.

airflow-dokku's People

Contributors

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