-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python js-plugin support for Jetty #2772
Comments
@jnumainville @mattrunyon this would be a good one to tackle, specifically packaging JS assets with the python plugin. Would improve the DX, if we can just have both the backend/frontend in one folder and can spin it up/test it out right there. Then we can look at moving plugins all to a monorepo. |
deephaven-plugin-plotly-express has currently implemented support for packaging the js distribution inside a wheel. This gets us one step closer to completing this ticket. Right now, we can manually configure startup to include the js plugin: START_OPTS="-Ddeephaven.jsPlugins.express=/tmp/dpe/lib/python3.11/site-packages/js/plotly-express/" \
./server/jetty-app/build/install/server-jetty/bin/start Ideally, we could use python entry_points to get this information from the python plugin itself. There was an earlier attempt at creating this structure (https://github.com/deephaven/deephaven-plugin/blob/main/src/deephaven/plugin/js.py), but it was never re-incorporated into deephaven-core (#2908). As a strawman, deephaven-plugin-plotly-express would have additional logic in class MyJsContent(...):
@property
def js_path():
...
class ChartRegistration(Registration):
@classmethod
def register_into(cls, callback: Callback) -> None:
callback.register(DeephavenFigureType)
callback.register(MyJsContent) , or would have a new entry_point interface:
that the server could appropriately discover on startup (I believe the former is the better option). |
This is probably closed by #4925? |
Closed with #4925 |
The current web-plugin-packager setup only works for our netty/nginx setup; our deephaven-server PyPi package is jetty based, and needs a different solution.
It should be possible to support js-plugin via Jetty; it's likely a much better end-to-end experience than netty/nginx/web-plugin-packager once the proper pieces have been put into place. At the end of the day, the js assets are static, and JettyBackedGrpcServer should be able to serve them up.
Furthermore, the python packages themselves should be able to package up the js assets as data files in the wheel, and the jetty server should have some mechanism for auto-discovery.
It should be as easy as:
There are a few different ways to go about implementing this; ie, the hooks that JettyBackedGrpcServer needs. There could be an explicit JsPlugins registration interface; we could use some sort of ServiceLoader pattern; or extend how the python entry points work with the plugins. (Note: we should try and design it to not be python-specific.)
https://github.com/deephaven/deephaven-js-plugins
https://github.com/deephaven/deephaven-plugin-matplotlib
https://github.com/deephaven/deephaven-plugin-plotly
The text was updated successfully, but these errors were encountered: