From 11b909570778c7dbf231e0486e6d204878fa4570 Mon Sep 17 00:00:00 2001 From: Neel Dalsania Date: Thu, 9 Jun 2022 19:35:23 +0530 Subject: [PATCH] added local environment variable (#589) * added local environment variable * fix tests --- airflow/docker_test.go | 3 +++ airflow/include/composeyml.go | 3 +++ airflow/include/podconfigyml.go | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/airflow/docker_test.go b/airflow/docker_test.go index e738f6748..ad971ce9f 100644 --- a/airflow/docker_test.go +++ b/airflow/docker_test.go @@ -109,6 +109,7 @@ services: AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql://postgres:postgres@postgres:5432 AIRFLOW__CORE__LOAD_EXAMPLES: "False" AIRFLOW__CORE__FERNET_KEY: "d6Vefz3G9U_ynXB3cr7y_Ak35tAHkEGAVxuz_B-jzWw=" + ASTRONOMER_ENVIRONMENT: local volumes: - airflow_home/dags:/usr/local/airflow/dags:ro - airflow_home/plugins:/usr/local/airflow/plugins:z @@ -143,6 +144,7 @@ services: AIRFLOW__CORE__LOAD_EXAMPLES: "False" AIRFLOW__CORE__FERNET_KEY: "d6Vefz3G9U_ynXB3cr7y_Ak35tAHkEGAVxuz_B-jzWw=" AIRFLOW__WEBSERVER__RBAC: "True" + ASTRONOMER_ENVIRONMENT: local ports: - 8080:8080 volumes: @@ -179,6 +181,7 @@ services: AIRFLOW__CORE__LOAD_EXAMPLES: "False" AIRFLOW__CORE__FERNET_KEY: "d6Vefz3G9U_ynXB3cr7y_Ak35tAHkEGAVxuz_B-jzWw=" AIRFLOW__WEBSERVER__RBAC: "True" + ASTRONOMER_ENVIRONMENT: local volumes: - airflow_home/dags:/usr/local/airflow/dags:z - airflow_home/plugins:/usr/local/airflow/plugins:z diff --git a/airflow/include/composeyml.go b/airflow/include/composeyml.go index dfa59d2a4..b30acb297 100644 --- a/airflow/include/composeyml.go +++ b/airflow/include/composeyml.go @@ -56,6 +56,7 @@ services: AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql://{{ .PostgresUser }}:{{ .PostgresPassword }}@{{ .PostgresHost }}:5432 AIRFLOW__CORE__LOAD_EXAMPLES: "False" AIRFLOW__CORE__FERNET_KEY: "d6Vefz3G9U_ynXB3cr7y_Ak35tAHkEGAVxuz_B-jzWw=" + ASTRONOMER_ENVIRONMENT: local volumes: - {{ .AirflowHome }}/dags:/usr/local/airflow/dags:ro - {{ .AirflowHome }}/plugins:/usr/local/airflow/plugins:{{ .MountLabel }} @@ -90,6 +91,7 @@ services: AIRFLOW__CORE__LOAD_EXAMPLES: "False" AIRFLOW__CORE__FERNET_KEY: "d6Vefz3G9U_ynXB3cr7y_Ak35tAHkEGAVxuz_B-jzWw=" AIRFLOW__WEBSERVER__RBAC: "True" + ASTRONOMER_ENVIRONMENT: local ports: - {{ .AirflowWebserverPort }}:8080 volumes: @@ -126,6 +128,7 @@ services: AIRFLOW__CORE__LOAD_EXAMPLES: "False" AIRFLOW__CORE__FERNET_KEY: "d6Vefz3G9U_ynXB3cr7y_Ak35tAHkEGAVxuz_B-jzWw=" AIRFLOW__WEBSERVER__RBAC: "True" + ASTRONOMER_ENVIRONMENT: local volumes: - {{ .AirflowHome }}/dags:/usr/local/airflow/dags:{{ .MountLabel }} - {{ .AirflowHome }}/plugins:/usr/local/airflow/plugins:{{ .MountLabel }} diff --git a/airflow/include/podconfigyml.go b/airflow/include/podconfigyml.go index 7a8ffdde9..117bfcc6e 100644 --- a/airflow/include/podconfigyml.go +++ b/airflow/include/podconfigyml.go @@ -61,6 +61,8 @@ spec: value: "False" - name: ASTRONOMER_USER value: astro + - name: ASTRONOMER_ENVIRONMENT + value: local {{ .AirflowEnvFile }} image: {{ .AirflowImage }} name: {{ .SchedulerContainerName }} @@ -130,6 +132,8 @@ spec: value: ASTRONOMER - name: AIRFLOW__CORE__LOAD_EXAMPLES value: "False" + - name: ASTRONOMER_ENVIRONMENT + value: local {{ .AirflowEnvFile }} image: {{ .AirflowImage }} name: {{ .WebserverContainerName }} @@ -176,6 +180,8 @@ spec: value: ASTRONOMER - name: AIRFLOW__CORE__LOAD_EXAMPLES value: "False" + - name: ASTRONOMER_ENVIRONMENT + value: local {{ .AirflowEnvFile }} image: {{ .AirflowImage }} name: {{ .TriggererContainerName }}