Skip to content

Conversation

@jason810496
Copy link
Member

@jason810496 jason810496 commented Dec 24, 2025

related: #57219

Why

After Auto-compile UI assets on Breeze start-airflow command #57219, we could breeze start-airflow --use-airflow version <pr-number> / <owner/repo:branch> and access the Frontend successfully. We make it happen by:

  1. download node.js
  2. download npm
  3. download pnpm
  4. download repo as tarball from GitHub and extract it
  5. run pnpm build
  6. copy artifact to /usr/python/lib/python3.10/site-packages/airflow/ui/dist

However, if we just want to test the Airflow Core change from someone's PR (e.g. validate API Server TaskInstance Log reading path, check Scheduler behavior but still want to access Frontend for observability, etc), we still need to do the all the steps above just to access Frontend, which is waste of time for test iteration.

Instead, we could just mount the pre-built UI dist from host to Breeze container to save the time, in most of the time, the core change will not impact API Server <-> Frontend behavior. (e.g. When I testing Fix rendering of template fields with start from trigger#55068 recently, there isn't anything related with Frontend, but I still need to access it to check the TaskInstance status. )

What

Add --mount-ui-dist flag for start-airflow command to mount UI dist directly from host to Breeze container without building the whole frontend again to save time.

Verfication

The Screenshot of frontend with --mount-ui-dist, the middle of it should be navy blue color instead of pure black if we are using 3.1.5 The Screenshot of frontend without --mount-ui-dist
--mount-ui-dist without --mount-ui-dist

Output of breeze start-airflow --backend postgres --mount-sources providers-and-tests --use-airflow-version apache/airflow:main --mount-ui-dist

Skipping downloading Airflow source tarball - using mounted UI dist from host.
Copying pre-built UI dist from mounted location
Copied UI dist from '/opt/airflow/.build/ui-dist/main' to '/usr/python/lib/python3.10/site-packages/airflow/ui/dist'
Copied UI dist from '/opt/airflow/.build/ui-dist/simple-auth' to '/usr/python/lib/python3.10/site-packages/airflow/api_fastapi/auth/managers/simple/ui/dist'

Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@potiuk
Copy link
Member

potiuk commented Dec 24, 2025

Very cool idea!

But it can be done way simpler I think. You can likely directly mount the dist folder directly to the sources of airflow - it should be completely no problem to mount it to already mounted folder, docker should nicely handle it.

console.print("[bright_blue]UI assets compiled successfully")


def copy_mounted_ui_dist(mounted_ui_dist_source: Path, dist_prefix: str, host_source_prefix: str):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I thinl rather than doing this copy, we could simply mount the folder directly where it is expected to be? I don't think we need to use the temporary folder to copy it from there inside?

Or am I wrong :) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this could be enhanced with edge3 and fab provider assets done the same way after #56456 is merged and fab assets are also dynamically generated.

Copy link
Member

@gopidesupavan gopidesupavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice addition :)

Copy link
Member Author

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I thinl rather than doing this copy, we could simply mount the folder directly where it is expected to be? I don't think we need to use the temporary folder to copy it from there inside?

Yes, very agree with that! It's way more better to mount it directly to library path.

@jason810496 jason810496 marked this pull request as draft December 24, 2025 11:46
@jason810496 jason810496 force-pushed the ci/breeze/mount-ui-dist branch from e296418 to 814b3bf Compare December 24, 2025 13:16
@jason810496 jason810496 marked this pull request as ready for review December 24, 2025 13:16
Copy link
Member Author

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks all for the review! I just refactored as directly mount to correct path instead of copying from tmp path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants