Page MenuHomePhabricator

Run test-k8s instance on Airflow 3.3
Closed, ResolvedPublic

Description

TBC, dependent on T433388

  • what to do with shared code, how to keep code in sync
  • decisions on SLA->Deadline, Database access

ToDo

Acceptance criteria

  • test_k8s running on main_airflow_3.3 branch with 3.3 codebase

Event Timeline

There is a task for setting up the Airflow instance for Experiment Platform T416709

spark_submit_pi_yarn_cluster_mode_via_skein fails with T434786

atsuko changed the task status from Open to In Progress.Wed, Sep 23, 2:23 PM
atsuko claimed this task.

Change #1345077 had a related patch set uploaded (by Atsuko; author: Atsuko):

[operations/deployment-charts@master] airflow-test-k8s: upgrade to airflow 3

https://gerrit.wikimedia.org/r/1345077

Upgrade plan

Pre-requisite

For database migration, I first create the devenv on 2.11, then upgrade it in-place with not-yet released airflow-devenv upgrade:

$ airflow-devenv create --dags-folder test_k8s
$ python3 -m airflow_devenv upgrade --dags-folder test_k8s --branch T434896_maintenance_dags --extra-values values-airflow3.yaml

Upgrade

  • Disable all DAGs
  • Remove webserver and scheduler deployments
  • Roll out new values (will need fix)

Verification

  • OIDC
    • Validate user auto-creation
  • RESTExternalTaskSensor

Cleanup

  • Re-enable all DAGs after testing fix for T439576
  • Remove Kerberos-related users

Change #1345077 merged by jenkins-bot:

[operations/deployment-charts@master] airflow-test-k8s: upgrade to airflow 3

https://gerrit.wikimedia.org/r/1345077

Based on my understanding, Airflow+flask machinery thinks that the service is HTTP-only, and url_for returns wrong URL

return self.appbuilder.sm.oauth_remotes[provider].authorize_redirect(
    redirect_uri=url_for(  # redirect_uri: http://airflow-test-k8s.wikimedia.org/auth/oauth-authorized/CAS 
        ".oauth_authorized", provider=provider, _external=True
    ),
    state=state.decode("ascii") if isinstance(state, bytes) else state,
)

Fixes are tracked in 1345956

Fix SMTP config: airflow3: smtp_default connection

[2026-09-30T00:51:50.793808Z] INFO - ::group::Post Execute
[2026-09-30T00:51:50.942790Z] ERROR - Failed to send notification (sync): SMTP connection is not found.
[2026-09-30T00:51:50.942935Z] ERROR - Failed to send email notification via SmtpNotifierAirflowException: SMTP connection is not found.
    File /home/app/.local/lib/python3.11/site-packages/airflow/sdk/execution_time/task_runner.py, line 2154 in _send_error_email_notification
    File /home/app/.local/lib/python3.11/site-packages/airflow/sdk/bases/notifier.py, line 138 in __call__
    File /home/app/.local/lib/python3.11/site-packages/airflow/providers/smtp/notifications/smtp.py, line 155 in notify
    File /home/app/.local/lib/python3.11/site-packages/airflow/providers/smtp/hooks/smtp.py, line 79 in __enter__
    File /home/app/.local/lib/python3.11/site-packages/airflow/providers/smtp/hooks/smtp.py, line 119 in get_conn
,AirflowNotFoundException: The conn_id `smtp_default` isn't defined
    File /home/app/.local/lib/python3.11/site-packages/airflow/providers/smtp/hooks/smtp.py, line 117 in get_conn
    File /home/app/.local/lib/python3.11/site-packages/airflow/sdk/bases/hook.py, line 61 in get_connection
    File /home/app/.local/lib/python3.11/site-packages/airflow/sdk/definitions/connection.py, line 296 in get
    File /home/app/.local/lib/python3.11/site-packages/airflow/sdk/execution_time/context.py, line 231 in _get_connection

Change #1346713 had a related patch set uploaded (by Atsuko; author: Atsuko):

[operations/deployment-charts@master] airflow3: smtp_default connection

https://gerrit.wikimedia.org/r/1346713

Change #1346713 merged by jenkins-bot:

[operations/deployment-charts@master] airflow3: smtp_default connection

https://gerrit.wikimedia.org/r/1346713