Skip to content

Conversation

@dimberman
Copy link
Contributor

@dimberman dimberman commented Apr 8, 2020

This PR creates a "migration spinner" that allows the webserver to wait for all database migrations to complete before starting up. Is a necessary component before we can merge the helm chart.


Make sure to mark the boxes below before creating PR: [x]


In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

@dimberman dimberman requested review from ashb and kaxil April 8, 2020 17:27
@dimberman dimberman added this to the Airflow 1.10.11 milestone Apr 8, 2020
@dimberman dimberman added k8s area:helm-chart Airflow Helm Chart labels Apr 8, 2020
@dimberman dimberman force-pushed the add-migration-wait-script branch from 85a85ed to a8c8950 Compare April 8, 2020 19:37
@dimberman dimberman force-pushed the add-migration-wait-script branch from a8c8950 to ab7faa8 Compare April 13, 2020 19:36
@dimberman dimberman changed the title Add migration waiting script and log cleaner [WIP] Add migration waiting script and log cleaner Apr 14, 2020
@dimberman dimberman changed the title [WIP] Add migration waiting script and log cleaner Add migration waiting script and log cleaner Apr 14, 2020
@dimberman dimberman force-pushed the add-migration-wait-script branch from 2fae38d to 35a8d8f Compare April 14, 2020 17:38
@dimberman dimberman force-pushed the add-migration-wait-script branch 4 times, most recently from 9a8290c to c0d2191 Compare April 15, 2020 04:39
@dimberman
Copy link
Contributor Author

@ashb changing that "and v" in the argument parsing broke a lot of things in non-trivial ways. I think if we want to fix how we parse commands that should be its own ticket.

@dimberman dimberman force-pushed the add-migration-wait-script branch from 4fbd7f5 to 8a08498 Compare April 15, 2020 05:54
@codecov-io
Copy link

codecov-io commented Apr 15, 2020

Codecov Report

Merging #8219 into master will decrease coverage by 54.98%.
The diff coverage is 37.93%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #8219       +/-   ##
===========================================
- Coverage   88.43%   33.45%   -54.99%     
===========================================
  Files         940      940               
  Lines       45354    45381       +27     
===========================================
- Hits        40109    15182    -24927     
- Misses       5245    30199    +24954     
Impacted Files Coverage Δ
airflow/utils/db.py 87.07% <34.61%> (-11.30%) ⬇️
airflow/cli/commands/db_command.py 31.81% <50.00%> (-63.42%) ⬇️
airflow/cli/cli_parser.py 96.39% <100.00%> (-0.89%) ⬇️
airflow/hooks/S3_hook.py 0.00% <0.00%> (-100.00%) ⬇️
airflow/hooks/pig_hook.py 0.00% <0.00%> (-100.00%) ⬇️
airflow/hooks/hdfs_hook.py 0.00% <0.00%> (-100.00%) ⬇️
airflow/hooks/http_hook.py 0.00% <0.00%> (-100.00%) ⬇️
airflow/hooks/jdbc_hook.py 0.00% <0.00%> (-100.00%) ⬇️
airflow/hooks/druid_hook.py 0.00% <0.00%> (-100.00%) ⬇️
airflow/hooks/hive_hooks.py 0.00% <0.00%> (-100.00%) ⬇️
... and 813 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcfee82...58743e0. Read the comment docs.

ashb
ashb previously requested changes Apr 15, 2020
@dimberman dimberman force-pushed the add-migration-wait-script branch 3 times, most recently from 58743e0 to 56d50dc Compare April 15, 2020 19:29
@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Apr 15, 2020
@dimberman dimberman force-pushed the add-migration-wait-script branch from 470a097 to 07203d9 Compare April 15, 2020 20:43
@dimberman dimberman mentioned this pull request Apr 15, 2020
5 tasks
@dimberman dimberman requested a review from ashb April 15, 2020 22:02
This PR creates a "migration spinner" that allows the webserver to wait for all database migrations to complete before starting up. Is a necessary component before we can merge the helm chart.
@dimberman dimberman force-pushed the add-migration-wait-script branch from 07203d9 to 797d737 Compare April 15, 2020 22:05
@dimberman dimberman dismissed ashb’s stale review April 16, 2020 07:11

I have addressed all comments

@dimberman dimberman merged commit baa61c9 into apache:master Apr 16, 2020
@dimberman dimberman deleted the add-migration-wait-script branch April 16, 2020 07:12
ashb added a commit to ashb/airflow that referenced this pull request Apr 16, 2020
In apache#8219 we noticed that we couldn't set a `default=0` because of the
`and v` check. The "add_argument" function in python avoid this by using
**kwargs, but we want type checking so can't directly use the same
there.

This uses the same pattern that configparser does to allow falsey (0,
False) and even `None` as valid values, distinct from not being passed.
ashb added a commit that referenced this pull request Apr 16, 2020
In #8219 we noticed that we couldn't set a `default=0` because of the
`and v` check. The "add_argument" function in python avoid this by using
**kwargs, but we want type checking so can't directly use the same
there.

This uses the same pattern that configparser does to allow falsey (0,
False) and even `None` as valid values, distinct from not being passed.
kaxil pushed a commit to astronomer/airflow that referenced this pull request Jun 17, 2020
It wasn't added until apache#8219, which isn't yet in any release.

This approach is VERY not pretty, but if we want to support Airflow
1.10.10, and not require any changes or external binary in the image,
then this is the only thing I can think of

(For instance, we could say "pip install
https://github.com/astronomer/astronomer-airflow-scripts" if you want to
use this on <1.10.11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CLI area:dev-tools area:helm-chart Airflow Helm Chart area:webserver Webserver related Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants