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/10/31 18:40:04 UTC

[GitHub] [airflow] JulesTriomphe opened a new pull request, #27419: Add webserverConfigConfigmapName

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

   This PR adds a webserverConfigConfigmapName to use a webserver_config.py in a custom configmap.
   Specifying a value for this configuration overrides the webserverConfig configuration.
   
   This PR is also designed to solve the issue with readOnlyRootFilesystem clusters, and hence mounts the configmap as a volume for all appropriate containers.


-- 
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] JulesTriomphe commented on a diff in pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
JulesTriomphe commented on code in PR #27419:
URL: https://github.com/apache/airflow/pull/27419#discussion_r1038387100


##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},
+                "webserver": {
+                    "waitForMigrations": {"enabled": True},
+                    "webserverConfig": "CSRF_ENABLED = True  # {{ .Release.Name }}",
+                    "webserverConfigConfigmapName": configmap_name,
+                },
+                "workers": {"kerberosSidecar": {"enabled": True}, "persistence": {"enabled": True}},

Review Comment:
   And here for the worker-log-groomer



-- 
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 diff in pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27419:
URL: https://github.com/apache/airflow/pull/27419#discussion_r1034194499


##########
chart/values.yaml:
##########
@@ -976,6 +978,7 @@ webserver:
 
   #   # Flask-WTF flag for CSRF
   #   CSRF_ENABLED = True
+  webserverConfigConfigmapName: ~

Review Comment:
   ```suggestion
     webserverConfigConfigMapName: ~
   ```
   We should match the casing used by k8s.



##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},
+                "webserver": {
+                    "waitForMigrations": {"enabled": True},
+                    "webserverConfig": "CSRF_ENABLED = True  # {{ .Release.Name }}",
+                    "webserverConfigConfigmapName": configmap_name,
+                },
+                "workers": {"kerberosSidecar": {"enabled": True}, "persistence": {"enabled": True}},
+            },
+            show_only=[
+                "templates/scheduler/scheduler-deployment.yaml",
+                "templates/triggerer/triggerer-deployment.yaml",
+                "templates/webserver/webserver-deployment.yaml",
+                "templates/workers/worker-deployment.yaml",

Review Comment:
   This test should probably be moved to `test_airflow_common.py` instead.



##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},
+                "webserver": {
+                    "waitForMigrations": {"enabled": True},
+                    "webserverConfig": "CSRF_ENABLED = True  # {{ .Release.Name }}",
+                    "webserverConfigConfigmapName": configmap_name,
+                },
+                "workers": {"kerberosSidecar": {"enabled": True}, "persistence": {"enabled": True}},

Review Comment:
   ```suggestion
                   "workers": {"kerberosSidecar": {"enabled": True}},
   ```
   
   And here.



##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},
+                "webserver": {
+                    "waitForMigrations": {"enabled": True},

Review Comment:
   ```suggestion
   ```
   
   Same here.



##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},

Review Comment:
   ```suggestion
   ```
   
   We don't need to set these defaults.



-- 
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] JulesTriomphe commented on pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
JulesTriomphe commented on PR #27419:
URL: https://github.com/apache/airflow/pull/27419#issuecomment-1302433294

   The failing check runs fine for me locally. I don't get why it fails 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


[GitHub] [airflow] jedcunningham commented on pull request #27419: Add webserverConfigConfigmapName

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

   Let's just rerun it as a first attempt, as it seems like a time based failure.


-- 
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] JulesTriomphe commented on a diff in pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
JulesTriomphe commented on code in PR #27419:
URL: https://github.com/apache/airflow/pull/27419#discussion_r1038385566


##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},
+                "webserver": {
+                    "waitForMigrations": {"enabled": True},

Review Comment:
   Same 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


[GitHub] [airflow] jedcunningham commented on a diff in pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on code in PR #27419:
URL: https://github.com/apache/airflow/pull/27419#discussion_r1038425424


##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},

Review Comment:
   Sorry, let me be more clear. All of these are already true by default, you don't need to set them explicitly here, and they will still be tested.
   
   e.g. [scheduler.logGroomerSidecar.enabled](https://github.com/apache/airflow/blob/19f1e5bf4b9544ae9775ebd8c57797335be53ed6/chart/values.yaml#L722), [scheduler.waitForMigrations.enabled](https://github.com/apache/airflow/blob/19f1e5bf4b9544ae9775ebd8c57797335be53ed6/chart/values.yaml#L739), [triggerer.waitForMigrations.enabled](https://github.com/apache/airflow/blob/19f1e5bf4b9544ae9775ebd8c57797335be53ed6/chart/values.yaml#L1129)



-- 
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] boring-cyborg[bot] commented on pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on PR #27419:
URL: https://github.com/apache/airflow/pull/27419#issuecomment-1297513000

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, mypy and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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 #27419: Add webserverConfigConfigMapName

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


-- 
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] JulesTriomphe commented on pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
JulesTriomphe commented on PR #27419:
URL: https://github.com/apache/airflow/pull/27419#issuecomment-1303090998

   Looks like it worked. Thanks @jedcunningham !


-- 
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] JulesTriomphe commented on a diff in pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
JulesTriomphe commented on code in PR #27419:
URL: https://github.com/apache/airflow/pull/27419#discussion_r1038426789


##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},

Review Comment:
   Ahh yes, ok, thanks for pointing that out



-- 
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] JulesTriomphe commented on a diff in pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
JulesTriomphe commented on code in PR #27419:
URL: https://github.com/apache/airflow/pull/27419#discussion_r1038385167


##########
tests/charts/test_webserver.py:
##########
@@ -738,6 +750,45 @@ def test_webserver_config_configmap(self):
             == jmespath.search('data."webserver_config.py"', docs[0]).strip()
         )
 
+    def test_webserver_config_configmap_name_volume_mounts(self):
+        configmap_name = "my-configmap"
+        docs = render_chart(
+            values={
+                "scheduler": {"logGroomerSidecar": {"enabled": True}, "waitForMigrations": {"enabled": True}},
+                "triggerer": {"waitForMigrations": {"enabled": True}},

Review Comment:
   Without these we don't test whether the configMap has been mounted to these initContainers and sidecars. I think we should leave these defaults.



-- 
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] JulesTriomphe commented on pull request #27419: Add webserverConfigConfigmapName

Posted by GitBox <gi...@apache.org>.
JulesTriomphe commented on PR #27419:
URL: https://github.com/apache/airflow/pull/27419#issuecomment-1299627145

   Hi @dstandish and @jedcunningham, this PR is also ready for review


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