You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/16 20:41:55 UTC

[GitHub] [airflow] ajbosco opened a new pull request #22323: enable optional subPath for dags volume mount

ajbosco opened a new pull request #22323:
URL: https://github.com/apache/airflow/pull/22323


   <!--
   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 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/
   -->
   Users may have their DAGs on a volume that includes other things and as such want to use a `subPath` on the Volume Mount. This is similar to how the `gitSync` Volume Mount is setup.
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+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 [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
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



[GitHub] [airflow] jedcunningham commented on a change in pull request #22323: enable optional subPath for dags volume mount

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #22323:
URL: https://github.com/apache/airflow/pull/22323#discussion_r835622010



##########
File path: tests/charts/test_scheduler.py
##########
@@ -518,3 +518,11 @@ def test_log_groomer_resources(self):
                 "memory": "2Gi",
             },
         } == jmespath.search("spec.template.spec.containers[1].resources", docs[0])
+
+    def test_dags_persistence_subpath(self):
+        docs = render_chart(
+            values={"dags": {"persistence": {"enabled": True, "subPath": "test/dags"}}},
+            show_only=["templates/scheduler/scheduler-deployment.yaml"],
+        )
+
+        assert "dags" in jmespath.search("spec.template.spec.containers[0].volumeMounts[*].name", docs[0])

Review comment:
       This isn't a "good" assertion, as it would pass without any of your subpath template changes, or even without subPath in the values in this test. Try something like this instead:
   
   ```suggestion
           assert "test/dags" == jmespath.search("spec.template.spec.containers[0].volumeMounts[?name == 'dags'].subPath", docs[0])
   ```




-- 
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



[GitHub] [airflow] jedcunningham merged pull request #22323: enable optional subPath for dags volume mount

Posted by GitBox <gi...@apache.org>.
jedcunningham merged pull request #22323:
URL: https://github.com/apache/airflow/pull/22323


   


-- 
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



[GitHub] [airflow] jedcunningham commented on a change in pull request #22323: enable optional subPath for dags volume mount

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #22323:
URL: https://github.com/apache/airflow/pull/22323#discussion_r835652020



##########
File path: tests/charts/test_scheduler.py
##########
@@ -518,3 +518,11 @@ def test_log_groomer_resources(self):
                 "memory": "2Gi",
             },
         } == jmespath.search("spec.template.spec.containers[1].resources", docs[0])
+
+    def test_dags_persistence_subpath(self):
+        docs = render_chart(
+            values={"dags": {"persistence": {"enabled": True, "subPath": "test/dags"}}},
+            show_only=["templates/scheduler/scheduler-deployment.yaml"],
+        )
+
+        assert "dags" in jmespath.search("spec.template.spec.containers[0].volumeMounts[*].name", docs[0])

Review comment:
       In fact, adding it to this test would be even better:
   https://github.com/apache/airflow/blob/c063fc688cf20c37ed830de5e3dac4a664fd8241/tests/charts/test_airflow_common.py#L47




-- 
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



[GitHub] [airflow] jedcunningham commented on a change in pull request #22323: enable optional subPath for dags volume mount

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #22323:
URL: https://github.com/apache/airflow/pull/22323#discussion_r835622010



##########
File path: tests/charts/test_scheduler.py
##########
@@ -518,3 +518,11 @@ def test_log_groomer_resources(self):
                 "memory": "2Gi",
             },
         } == jmespath.search("spec.template.spec.containers[1].resources", docs[0])
+
+    def test_dags_persistence_subpath(self):
+        docs = render_chart(
+            values={"dags": {"persistence": {"enabled": True, "subPath": "test/dags"}}},
+            show_only=["templates/scheduler/scheduler-deployment.yaml"],
+        )
+
+        assert "dags" in jmespath.search("spec.template.spec.containers[0].volumeMounts[*].name", docs[0])

Review comment:
       This isn't a "good" assertion, as it would pass without any of your subpath template changes, or even without subPath in the values in this test. Try something like this instead:
   
   ```suggestion
           assert "test/dags" in jmespath.search("spec.template.spec.containers[0].volumeMounts[?name == 'dags'].subPath", docs[0])
   ```




-- 
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



[GitHub] [airflow] jedcunningham commented on pull request #22323: enable optional subPath for dags volume mount

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #22323:
URL: https://github.com/apache/airflow/pull/22323#issuecomment-1080942330


   On second look, can you add the option to `values.yaml` as well?
   
   ```
   dags:
     persistence:
       subPath: ~
   ```


-- 
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



[GitHub] [airflow] potiuk commented on pull request #22323: enable optional subPath for dags volume mount

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #22323:
URL: https://github.com/apache/airflow/pull/22323#issuecomment-1073739803


   I think it's a good idea @jedcunningham ? @dstandish ? WDYT?


-- 
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



[GitHub] [airflow] github-actions[bot] commented on pull request #22323: enable optional subPath for dags volume mount

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #22323:
URL: https://github.com/apache/airflow/pull/22323#issuecomment-1073741209


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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