{"id":16252376,"url":"https://github.com/remarkablemark/heroku-airflow","last_synced_at":"2025-04-08T12:42:04.781Z","repository":{"id":66056496,"uuid":"512866437","full_name":"remarkablemark/heroku-airflow","owner":"remarkablemark","description":"Deploy Airflow to Heroku","archived":false,"fork":false,"pushed_at":"2022-07-14T04:13:55.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T08:45:08.413Z","etag":null,"topics":["airflow","heroku","python"],"latest_commit_sha":null,"homepage":"https://remarkabl.org/blog/2022/07/13/deploy-airflow-to-heroku/","language":"Procfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remarkablemark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["remarkablemark"],"patreon":"remarkablemark","open_collective":null,"ko_fi":"remarkablemark","tidelift":null,"community_bridge":null,"liberapay":"remarkablemark","issuehunt":null,"otechie":null,"custom":["https://b.remarkabl.org/teespring"]}},"created_at":"2022-07-11T18:23:13.000Z","updated_at":"2023-08-31T06:17:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"4304f385-fdde-4e2c-86f5-73fb9c6d56c1","html_url":"https://github.com/remarkablemark/heroku-airflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fheroku-airflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fheroku-airflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fheroku-airflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkablemark%2Fheroku-airflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkablemark","download_url":"https://codeload.github.com/remarkablemark/heroku-airflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247845897,"owners_count":21005923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airflow","heroku","python"],"created_at":"2024-10-10T15:13:26.932Z","updated_at":"2025-04-08T12:42:04.760Z","avatar_url":"https://github.com/remarkablemark.png","language":"Procfile","funding_links":["https://github.com/sponsors/remarkablemark","https://patreon.com/remarkablemark","https://ko-fi.com/remarkablemark","https://liberapay.com/remarkablemark","https://b.remarkabl.org/teespring"],"categories":[],"sub_categories":[],"readme":"# heroku-airflow\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\nDeploy [Airflow](https://airflow.apache.org/) to [Heroku](https://www.heroku.com/). Read the [blog post](https://remarkablemark.org/blog/2022/07/13/deploy-airflow-to-heroku/).\n\n## Stack\n\n- [Celery](https://docs.celeryq.dev/)\n- [Mailgun](https://elements.heroku.com/addons/mailgun)\n- [PostgreSQL](https://elements.heroku.com/addons/heroku-postgresql)\n- [Redis](https://elements.heroku.com/addons/rediscloud)\n\n## Install\n\nCreate a virtual environment:\n\n```sh\npython3 -m venv venv\n```\n\nActivate the venv:\n\n```sh\nsource venv/bin/activate\n```\n\nInstall the dependencies:\n\n```sh\npip3 install -r requirements.txt\n```\n\n## Run\n\nRun an all-in-one copy of Airflow locally:\n\n```sh\nairflow standalone\n```\n\n## Env\n\nEnsure the config vars from [app.json](app.json) are set in your Heroku app:\n\n```sh\nAIRFLOW__CELERY__WORKER_CONCURRENCY=2\nAIRFLOW__CORE__FERNET_KEY=\nAIRFLOW_HOME=/app\nAIRFLOW__WEBSERVER__BASE_URL=\nAIRFLOW__WEBSERVER__COOKIE_SAMESITE=Strict\nAIRFLOW__WEBSERVER__COOKIE_SECURE=True\nAIRFLOW__WEBSERVER__SECRET_KEY=\nAIRFLOW__WEBSERVER__WORKERS=2\n```\n\nGenerate a `AIRFLOW__CORE__FERNET_KEY`:\n\n```sh\npython3 -c \"from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())\"\n```\n\nSet `AIRFLOW__CORE__FERNET_KEY` in your Heroku app:\n\n```sh\nheroku config:set AIRFLOW__CORE__FERNET_KEY=$(python3 -c \"from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())\")\n```\n\nGenerate a `AIRFLOW__WEBSERVER__SECRET_KEY`:\n\n```sh\nopenssl rand -base64 32 # head -c 32 /dev/random | base64\n```\n\nSet `AIRFLOW__WEBSERVER__SECRET_KEY` in your Heroku app:\n\n```sh\nheroku config:set AIRFLOW__WEBSERVER__SECRET_KEY=$(openssl rand -base64 32)\n```\n\n## Database\n\nIf you're seeing the error in your Heroku logs:\n\n```\nERROR: You need to initialize the database. Please run `airflow db init`.\n```\n\nThen verify your Airflow config looks good before initializing the database in your Heroku app:\n\n```sh\nheroku run bash\nairflow info\nairflow db init\n```\n\n## User\n\nCreate a user in your Heroku app:\n\n```sh\nheroku run bash\nairflow users create -e EMAIL -f FIRSTNAME -l LASTNAME [-p PASSWORD] -r ROLE [--use-random-password] -u USERNAME\n```\n\nHere's an example of how to create an admin user:\n\n```sh\nairflow users create \\\n  --username admin \\\n  --firstname FIRST_NAME \\\n  --lastname LAST_NAME \\\n  --role Admin \\\n  --email admin@example.org\n```\n\n## Resources\n\n- [How to deploy Airflow to Heroku](https://remarkablemark.org/blog/2022/07/13/deploy-airflow-to-heroku/)\n- [heroku/heroku-airflow](https://github.com/heroku/heroku-airflow)\n- [slyapustin/airflow-on-heroku](https://github.com/slyapustin/airflow-on-heroku)\n- [jsoyland/heroku_airflow](https://github.com/jsoyland/heroku_airflow)\n- [Running Airflow on Heroku](https://medium.com/@damesavram/running-airflow-on-heroku-ed1d28f8013d)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Fheroku-airflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkablemark%2Fheroku-airflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkablemark%2Fheroku-airflow/lists"}