Skip to content

Add Airflow Standalone command - #15826

Merged
kaxil merged 1 commit into
apache:masterfrom
astronomer:standalone
May 17, 2021
Merged

kaxil merged 1 commit into
apache:masterfrom
astronomer:standalone

Conversation

@andrewgodwin

Copy link
Copy Markdown
Contributor

Runs all parts of an airflow deployment under one main process, providing an easier level of entry than Breeze and a very handy tool for local development.

Handles the following:

  • Runs all database migrations/db init steps
  • Creates an admin user if one is not present (with a randomised password)
  • Runs the webserver
  • Runs the scheduler
  • Overrides the executor to be LocalExecutor or SequentialExecutor depending on the database in use

It will also be able to run the triggerer process from AIP-40 with a three-line change once that PR lands.

This diff also updates the quickstart guide to use this rather than the separate commands, since it makes the set of commands significantly shorter.

Runs all parts of an airflow deployment under one main process,
providing an easier level of entry than Breeze and a very handy tool for
local development.
@andrewgodwin
andrewgodwin requested a review from kaxil as a code owner May 13, 2021 16:47
@andrewgodwin
andrewgodwin marked this pull request as draft May 13, 2021 16:52
@potiuk

potiuk commented May 13, 2021

Copy link
Copy Markdown
Member

Nice one! Really like where it goes.

@potiuk
potiuk self-requested a review May 13, 2021 17:53
@potiuk

potiuk commented May 13, 2021 •

Copy link
Copy Markdown
Member

BTW. Breeze has never been a tool for running airflow (the start-airflow command is a recent addition). It's really an environment to run all tests (both unit and integration tests) for airflow development in the same way/environment as they are in CI so that you can locally reproduce CI failures, And the start-airflow command is mostly there to verify if a released airflow version works when installed from packages. So I think there is almost no overlap with Breeze :D

@andrewgodwin

Copy link
Copy Markdown
Contributor Author

So I think there is almost no overlap with Breeze :D

Ah, perfect! It wasn't super clear to me when I was new quite what Breeze was for, so glad we can now have a definitive Thing to point people towards when they just want a quick setup.

@potiuk

potiuk commented May 13, 2021 •

Copy link
Copy Markdown
Member

Ah, perfect! It wasn't super clear to me when I was new quite what Breeze was for, so glad we can now have a definitive Thing to point people towards when they just want a quick setup.

Yeah. BTW for testing DAGs/Running airflow itself we also have https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html - this is mostly targeted at the users and it does not require airflow sources or package (just download docker-compose file and run it)

I think the "standalone" airflow could be (?) used for both developers (if they add something) or users (but this require some more setup from the users I guess). I am thinking about the Docs and where to add them (except the usual command line docs), and I think it's good add it as both a "quick run airflow" option for development and a "quick run" for the users?:

WDYT?

@kaxil kaxil left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3 Love it

@github-actions

Copy link
Copy Markdown
Contributor

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions Bot added the okay to merge It's ok to merge this PR as it does not require more tests label May 13, 2021
@kaxil

kaxil commented May 13, 2021

Copy link
Copy Markdown
Member

Ah, perfect! It wasn't super clear to me when I was new quite what Breeze was for, so glad we can now have a definitive Thing to point people towards when they just want a quick setup.

Yeah. BTW for testing DAGs/Running airflow itself we also have https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html - this is mostly targeted at the users and it does not require airflow sources or package (just download docker-compose file and run it the image)

I think the "standalone" airflow could be (?) used for both developers (if they add something) or users (but this require some more setup from the users I guess). I am thinking about the Docs and where to add them (except the usual command line docs), and I think it's good add it as both a "quick run airflow" option for development and a "quick run" for the users?:

WDYT?

I think we should just keep the "standalone" as "Quick Start" for Users-only not for devs. And ask Users to use ./breeze for development/testing (Contributors)

@potiuk

potiuk commented May 14, 2021 •

Copy link
Copy Markdown
Member

I think we should just keep the "standalone" as "Quick Start" for Users-only not for devs. And ask Users to use ./breeze for development/testing (Contributors)

Fine for me :).

Though I think it might be worth mentioning this one as a "quick" way to test changes locally. It might be super-useful during development of some core changes I think. It's not even a "third option" really - it's more mentioning this command in the "local development environment" and actually even in Breeze :). I am already thinking about the contributor's workshop for the summit and adding a "standalone" command to the workshop would be really great.

There are a few places in our docs (Quick contributors start etc.) that could benefit from explicit mentioning of that command.

Might be worth adding it after #14176 change from @paolaperaza

@andrewgodwin
andrewgodwin marked this pull request as ready for review May 17, 2021 19:20
@kaxil
kaxil merged commit b7d1ea9 into apache:master May 17, 2021
@kaxil
kaxil deleted the standalone branch May 17, 2021 19:26
@potiuk

potiuk commented May 17, 2021

Copy link
Copy Markdown
Member

🎉 . Going to use it in the upcoming workshops @turbaszek FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CLI kind:documentation okay to merge It's ok to merge this PR as it does not require more tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants