The JIRA issue is optional, but if there is already one that is relevant link to it here. Using the Jira issue macro is preferred.
|
While the Airflow UI did receive a recent facelift for the 2.0 release, the changes merely made it look like a modern web application, but not function as one. The current application has served Airflow well and continued to evolve in functionality with the maturation of the product. We’ve reached a point where the expectations of a modern SaaS product have grown immensely since Airflow’s inception and emerging competitors are better positioned to fulfill those expectations by being built upon newer foundations.
We will reimagine the Airflow UI foundation with modern principles and technologies to continue to grow the appeal and adoption of Airflow with the following resulting outcomes:
We’ve produced a POC that demonstrates how the resulting product may look and feel, using the technologies we seek to adopt. It fully utilizes the API of a remote Airflow instance.
A demo of the POC can be accessed at: nova.astronomer.io (login: demo/demo)
Note: This demo is a very simplified example of the final application’s scope and does not reflect any design decisions (see IA & Design section below).
The source code for this POC is viewable at: https://github.com/astronomer/airflow-ui

React - a JavaScript library for building user interfaces (more about this choice below)
TypeScript - extends JavaScript by adding types. React components will all utilize typing of internal functions as well as typing of their external props. Global model related typings will reside in a shared interfaces file.
Neutrino - lets you build web and Node.js applications with shared presets or configurations. This carries a very lightweight footprint in the codebase with all the configuration in a single file. This project is not being used now (and caution, neutrino has been archived and the docs domain has been taken over so careful clicking through from GitHub!)
Chakra UI - a simple, modular and accessible component library that gives you all the building blocks you need to build React applications. This will allow us to have a strong base of reusable components and theming so people can focus on features instead of styles. One notable aspect of this system is that it utilizes styled-system, a CSS-in-JS methodology of writing styles as props instead of traditional stylesheets (see examples in POC source code). A small learning curve to this, but the properties/naming are identical so it’s easy to pick up.
React Testing Library (RTL) & Jest- Jest is the standard built-in tool for testing JavaScript. RTL is a lightweight framework specifically for React components. It emphasizes best practices of testing how our software is used vs implementation details that don’t affect a user. In this example from the POC, we can test a flow for a DAGs view: show a loading indicator when fetching data -> DAGs render -> clicking on a switch changes makes a DAG active/paused with a modal confirming the update. All of this is driven by what a user sees and does and not the underlying code itself.
React Query - powerful async data handler that will manage all of our API requests. Advanced async logic like caching, background updates, optimistic updates, and refetching come out-of-the-box and are easy to configure. Far more lightweight than other boilerplate-heavy state management solutions. They are simple functions that can be dropped into any component that needs API data
ESLint - adopt standard linting rules (Airbnb) to maintain code style. This is already incorporated into the existing UI, it has just yet to be enforced by pre-commit. It currently has its own configuration file, but we will be able to leverage the existing one once we merge the codebases.
React is the most widely used UI framework being used today. That gives us a few key advantages over Flask AppBuilder and other modern options.
The codebase for the POC illustrates the simple file structure by which the code will be organized. Eventually all living within a new airflow/www/ui/ directory in the apache/airflow repository.
test/ - contains tests for all of our componentssrc/views/ - these are the different pages of the app that show up in their own urls. Often have a main index.js file as an entry point and various components specific to that viewsrc/containers/ - include the navigation sections that appear in every page of the appsrc/components/ - components that may be shared across the whole appsrc/api/ - contains all the functions to import into a component when needing to do an API requestsrc/interfaces/ - Global TypeScript types to be used throughout the appsrc/utils/ - Separate out some common logic that can be imported into any necessary componentsrc/index.tsx - Starting point of the app, mainly contains the various providers that give all child components access our style, auth, data, and routing statessrc/App.tsx - Defines all the url routes in the app and which component should render for each routeThere will be many different API requirements that will be uncovered during development. We’ve already begun running into these limitations during the POC development. Ultimately this will yield a much more robust (and documented) API for Airflow.
Currently, Plugins allow for developers to incorporate a custom Webserver view into the application via inclusion of a Flask template. They have been a valuable part of Airflow but haven’t gotten the attention they deserve. In a new UI, there is an opportunity to create a better developer experience and enable increased extensibility of one’s Airflow instance.
Future of Extensibility (Future AIP) - We would like to bring all the benefits of an upgraded frontend tech stack to plugins too and pull in common patterns, components and styles to create a seamless integration. If we were to model a solution similar to New Relic’s “New Relic One Applications”, we could enable generating boilerplate Plugins from the CLI that provide “the stack” including the same UI tooling utilized by the rest of the application.
When building (or re-building) any application from the ground up, it is a unique opportunity to make a holistic assessment of the Information Architecture (IA) and the overall User Experience (UX). Given the continual evolution of Airflow since its inception, it has not had this opportunity prior to now.
The current POC is a tech demo and exploration; no design decisions have been made. In order to capture a broad and diverse range of community use cases we will form a UI SIG to engage in the process. We will make an invitation to the Dev list to garner participation.
This process will involve a range of exercises that will include (but not be limited to):
We envision this process to take roughly 4-5 weeks to complete. This will consist of a progression of weekly meetings where findings will be reported and discussed within the SIG. Feedback will be collected and iterations will be reviewed in each subsequent meeting. The entire process and decision-making process will be documented.
The proposed Introduction Path (below) creates an ideal structure by which to collect feedback and make informed assessments of any changes resulting from the design process. This will also provide the confidence needed when ultimately deciding to promote the new UI as the default (and deprecate/remove the old one).
Introduce new UI side-by-side (opt-in, easily switch between at a per-user level) with the current at minor version release. Remove/replace the current UI completely at a subsequent major version release.
Pros
Cons

From Airflow 2.3 - 2.10, we took a different turn. Instead of developing an MVP and loading two separate UIs. We went forward with building a small React app that can be loaded inside of the existing FAB UI. We now load 3 different react apps, DAG details, Datasets and Cluster Activity. This has enabled us to improve the UX and support new features, but has had a few drawbacks from a page load and project complexity perspective.
For Airflow 3, we should take advantage of the opportunity to break things and fully migrate to a full React UI. These sub-AIPs will help us achieve this:
Outstanding pages
User Profile
Admin
Variables
Security (this is handled by the auth manager and not the React UI)
We will try to take advantage of these updates and continue to improve upon the UX at the same time as rewriting these pages. Fortunately, many of the remaining pages are just table views which should be relatively easy to build well once an reuse across each of those pages. The most complex project will be to redo the DAG list page. UI development progress can also be sped up with implementing a UI REST API as proposed in AIP-84, as more boilerplate can be auto-generated with more type-checking.