charts: PYTHONPATH environment variable not being set via airflow.extraEnv

What is the bug?

The PYTHONPATH environment variable is not being set in the Airflow environment when specified via the airflow.extraEnv value. Specifically, the airflow property values to merge with values.yaml are documented below.

Note that the TESTINGVAR variable is set properly. I confirmed by kubectl execing into airflow-web and printing the sourced values for both PYTHONPATH and TESTINGVAR - TESTINGVAR was correct whereas PYTHONPATH remained the default value (i.e. /opt/python/site-packages).

For context, we’re trying to extend our PYTHONPATH with the repo directory in order to import custom modules into our DAGs. (If you have any suggestions of better ways to do this as well, I’m all ears.) Any idea what might be happening here?

What are your Helm values?

airflow:
  config:
    AIRFLOW__WEBSERVER__ENABLE_PROXY_FIX: "True"
  extraEnv:
    - 
      name: PYTHONPATH
      value: "/opt/python/site-packages:/opt/airflow/dags/repo"
    -
      name: TESTINGVAR
      value: "hello123"
  extraPipPackages:
    - "apache-airflow[google]==2.0.1"
    - "SQLAlchemy==1.3.23"

What is your Kubernetes Version?:

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.4", GitCommit:"d360454c9bcd1634cf4cc52d1867af5491dc9c5f", GitTreeState:"clean", BuildDate:"2020-11-12T01:09:16Z", GoVersion:"go1.15.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.15-gke.7800", GitCommit:"cef3156c566a1d1a4b23ee360a760f45bfbaaac1", GitTreeState:"clean", BuildDate:"2020-12-14T09:12:37Z", GoVersion:"go1.13.15b4", Compiler:"gc", Platform:"linux/amd64"}

What is your Helm version?:

version.BuildInfo{Version:"v3.4.0", GitCommit:"7090a89efc8a18f3d8178bf47d2462450349a004", GitTreeState:"dirty", GoVersion:"go1.15.3"}

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

I will make a release which allows python package in your git-repo, after I try a few options (in the next day or two).