-
Notifications
You must be signed in to change notification settings - Fork 16
feat: DH-19715: Python remote file source plugin #1243
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
Conversation
9c5f861 to
7e0af1d
Compare
9e8f603 to
bcfa90c
Compare
cpwright
left a comment
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.
I've looked at the Python and mostly skipped over the JS/TS. I've left micro-comments, but this is more of a macro design comment that you guys can think about. I might be misreading how this works as well.
One thing that I think we should consider is that the pipe to your Deephaven server instance is often narrow/has high latency. It may make sense to push more data to the worker rather than pulling it and being smarter on the VS Code side. In particular, from your demo I like how you have the ability to add several paths to the worker's import space.
I think that each of those top-level names would form a RemoteMetaPathFinder. if that is true, then we do have to request information from the client on each find_spec. Even when we are negative, the counterpoint ist hat negative requests in Python might be seemingly rare.
Instead of just sending the worker the top-level list of names, you could also send them the list of files that exist within each name; or maybe even contents. That would eliminate the need for "in-line" requests, because the worker could look things up in a cache.
It would however, also require significantly more front-end work; because we would need to watch the file system and send the server updated information whenever the watched file system paths change.
As I write this down, I think I am more convinced this is probably premature optimization for Python; and we can leave this as is.
plugins/python-remote-file-source/src/deephaven/python_remote_file_source/message_stream.py
Outdated
Show resolved
Hide resolved
plugins/python-remote-file-source/src/deephaven/python_remote_file_source/message_stream.py
Outdated
Show resolved
Hide resolved
plugins/python-remote-file-source/src/deephaven/python_remote_file_source/plugin_object.py
Outdated
Show resolved
Hide resolved
...mote-file-source/test-node-client/workspace/package_with_relative_imports/utils/constants.py
Show resolved
Hide resolved
894c0e0 to
2f16dd4
Compare
plugins/python-remote-file-source/src/deephaven/python_remote_file_source/message_stream.py
Show resolved
Hide resolved
13eeb70 to
4990ca8
Compare
…ck in attempt to fix e2e tests (#DH-19715)
4bbf4a4 to
9014638
Compare
mofojed
left a comment
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.
A few cases on the server where we should just report the error and kill the connection.
A couple of questions why we're not using existing JSON RPC libraries instead of rolling our own functions/types.
Looks good overall though
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.
Not that there's anything wrong with this, but in deephaven.ui we used the json-rpc library for handling requests: https://pypi.org/project/json-rpc/
Handles passing methods off to a dispatcher and adding the appropriate ID to responses, etc. Just thinking there might be some edge cases that aren't handled correctly, such as notifications, but shouldn't matter for this case I don't think...
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.
I didn't realize we were already using a json-rpc library. I just opted not to bring in a dependency since the number of message types involved is very small and it's a pretty simple schema.
plugins/python-remote-file-source/src/deephaven/python_remote_file_source/message_stream.py
Show resolved
Hide resolved
plugins/python-remote-file-source/src/deephaven/python_remote_file_source/message_stream.py
Show resolved
Hide resolved
plugins/python-remote-file-source/src/deephaven/python_remote_file_source/types.py
Outdated
Show resolved
Hide resolved
plugins/python-remote-file-source/src/deephaven/python_remote_file_source/types.py
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.
Why not use the json-rpc-2.0 library like we use in deephaven.ui?
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.
I had just avoided the extra dependency since number of message types is small. Also didn't realize we were using a library already to set some precedence.
DH-19715: Python remote file source plugin
sys.meta_pathfinder and loader that will request source code from a remote clientTesting
There is a test Python workspace in
plugins/python-remote-file-source/test-node-client/workspace. There are 2 test files that get run by thevitesttest harness:test_relative_imports.pytest_absolute_imports.pyRunning the Tests
In the plugins repo root:
python-remote-file-sourcepluginpython tools/plugin_builder.py \ python-remote-file-source \ --server \ --server-arg \ --jvm-args="-Dauthentication.psk=plugins.repo.test -Dprocess.info.system-info.enabled=false"VS Code Extension
There is a .vsix attached to the DH-19715 that can be installed in VS Code if you want to see how the plugin integrates with VS Code.