apache / airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
https://airflow.apache.org/
Apache License 2.0
37.26k stars 14.33k forks source link

AIP84: UI endpoint for config #44265

Open vatsrahul1001 opened 15 hours ago

vatsrahul1001 commented 15 hours ago

closes: https://github.com/apache/airflow/issues/43166

Description

In the old UI, we passed a lot of variables via global variables in FAB templates. This PR replaces that with ui/config so that UI can use it.

Response json

{
    "navbar_color": "#fff",
    "navbar_text_color": "#51504f",
    "navbar_hover_color": "#eee",
    "navbar_text_hover_color": "#51504f",
    "navbar_logo_text_color": "#51504f",
    "page_size": 100,
    "auto_refresh_interval": 3,
    "default_ui_timezone": "UTC",
    "hide_paused_dags_by_default": false,
    "instance_name": "Airflow",
    "instance_name_has_markup": false,
    "enable_swagger_ui": true,
    "require_confirmation_dag_change": false,
    "default_wrap": false,
    "warn_deployment_exposure": true,
    "audit_view_excluded_events": "",
    "audit_view_included_events": "",
    "is_k8s": false,
    "test_connection": "Disabled",
    "state_color_mapping": {
        "deferred": "mediumpurple",
        "failed": "red",
        "queued": "gray",
        "removed": "lightgrey",
        "restarting": "violet",
        "running": "lime",
        "scheduled": "tan",
        "skipped": "hotpink",
        "success": "green",
        "up_for_reschedule": "turquoise",
        "up_for_retry": "gold",
        "upstream_failed": "orange"
    }
}

Testing

image

^ Add meaningful description above Read the Pull Request Guidelines for more information. In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed. In case of a new dependency, check compliance with the ASF 3rd Party License Policy. In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

vatsrahul1001 commented 1 hour ago

Looking good.

Just a few suggestions/questions.

Are we missing the standalone_dag_processor ?

As per below inline from Brent we have to do this in issue

Other config:
standalone_dag_processor [This should be checked in API, not the UI](https://github.com/apache/airflow/issues/44253)
pierrejeambrun commented 28 minutes ago

Are we missing the standalone_dag_processor ?

At first glance, it feels like we just need to add an extra field to additional_config with conf.getboolean("scheduler", "standalone_dag_processor") ?

Maybe i'm missing something though.