-
Notifications
You must be signed in to change notification settings - Fork 16.4k
prod image build changes #21956
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
prod image build changes #21956
Conversation
c203235 to
02c063a
Compare
|
Looks cool :) |
841ddf4 to
714b80c
Compare
|
airflow/scripts/ci/libraries/_build_images.sh Line 542 in 408a7d6
Can you give me a few example airflow version that matches this pattern? |
|
714b80c to
66c3443
Compare
|
|
Ah. right - we assume we always have number :) |
|
UPDATED |
66c3443 to
15c1060
Compare
|
@potiuk Could you explain to me what's happening in this code part? If airflow/scripts/ci/libraries/_build_images.sh Lines 336 to 339 in 408a7d6
|
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.
Nice :)
potiuk
left a comment
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.
Just a small nit. :). If you work on tests - feel fre to add them but I am pretty much ready to merge it.
potiuk
left a comment
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.
Just a small nit. :). If you work on tests - feel fre to add them but I am pretty much ready to merge it.
|
@potiuk Could you explain to me how this side effect is put to use? airflow/dev/breeze/tests/test_build_image.py Lines 47 to 52 in 5eb6335
I could understand that you are mocking the return of those functions but I couldn't understand how it's further used in the code. If possible could you tell me or direct me to some relevant place to learn about it |
Sure - this is the key - lambda (in this case) is really an anonymous function: This Is equivalent of this (just written in a shorter way): The "side-effect" really points to the function that will be called when the "read_from_cache_mock" funciton will be actually called. This allows to implement some logic in your test "mocks" - they become a bit smarter this way. Usually (in simple cases) your mocks can be told to return specific value: Also you can tell it to return different values if called multiple times by assigning an iterable to return value: And In the case above, The "read_from_cache_mock" and "check_cache_and_write_mock" values are really very simple implementation tha cache the values in memory and replace the more "file-based" cache. |
|
I see @potiuk thank you. I could better understand the code. |
9dc4c5e to
c2e6b76
Compare
|
@potiuk I have tried to add test for prod image similar to what you have done for CI image. Do you think I can further improve with more tests into prod image? Could you give me suggestion on this? |
a2ea914 to
bbb62ef
Compare
|
@potiuk Could you share your review about this PR? I made relevant changes wrt recent Dockerfile optimisation |
bbb62ef to
39b0195
Compare
|
Rebasing to re-run all tests :) |
|
@potiuk Fixing the Breeze2 tests failure |
ef5f97f to
d4b7743
Compare
d4b7743 to
4da1c05
Compare
|
Wooho! 🎉 |
closes : #21100
related : #21100
This helps to build prod image using Breeze2
^ 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.