From 9fcfe718d7a535740fa9cfd908ec7eb2cfcbd328 Mon Sep 17 00:00:00 2001 From: Nikki <17799906+nikki-t@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:18:10 -0500 Subject: [PATCH 1/4] Remove Airflow authentication --- airflow/config/webserver_config.py | 2 ++ airflow/helm/values.tmpl.yaml | 3 +++ terraform-unity/modules/terraform-unity-sps-airflow/main.tf | 1 + 3 files changed, 6 insertions(+) create mode 100644 airflow/config/webserver_config.py diff --git a/airflow/config/webserver_config.py b/airflow/config/webserver_config.py new file mode 100644 index 00000000..05582c02 --- /dev/null +++ b/airflow/config/webserver_config.py @@ -0,0 +1,2 @@ +# Disable airflow authentication, https://airflow.apache.org/docs/apache-airflow-providers-fab/stable/auth-manager/webserver-authentication.html +AUTH_ROLE_PUBLIC = 'Admin' \ No newline at end of file diff --git a/airflow/helm/values.tmpl.yaml b/airflow/helm/values.tmpl.yaml index 449b57a2..c1b5bd49 100644 --- a/airflow/helm/values.tmpl.yaml +++ b/airflow/helm/values.tmpl.yaml @@ -130,6 +130,9 @@ webserverSecretKeySecretName: ${webserver_secret_name} webserver: replicas: 3 + webserverConfig: |- + ${webserver_config} + startupProbe: timeoutSeconds: 20 failureThreshold: 60 # Number of tries before giving up (10 minutes with periodSeconds of 10) diff --git a/terraform-unity/modules/terraform-unity-sps-airflow/main.tf b/terraform-unity/modules/terraform-unity-sps-airflow/main.tf index b9acf1b5..6fb1c678 100644 --- a/terraform-unity/modules/terraform-unity-sps-airflow/main.tf +++ b/terraform-unity/modules/terraform-unity-sps-airflow/main.tf @@ -412,6 +412,7 @@ resource "helm_release" "airflow" { unity_cluster_name = data.aws_eks_cluster.cluster.name karpenter_node_pools = join(",", var.karpenter_node_pools) cwl_dag_ecr_uri = "${data.aws_caller_identity.current.account_id}.dkr.ecr.us-west-2.amazonaws.com" + webserver_config = indent(4, file("${path.module}/../../../airflow/config/webserver_config.py")) }) ] set_sensitive { From 20da370db8e1f684b1874a2051a4ba16360efe73 Mon Sep 17 00:00:00 2001 From: Nikki <17799906+nikki-t@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:34:02 -0500 Subject: [PATCH 2/4] Add new line to end of file --- airflow/config/webserver_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/config/webserver_config.py b/airflow/config/webserver_config.py index 05582c02..09018f2f 100644 --- a/airflow/config/webserver_config.py +++ b/airflow/config/webserver_config.py @@ -1,2 +1,2 @@ # Disable airflow authentication, https://airflow.apache.org/docs/apache-airflow-providers-fab/stable/auth-manager/webserver-authentication.html -AUTH_ROLE_PUBLIC = 'Admin' \ No newline at end of file +AUTH_ROLE_PUBLIC = 'Admin' From 9add4cade13aad7c9e82f0aae7c5ac36973d6e80 Mon Sep 17 00:00:00 2001 From: Nikki <17799906+nikki-t@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:35:38 -0500 Subject: [PATCH 3/4] Reformat python code --- airflow/config/webserver_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/config/webserver_config.py b/airflow/config/webserver_config.py index 09018f2f..6627a2e0 100644 --- a/airflow/config/webserver_config.py +++ b/airflow/config/webserver_config.py @@ -1,2 +1,2 @@ # Disable airflow authentication, https://airflow.apache.org/docs/apache-airflow-providers-fab/stable/auth-manager/webserver-authentication.html -AUTH_ROLE_PUBLIC = 'Admin' +AUTH_ROLE_PUBLIC = "Admin" From 76546511183c284fe420f3ff41474a2dbef58761 Mon Sep 17 00:00:00 2001 From: Luca Cinquini Date: Tue, 10 Dec 2024 10:48:15 -0700 Subject: [PATCH 4/4] Adding comments to easily identify changes later on --- airflow/config/webserver_config.py | 1 + airflow/helm/values.tmpl.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/airflow/config/webserver_config.py b/airflow/config/webserver_config.py index 6627a2e0..b1d79f09 100644 --- a/airflow/config/webserver_config.py +++ b/airflow/config/webserver_config.py @@ -1,2 +1,3 @@ +# PR 244: DISABLE AIRRLOW AUTHENTICATION (https://github.com/unity-sds/unity-sps/pull/244) # Disable airflow authentication, https://airflow.apache.org/docs/apache-airflow-providers-fab/stable/auth-manager/webserver-authentication.html AUTH_ROLE_PUBLIC = "Admin" diff --git a/airflow/helm/values.tmpl.yaml b/airflow/helm/values.tmpl.yaml index b1df7610..0e268987 100644 --- a/airflow/helm/values.tmpl.yaml +++ b/airflow/helm/values.tmpl.yaml @@ -130,6 +130,7 @@ webserverSecretKeySecretName: ${webserver_secret_name} webserver: replicas: 3 + # PR 244: DISABLE AIRRLOW AUTHENTICATION (https://github.com/unity-sds/unity-sps/pull/244) webserverConfig: |- ${webserver_config}