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 2020/04/11 17:06:10 UTC

[GitHub] [airflow] BasPH opened a new issue #8255: Config value interpolation not working when set as environment variable

BasPH opened a new issue #8255: Config value interpolation not working when set as environment variable
URL: https://github.com/apache/airflow/issues/8255
 
 
   **Apache Airflow version**:
   1.10.10
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**:
   - **OS** (e.g. from /etc/os-release):
   - **Kernel** (e.g. `uname -a`):
   - **Install tools**:
   - **Others**:
   
   **What happened**:
   I set store_serialized_dags as an environment variable: `export AIRFLOW__CORE__STORE_SERIALIZED_DAGS=True`.
   
   The default value of `store_dag_code` is `%(store_serialized_dags)s`, so I expect it to now also be True. However, it's not (it's False).
   
   **What you expected to happen**:
   I expect store_dag_code to have the same value as store_serialized_dags.
   
   I think it's because the interpolation is applied to the value set in .cfg, but not when it's set via an env var. Will have to double check.
   
   <!-- What do you think went wrong? -->
   
   **How to reproduce it**:
   <!---
   
   As minimally and precisely as possible. Keep in mind we do not have access to your cluster or dags.
   
   If you are using kubernetes, please attempt to recreate the issue using minikube or kind.
   
   ## Install minikube/kind
   
   - Minikube https://minikube.sigs.k8s.io/docs/start/
   - Kind https://kind.sigs.k8s.io/docs/user/quick-start/
   
   If this is a UI bug, please provide a screenshot of the bug or a link to a youtube video of the bug in action
   
   You can include images using the .md sytle of
   ![alt text](http://url/to/img.png)
   
   To record a screencast, mac users can use QuickTime and then create an unlisted youtube video with the resulting .mov file.
   
   --->
   
   
   **Anything else we need to know**:
   
   <!--
   
   How often does this problem occur? Once? Every time etc?
   
   Any relevant logs to include? Put them here in side a detail tag:
   <details><summary>x.log</summary> lots of stuff </details>
   
   -->
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] BasPH commented on issue #8255: Config value interpolation not working when set as environment variable

Posted by GitBox <gi...@apache.org>.
BasPH commented on issue #8255: Config value interpolation not working when set as environment variable
URL: https://github.com/apache/airflow/issues/8255#issuecomment-612505957
 
 
   Dug a bit more into this issue. It seems Airflow builds its configuration in a rather odd way. First there is an `AirflowConfigParser`, which is the class you get when importing `from airflow.configuration import conf`. In addition to overriding e.g. `ConfigParser.get()`, to support fetching configuration from environment variables and others, the AirflowConfigParser also holds an attribute `airflow_defaults` with is a "standard" ConfigParser by itself, used for looking up default values if none of the custom ways for setting config are used.
   
   This makes it difficult to fix this issue. Interpolation of config values is done in an `Interpolation` class, which can be overridden to also support fetching values from the custom config. However, since there a (standard) ConfigParser inside the AirflowConfigParser for the default values, we'd have to hack around to also support the custom config fetching ways in there.
   
   All in all, it might be technically possible to fix, but I'd rather opt for rewriting the whole configuration module.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] BasPH edited a comment on issue #8255: Config value interpolation not working when set as environment variable

Posted by GitBox <gi...@apache.org>.
BasPH edited a comment on issue #8255: Config value interpolation not working when set as environment variable
URL: https://github.com/apache/airflow/issues/8255#issuecomment-612505957
 
 
   Dug a bit more into this issue. It seems Airflow builds its configuration in a rather odd way. First there is an `AirflowConfigParser`, which is the class you get when importing `from airflow.configuration import conf`. In addition to overriding e.g. `ConfigParser.get()`, to support fetching configuration from environment variables and others, the AirflowConfigParser also holds an attribute `airflow_defaults` with is a "standard" ConfigParser by itself, used for looking up default values if none of the custom ways for setting config are used.
   
   This makes it difficult to fix this issue. Interpolation of config values is done in an `Interpolation` class, which can be overridden to also support fetching values from the custom config. However, since there a (standard) ConfigParser inside the AirflowConfigParser for the default values, we'd have to hack around to also support the custom config fetching ways in there.
   
   All in all, it might be technically possible to fix, but I'd rather opt for rewriting the whole configuration module, to avoid more hacking and take the opportunity to create something simple to understand.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services