-
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
Make passing build args explicit in ci/prod builds #35768
Conversation
b92c02b
to
29aa280
Compare
@@ -550,13 +614,6 @@ def run_build_ci_image( | |||
:param ci_image_params: CI image parameters | |||
:param output: output redirection | |||
""" | |||
if not ci_image_params.version_suffix_for_pypi: |
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.
Moved as default value for CI build
@@ -35,7 +35,7 @@ | |||
"--image-tag", | |||
"--tag-as-latest", | |||
"--docker-cache", | |||
"--force-build", |
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.
It was not used. When you order a build build is forced.
29aa280
to
c391940
Compare
c391940
to
c350c37
Compare
When building hte image, breeze converts some simple parameters passed as breeze command (with autocompletion and explanation) into much longer and more complex set of build args that are passed to `docker build` command. The way how passing hte args worked so far is that it was pretty implicit: * **kwargs were used to ingest `click` flags * parameters found as empty/None were filtered out from these * Build*Params dataclass was created out of such kwargs dict * argumenst from dataclass (with some customization) were converted to --build-arg (CAPITALIZED_PROPERTY_NAME) This had a lot of implicitness and it was not easy to understand whether the parameters passed were correct and how they passed through this chain. This change makes all the build arg much more explicit - without kwargs and dictionary. Each CI/PROD build param has now a method where it explicitly converts arguments into build-args - including specifying which of those are optional (where you can actually filter out Empty and None values) and which are required (where an actual value is expected). This PR also cleans up the click flags sequence and their presence as well as the output of help command (they were grouped with more related parameters)
cc: @Bowrna -> rewritten the old breeze argument passing now to be more explicit :) |
c350c37
to
72ab626
Compare
Result of discussion in https://apache-airflow.slack.com/archives/CQ9QHSFQX/p1700490311364209 |
I checked carefully and mapping of parmeters to build args looks good - I also cleaned up some duplicates along the way (like duplicate --progress` |
The `--force-build` command has not been used for a long time in the `ci-image build` command for quite some time because the sheer fact that you run the command means that you want to run the build (so it made no sense to have it). The command only makes sense when you want to force build when running `breeze` or `breeze start-airflow` command. However commands to build cache in CI still had this command used and it caused the builds to fail after merging apache#35768 when the option has been removed (it was not detected there, because cache steps only run in main build)
The `--force-build` command has not been used for a long time in the `ci-image build` command for quite some time because the sheer fact that you run the command means that you want to run the build (so it made no sense to have it). The command only makes sense when you want to force build when running `breeze` or `breeze start-airflow` command. However commands to build cache in CI still had this command used and it caused the builds to fail after merging #35768 when the option has been removed (it was not detected there, because cache steps only run in main build)
When building hte image, breeze converts some simple parameters passed as breeze command (with autocompletion and explanation) into much longer and more complex set of build args that are passed to `docker build` command. The way how passing hte args worked so far is that it was pretty implicit: * **kwargs were used to ingest `click` flags * parameters found as empty/None were filtered out from these * Build*Params dataclass was created out of such kwargs dict * argumenst from dataclass (with some customization) were converted to --build-arg (CAPITALIZED_PROPERTY_NAME) This had a lot of implicitness and it was not easy to understand whether the parameters passed were correct and how they passed through this chain. This change makes all the build arg much more explicit - without kwargs and dictionary. Each CI/PROD build param has now a method where it explicitly converts arguments into build-args - including specifying which of those are optional (where you can actually filter out Empty and None values) and which are required (where an actual value is expected). This PR also cleans up the click flags sequence and their presence as well as the output of help command (they were grouped with more related parameters)
The `--force-build` command has not been used for a long time in the `ci-image build` command for quite some time because the sheer fact that you run the command means that you want to run the build (so it made no sense to have it). The command only makes sense when you want to force build when running `breeze` or `breeze start-airflow` command. However commands to build cache in CI still had this command used and it caused the builds to fail after merging #35768 when the option has been removed (it was not detected there, because cache steps only run in main build)
When building hte image, breeze converts some simple parameters passed as breeze command (with autocompletion and explanation) into much longer and more complex set of build args that are passed to `docker build` command. The way how passing hte args worked so far is that it was pretty implicit: * **kwargs were used to ingest `click` flags * parameters found as empty/None were filtered out from these * Build*Params dataclass was created out of such kwargs dict * argumenst from dataclass (with some customization) were converted to --build-arg (CAPITALIZED_PROPERTY_NAME) This had a lot of implicitness and it was not easy to understand whether the parameters passed were correct and how they passed through this chain. This change makes all the build arg much more explicit - without kwargs and dictionary. Each CI/PROD build param has now a method where it explicitly converts arguments into build-args - including specifying which of those are optional (where you can actually filter out Empty and None values) and which are required (where an actual value is expected). This PR also cleans up the click flags sequence and their presence as well as the output of help command (they were grouped with more related parameters)
The `--force-build` command has not been used for a long time in the `ci-image build` command for quite some time because the sheer fact that you run the command means that you want to run the build (so it made no sense to have it). The command only makes sense when you want to force build when running `breeze` or `breeze start-airflow` command. However commands to build cache in CI still had this command used and it caused the builds to fail after merging #35768 when the option has been removed (it was not detected there, because cache steps only run in main build)
When building hte image, breeze converts some simple parameters passed as breeze command (with autocompletion and explanation) into much longer and more complex set of build args that are passed to
docker build
command. The way how passing hte args worked so far is that it was pretty implicit:click
flagsThis had a lot of implicitness and it was not easy to understand whether the parameters passed were correct and how they passed through this chain.
This change makes all the build arg much more explicit - without kwargs and dictionary. Each CI/PROD build param has now a method where it explicitly converts arguments into build-args - including specifying which of those are optional (where you can actually filter out Empty and None values) and which are required (where an actual value is expected).
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.