Skip to content

Conversation

@rootcss
Copy link
Contributor

@rootcss rootcss commented Sep 6, 2020

This PR adds a link to view details of Plugins loaded into the Airflow.

closes: #9185

Screenshot 2020-09-07 at 12 19 00 AM

Screenshot 2020-09-17 at 10 30 15 PM


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

@boring-cyborg boring-cyborg bot added the area:webserver Webserver related Issues label Sep 6, 2020
@rootcss rootcss marked this pull request as draft September 6, 2020 18:50
@mik-laj
Copy link
Member

mik-laj commented Sep 7, 2020

@mjpieters Can you look at it? Does it meet your expectations?

@mik-laj
Copy link
Member

mik-laj commented Sep 7, 2020

The original ticket mentions the following requirements. What do you think to add them?

- source (plugins folder or entry point)
- for plugins folder plugins
   - path relative to the plugins folder
- for entry point plugins
   - the project name and version from the `EntryPoint.dist` object (using `str(entry_point.dist)` should suffice)
   - the entrypoint name, module and attributes information (`str(entry_point)` provides this, already formatted).
   - **NOT** the file location, that'd be a security issue. The entrypoint information is enough to locate the plugin when someone has access to the machine and the Python installation that runs Airflow.
- Optionally: information on the specific extension points provided by the plug-in.

@rootcss
Copy link
Contributor Author

rootcss commented Sep 7, 2020

@mik-laj currently while loading the plugins from either of the sources, we're not keeping the information about the source, path etc. To get this information, we'd need to probably introduce two attributes (something like plugin_source and plugin_path) for class AirflowPlugin.
While loading the plugins in their specific methods, we can set these attributes to their relevant values.
eg,
In the case of entrypoint based plugins:

plugin_source: entrypoint_plugin
plugin_path: str(entry_point.dist)

In the case of airflow plugins directory based plugins:

plugin_source: airflow_plugins_directory
plugin_path: '/path/to/the/plugin/directory'

Let me know what do you think.

@mjpieters
Copy link
Contributor

The point of my request was to make it visible where the plugin was loaded from, and what version information we have (if any).

Our cluster setup is somewhat complicated with mixed virtualenv and conda layers, being able to see where distutils pulled the plugin from is quite important.

So while this looks cool, it's not what I had in mind.

@rootcss
Copy link
Contributor Author

rootcss commented Sep 11, 2020

hey @mjpieters: Got that. This is a WIP, we're still discussing some of the changes to do that.

@rootcss rootcss force-pushed the feature/ui_plugins_view branch from 1b0bb3d to 08441f5 Compare September 17, 2020 17:18
@rootcss rootcss marked this pull request as ready for review September 17, 2020 17:18
@rootcss
Copy link
Contributor Author

rootcss commented Sep 17, 2020

@mjpieters: I've added the plugin source and path attributes. Source tells whether the plugin was loaded from the plugins directory or from the entrypoint package. Plugin Path shows the absolute path of the package in case it's loaded from plugins directory, otherwise shows entry_point.dist incase of entrypoint package.

@rootcss
Copy link
Contributor Author

rootcss commented Sep 19, 2020

@kaxil @mik-laj This PR can be reviewed now.

@rootcss rootcss force-pushed the feature/ui_plugins_view branch from 08441f5 to 06d4b28 Compare September 26, 2020 05:21
@rootcss rootcss force-pushed the feature/ui_plugins_view branch from 06d4b28 to c12587e Compare October 4, 2020 18:44
@rootcss
Copy link
Contributor Author

rootcss commented Oct 4, 2020

@mjpieters Thank you for all the suggestions. Please have a look now. Now we've just one attribute called source for AirflowPlugin: source: Optional[AirflowPluginSource] = None. @kaxil I'd love your feedback on this PR as well.

@rootcss rootcss force-pushed the feature/ui_plugins_view branch from c12587e to 37a5601 Compare October 4, 2020 19:09
Copy link
Contributor

@mjpieters mjpieters left a comment

Choose a reason for hiding this comment

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

Thanks for implementing all my suggestions! 🎺

@kaxil
Copy link
Member

kaxil commented Oct 6, 2020

@rootcss Can you please rebase the PR on latest master again 🙏

@rootcss rootcss force-pushed the feature/ui_plugins_view branch from 37a5601 to 5ff83c0 Compare October 6, 2020 11:08
@rootcss
Copy link
Contributor Author

rootcss commented Oct 6, 2020

@kaxil I've rebased and pushed.

@github-actions
Copy link

github-actions bot commented Oct 6, 2020

The Build Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

@rootcss rootcss force-pushed the feature/ui_plugins_view branch 3 times, most recently from c971880 to de8971f Compare October 6, 2020 18:20
@kaxil
Copy link
Member

kaxil commented Oct 7, 2020

tests are failing

@rootcss rootcss force-pushed the feature/ui_plugins_view branch 3 times, most recently from 8372214 to 85c3519 Compare October 17, 2020 05:44
@rootcss rootcss force-pushed the feature/ui_plugins_view branch from 85c3519 to 1c4fcf6 Compare October 17, 2020 10:06
@github-actions
Copy link

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.

@rootcss rootcss force-pushed the feature/ui_plugins_view branch from 1c4fcf6 to aad57de Compare October 17, 2020 10:44
@rootcss
Copy link
Contributor Author

rootcss commented Oct 17, 2020

@kaxil 3 checks have failed, but I don't see any error messages. Is it a known thing by any chance?

@mik-laj
Copy link
Member

mik-laj commented Oct 17, 2020

@rootcss I restarted the build.

@rootcss
Copy link
Contributor Author

rootcss commented Oct 17, 2020

@mik-laj that fixed it. Thanks.

@kaxil kaxil requested a review from mik-laj October 18, 2020 16:17
@mik-laj mik-laj merged commit 91898e8 into apache:master Oct 19, 2020
@rootcss rootcss deleted the feature/ui_plugins_view branch October 19, 2020 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webserver Webserver related Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include plugin information in the version page

4 participants