-
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
Add js-plugins pre-built support #3056
Conversation
Here was my local workflow to get up and running:
(Executed in web ui) import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", size='petal_length', hover_data=['petal_width']) |
I've published an example image (not sure how long it will be around), but from a docker users perspective, it may look like: # syntax=docker/dockerfile:1.4
FROM ghcr.io/deephaven/web-plugin-packager:latest as build
RUN ./pack-plugins.sh @deephaven/js-plugin-plotly
FROM ghcr.io/deephaven/server:js-plugins-static
COPY --link --from=build js-plugins/ /js-plugins
RUN pip install deephaven-plugin-plotly
ENV START_OPTS="-Ddeephaven.jsPlugins.resourceBase=/js-plugins"
|
Tested further by adding the matplotlib from a locally built js plugin as well. So:
Then cloned the deephaven-js-plugins repo: https://github.com/deephaven/deephaven-js-plugins
Add a link to the directory:
Update the manifest:
Starting up the server as mentioned by Devin above.
However was getting a 404 when trying to load js-plugin matplotlib. Seems to work fine if I copy instead of making a symlink. Is there a reason why a symlink doesn't work here, guessing how Jetty loads resources? Would be handy for dev... though could have a build script to copy it as well. Also - anyway to make it so manifest.json gets updated automatically? |
I haven't looked into symlinks, may be related to jetty/jetty.project#8259? I can dig in... |
As far as "manifest.json gets updated automatically" - with respect to this PR, no. As part of the alternative PR (#2908), yes, that PR makes the server responsible for manifest.json. |
I'm not able to get symlinks working either - the code suggests that it should work, but there is probably some missing context. I've tried context.clearAliasChecks();
Maybe Colin knows? |
I don't think the symlink thing should block this PR, since the workaround is just copy, or even the following:
That works well... however there still is a caching issue - it's just loading the js plugins from the disk cache. I think we need to add different caching headers there. |
Ah yes, I think we should add the nocache filter for these paths - will do that. |
Hmmm... I pushed a new commit, but it's not taking to this PR yet. Odd. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err re-verting approval until PR updates wtih the latest but the code works
914b0e4
to
79ca38b
Compare
79ca38b
to
6f42b59
Compare
server/jetty/src/main/java/io/deephaven/server/jetty/JsPlugins.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, review over slack
server/jetty/src/main/java/io/deephaven/server/jetty/JettyBackedGrpcServer.java
Show resolved
Hide resolved
Labels indicate documentation is required. Issues for documentation have been opened: How-to: https://github.com/deephaven/deephaven.io/issues/1859 |
Fast and simple js plugin support via the configuration property
deephaven.jsPlugins.resourceBase
- assumes the user has already built a js plugins compatible directory to the necessary specifications (the server transparently passes through the data with no knowledge of the structure).Niceties can be added as documentation and additional follow-up. For example, the user can extend from the Deephaven official images and use the web-plugin-packager or similar construction in a multi-stage Dockerfile build to add the necessary structure to their own image.