potiuk commented on code in PR #38637:
URL: https://github.com/apache/airflow/pull/38637#discussion_r1546160992
##########
.github/workflows/prod-image-build.yml:
##########
@@ -104,7 +104,7 @@ on: # yamllint disable-line rule:truthy
required: true
type: string
upgrade-to-newer-dependencies:
- description: "Whether to attempt to upgrade image to newer
dependencies (false/RANDOM_VALUE)"
+ description: "Whether to attempt to upgrade image to newer
dependencies (true/false)"
Review Comment:
This is what I tried to make explicit by renaming the two parameters:
* upgrade-to-newer-dependencies is true/false parameter (and binary flag)
that we can set in breeze or in CI workflows
* but it gets translated to a random hash when we add `--build-arg` when
building the image. The thing is that we need to have a way to invalidate a
layer in the image, so every time we use `--upgrade-to-newer-dependencies`, the
layer that install dependencies gets invalidated. So we cannot use true/false
here - because if we use `true`, then second runs with
`--upgrade-to-newer-dependencies` will not invalidate the layer that we would
like to rebuild. That's why in breeze when `--upgrade-to-newer-dependencies` is
used we do this:
https://github.com/apache/airflow/blob/main/dev/breeze/src/airflow_breeze/params/build_ci_params.py#L75
```
self._opt_arg("UPGRADE_TO_NEWER_DEPENDENCIES",
f"{random.randrange(2**32):x}")
```
That's why this PR makes a distinction betwen the
`--upgrade-to-newer-dependencies` flag and `UPGRADE_TO_NEWER_DEPENDENCIES_HASH`
build arg.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]