Skip to content
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

Ensure deephaven-core PyPi package does not become out-of-sync with server version #63

Open
devinrsmith opened this issue Sep 18, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@devinrsmith
Copy link
Member

A user on slack reported an error starting up a deephaven docker server:

deephaven_docker-deephaven-1  | Type: <class 'ValueError'>
deephaven_docker-deephaven-1  | Value: Java class 'io.deephaven.server.plugin.python.LivePyObjectWrapper' not found
deephaven_docker-deephaven-1  | Line: 24
deephaven_docker-deephaven-1  | Namespace: <module>
deephaven_docker-deephaven-1  | File: /opt/deephaven/venv/lib/python3.10/site-packages/deephaven/_wrapper.py
deephaven_docker-deephaven-1  | Traceback (most recent call last):
deephaven_docker-deephaven-1  |   File "/opt/deephaven/venv/lib/python3.10/site-packages/deephaven/__init__.py", line 20, in <module>
deephaven_docker-deephaven-1  |   File "/opt/deephaven/venv/lib/python3.10/site-packages/deephaven/table.py", line 23, in <module>
deephaven_docker-deephaven-1  |   File "/opt/deephaven/venv/lib/python3.10/site-packages/deephaven/_wrapper.py", line 24, in <module>
deephaven_docker-deephaven-1  | 
deephaven_docker-deephaven-1  |         at org.jpy.PyLib.importModule(Native Method)
deephaven_docker-deephaven-1  |         at org.jpy.PyModule.importModule(PyModule.java:94)
deephaven_docker-deephaven-1  |         at io.deephaven.integrations.python.PythonDeephavenSession.<init>(PythonDeephavenSession.java:92)
deephaven_docker-deephaven-1  |         at io.deephaven.server.console.python.PythonConsoleSessionModule.bindPythonSession(PythonConsoleSessionModule.java:37)    
deephaven_docker-deephaven-1  |         at io.deephaven.server.console.python.PythonConsoleSessionModule_BindPythonSessionFactory.bindPythonSession(PythonConsoleSessionModule_BindPythonSessionFactory.java:64)
deephaven_docker-deephaven-1  |         at io.deephaven.server.console.python.PythonConsoleSessionModule_BindPythonSessionFactory.get(PythonConsoleSessionModule_BindPythonSessionFactory.java:51)
deephaven_docker-deephaven-1  |         at io.deephaven.server.console.python.PythonConsoleSessionModule_BindPythonSessionFactory.get(PythonConsoleSessionModule_BindPythonSessionFactory.java:16)
deephaven_docker-deephaven-1  |         at io.deephaven.server.console.python.PythonConsoleSessionModule_BindScriptSessionFactory.get(PythonConsoleSessionModule_BindScriptSessionFactory.java:37)
deephaven_docker-deephaven-1  |         at io.deephaven.server.console.python.PythonConsoleSessionModule_BindScriptSessionFactory.get(PythonConsoleSessionModule_BindScriptSessionFactory.java:13)
deephaven_docker-deephaven-1  |         at io.deephaven.server.runner.DeephavenApiServerModule.provideScriptSession(DeephavenApiServerModule.java:96)
deephaven_docker-deephaven-1  |         at io.deephaven.server.runner.DeephavenApiServerModule_ProvideScriptSessionFactory.provideScriptSession(DeephavenApiServerModule_ProvideScriptSessionFactory.java:48)
deephaven_docker-deephaven-1  |         at io.deephaven.server.runner.DeephavenApiServerModule_ProvideScriptSessionFactory.get(DeephavenApiServerModule_ProvideScriptSessionFactory.java:37)
deephaven_docker-deephaven-1  |         at io.deephaven.server.runner.DeephavenApiServerModule_ProvideScriptSessionFactory.get(DeephavenApiServerModule_ProvideScriptSessionFactory.java:13)
deephaven_docker-deephaven-1  |         at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
deephaven_docker-deephaven-1  |         at io.deephaven.server.runner.DeephavenApiServer.run(DeephavenApiServer.java:130)
deephaven_docker-deephaven-1  |         at io.deephaven.server.jetty.JettyMain.main(JettyMain.java:24)

I suspect this is due to a python plugin being installed that forced a newer version of deephaven-core to be installed; namely, deephaven-plugin-matplotlib is declaring a dependency on deephaven-core>=0.27.0 (due to recent plugin interface changes), but the underlying image was < 0.27.0.

We should see if there is a way to lock the version of deephaven-core in the python virtual environment; alternatively, maybe we set that part of the filesystem as read-only?

@devinrsmith devinrsmith added the enhancement New feature or request label Sep 18, 2023
@devinrsmith devinrsmith self-assigned this Sep 18, 2023
@devinrsmith
Copy link
Member Author

Trying to solve it at the filesystem level by removing the write bit from

chmod -w /opt/deephaven/venv/lib/python3.10/site-packages/deephaven/__init__.py

doesn't work b/c the docker image is currently running as root; this would likely work if we had a different user running inside the image.

Another alternative would be chattr +i, which can still be worked around by root, but is an explicit operation:

$ docker run --cap-add CAP_LINUX_IMMUTABLE -it --rm --name deephaven -p 10000:10000 --entrypoint bash ghcr.io/deephaven/server:0.28.0                                                                                  
root@71cff31ed482:/# chattr +i /opt/deephaven/venv/lib/python3.10/site-packages/deephaven/__init__.py                                                                                                                          
                                                                                                                                  
root@71cff31ed482:/# pip install deephaven-core==0.28.1                                                                                                                                                                        
...                                                                                                                                                
Installing collected packages: deephaven-core                                                                                                                                                                                  
  Attempting uninstall: deephaven-core                                                                                                                                                                                         
    Found existing installation: deephaven-core 0.28.0                                                                                                                                                                         
    Uninstalling deephaven-core-0.28.0:                                                                                                                                                                                        
ERROR: Could not install packages due to an OSError: [Errno 1] Operation not permitted: '/opt/deephaven/venv/lib/python3.10/site-packages/deephaven/__init__.py'

Unfortunately, I've been unable to figure out how / if it's possible to give these privileges at docker build time; currently running into:

 > [2/3] RUN chattr +i "/opt/deephaven/venv/lib/python3.10/site-packages/deephaven/__init__.py":
0.072 chattr: Operation not permitted while setting flags on /opt/deephaven/venv/lib/python3.10/site-packages/deephaven/__init__.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant