-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix airflow db check-migrations
#19597
Fix airflow db check-migrations
#19597
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the check in my environment.
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
Shoudl we add some test for that one? It might be similarly broken in the future? |
Yes good call. Added a simple happy-path test for now. |
034f4ca
to
85799a0
Compare
That's exactly what I had in mind :) |
This command broke after "Define datetime and StringID column types centrally in migrations" was merged, but we didn't notice as Github styles timedout checks badly.
85799a0
to
ed09464
Compare
Looks like prod image building was broken by a failed runner or smth (and it was needed to test the Helm Chart). Closed/reopened to re-run it |
Helm Chart tests have been failing consistently for a while now. |
Right -- I didn't think it was likely. |
(wait - it was without the latest PR merged). |
Retrying |
My kind cluster is now working (https://kind.sigs.k8s.io/docs/user/known-issues/#failure-to-create-cluster-with-cgroups-v2 was my problem), also trying. |
Confirmed I have the PR in the airflow installed in the image, so this is a "legit" error |
AAAAAAHHHHH
|
Not the best idea to have it in the helm chart. |
Whhhoooopsss yeah -- I think it was in Helm Chart as previous Airflow versions didn't have support for "airflow db wait-for-migrations" command |
OH! |
|
Yeah, that's the problem. The helm chart isn't using that command. 5 mins too slow. |
So eventually the Helm errors ARE real errors :). Happy we have the tests. |
I think for now reverting the change is the only choice and it will be a breaking change for anyone using Helm < 1.4.0 even if we fix it there (and run airflow db wait-for-migrations for 2+) |
Something like this will do the job: try:
from airflow.cli.commands.db_command import check_migrations
except ImportError:
# existing code |
Yeah. But the problem is for those who already use the chart |
We could (somehow) say the Airflow 2.3 will need Helm Chart >= 1.4 I guess? Far from ideal. |
Not possible to make it backwards compatible somehow 😬 ? #19408 is mainly just to centralize the IDs and types that are used in Migration |
Another option is smart workaround. For example what we could do: in settings ( Not the "cleanest" solution but should work. |
or even in "init.py" of "airflow" package - it is imported in the first line |
Should not be too difficult - we could check what was the command python was executed with :) |
And as of chart 1.4.0 we would do it "properly". |
Here is the "proper" fix anyway which should make tests go green #19676 |
And back-compat fix incoming. |
This is fixed in main now, and 2.3 won't need a particular version of the Helm chart either. |
This command broke after Define datetime and StringID column types centrally in migrations #19408 was merged, but we didn't notice as Github styles timedout checks badly.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
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.