mariobuikhuizen / voila-embed-vuetify

A Vue component to embed ipyvuetify widgets served by Voila
MIT License
1 stars 1 forks source link

Error with voila 0.3.4 and preheated kernels #8

Closed havok2063 closed 2 years ago

havok2063 commented 2 years ago

Testing this out with voila 0.3.4 and the new preheated kernels code. I'm getting the following error in the console.

Starting WebSocket: ws://localhost:8000/api/kernels/d8478ca6-059a-4ca2-8744-8b0179a11d3f
JupyterWidgetEmbed.js?6402:119 Uncaught (in promise) TypeError: widgetManager._build_models is not a function
    at eval (JupyterWidgetEmbed.js?6402:119:1)

with the following voila command. I see this both in the standalone example https://github.com/havok2063/standalone_jdaviz/, as well as our MAST-specific setup.

voila --no-browser --template=embed --enable_nbextensions=True --Voila.tornado_settings="{'allow_origin': 'http://localhost:8081', 'allow_credentials': True}" --preheat_kernel=True --pool_size=3 --port=8000

This is without any changes to the notebook. When I add the wait_for_request method to the notebook, just after the cell with the imports, I get a different error in the voila server, same as the one mentioned here, https://github.com/voila-dashboards/voila/issues/1123.

mariobuikhuizen commented 2 years ago

The --port=8000 argument is not shared with the pre heated kernel, it can be set by using env vars or voila.json: https://voila.readthedocs.io/en/stable/customize.html#partially-pre-render-notebook

Or try it on the default port

havok2063 commented 2 years ago

I get the same error when I use the VOILA_APP_PORT envvar in my config. I've checked in a config file in the standalone repo. I also tried switching everything to the default port and I also get the same error.

havok2063 commented 2 years ago

Also when I set the VOILA_APP_PORT to "8000", voila still seems to start on the default port 8866. But voila --Voila.show_config=True does not throw any errors and looks correct to me, compared to what is in the docs.

mariobuikhuizen commented 2 years ago

Turns out I was still using an older version of Voila in my testing. I fixed this issue in #9, which is released as v0.0.5.

Also when I set the VOILA_APP_PORT to "8000", voila still seems to start on the default port 8866. But voila --Voila.show_config=True does not throw any errors and looks correct to me, compared to what is in the docs.

The env variable only appears to set the port to use inside the kernel to contact Voila, so they should both be set. This works for me:

VOILA_APP_PORT=8000 voila --no-browser --template=embed --enable_nbextensions=True --Voila.tornado_settings="{'allow_origin': 'http://localhost:8080', 'allow_credentials':True}" --port=8000  --preheat_kernel=True --pool_size=3
havok2063 commented 2 years ago

ok, your patch plus the port fixed things. It's now working! Thanks Mario!