Uh oh!
There was an error while loading. Please reload this page.
prod image build changes - #21956
Conversation
c203235 to
02c063aComparepotiuk
commented
Mar 8, 2022
Looks cool :) |
841ddf4 to
714b80cCompareBowrna
commented
Mar 14, 2022
airflow/scripts/ci/libraries/_build_images.sh Line 542 in 408a7d6 Can you give me a few example airflow version that matches this pattern? |
|
Bowrna
commented
Mar 14, 2022
|
potiuk
commented
Mar 14, 2022
Ah. right - we assume we always have number :) |
potiuk
commented
Mar 14, 2022
UPDATED |
Bowrna
commented
Mar 15, 2022
@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 |
potiuk
left a comment
There was a problem hiding this comment.
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.
Just a small nit. :). If you work on tests - feel fre to add them but I am pretty much ready to merge it.
Bowrna
commented
Mar 19, 2022
@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 |
potiuk
commented
Mar 20, 2022
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. |
Bowrna
commented
Mar 20, 2022
I see @potiuk thank you. I could better understand the code. |
9dc4c5e to
c2e6b76CompareBowrna
commented
Mar 23, 2022
@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
bbb62efCompareBowrna
commented
Mar 25, 2022
@potiuk Could you share your review about this PR? I made relevant changes wrt recent Dockerfile optimisation |
potiuk
commented
Mar 27, 2022
Rebasing to re-run all tests :) |
Bowrna
commented
Mar 28, 2022
@potiuk Fixing the Breeze2 tests failure |
ef5f97f to
d4b7743Comparepotiuk
commented
Mar 29, 2022
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.