You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2024/03/30 20:49:18 UTC

[PR] Rename build arg for upgrade-to-newer-dependencies to include hash [airflow]

potiuk opened a new pull request, #38637:
URL: https://github.com/apache/airflow/pull/38637

   The "UPGRADE_TO_NEWER_DEPENDENCIES" build arg was a bit misleading as it was not a true/false value but rather "random hash"/"false".
   
   This PR makes it a bit more explicit:
   
   * the arg is named UPGRADE_TO_NEWER_DEPENDENCIES_HASH
   * it's default is "" not false and all conditions are set to check for != or == "".
   
   The inputs/outputs in CI job remain as they were - "true/false" but this PR makes it clearer.
   
   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   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](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rename build arg for upgrade-to-newer-dependencies to include hash [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #38637:
URL: https://github.com/apache/airflow/pull/38637#discussion_r1545524920


##########
.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:
   I'm a bit confused. If this is no longer related to `UPGRADE_TO_NEWER_DEPENDENCIES_HASH`, where is `UPGRADE_TO_NEWER_DEPENDENCIES_HASH` generated?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rename build arg for upgrade-to-newer-dependencies to include hash [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rename build arg for upgrade-to-newer-dependencies to include hash [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #38637:
URL: https://github.com/apache/airflow/pull/38637#issuecomment-2031253795

   I shortened the name a bit :)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rename build arg for upgrade-to-newer-dependencies [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #38637:
URL: https://github.com/apache/airflow/pull/38637


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rename build arg for upgrade-to-newer-dependencies to include hash [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #38637:
URL: https://github.com/apache/airflow/pull/38637#discussion_r1546161428


##########
.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:
   (BTW, maybe a better name would be appropriate :) to decrease the confusion - I welcome any ideas here :) ) 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Rename build arg for upgrade-to-newer-dependencies to include hash [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #38637:
URL: https://github.com/apache/airflow/pull/38637#discussion_r1546164486


##########
.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:
   I proposed `INVALIDATION_RANDOM_STRING_FOR_UPGRADE_TO_NEWER_DEPENDENCIES` -> long but might be a more explicit way to express what it is all about



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org