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

Implement FPS-based Voila server #984

Closed
wants to merge 9 commits into from

Conversation

davidbrochart
Copy link
Member

References

Closes #977

Code changes

  • Add a Voila fps flag, allowing to use FPS instead of Tornado.
  • Have VoilaHandler depend on a server-agnostic _VoilaHandler class, so that the FPS server can reuse most of the handler logic.
  • Create a fps-voila FPS plugin, which implements a FPSVoilaHandler based on _VoilaHandler.

User-facing changes

By default, Voila is backed by jupyter-server (no change). To use FPS, launch Voila with the --fps flag.

Limitations

This is still a POC, which allows to serve a notebook with widgets, but:

  • no progressive HTML rendering,
  • no tree view,
  • and probably more broken functionalities!

@github-actions
Copy link
Contributor

Binder 👈 Try it on binder (branch davidbrochart/voila/jupyverse)

@davidbrochart davidbrochart marked this pull request as draft September 30, 2021 09:01
@jtpio jtpio added the new label Sep 30, 2021
@jtpio jtpio added this to the 0.3.0 milestone Sep 30, 2021
@trungleduc
Copy link
Member

@davidbrochart #936 is merged, NotebookRenderer is now available.

@davidbrochart
Copy link
Member Author

Thanks, I will look at it.

@davidbrochart
Copy link
Member Author

I just rebased, now that #936 is merged.

@trungleduc
Copy link
Member

Hi @davidbrochart, I know this PR is still in the early phase but what do you think about the idea of refactoring the current Voila class into 2 parts, one is the CLI application to deal with the configurations, initialization... and the second part is the webserver application. So that we can have two interchangable servers implemented with tornado and fps.

@davidbrochart
Copy link
Member Author

That sounds good @trungleduc, but what do you mean exactly? Having two methods, one for launching the Tornado application and one for launching the Uvicorn application?

@trungleduc
Copy link
Member

I'm thinking about having a common interface for both and the CLI app does not need to know about the webserver implementation.

@davidbrochart
Copy link
Member Author

But then how do you switch between jupyter-server and FPS? Currently it is passed as a CLI option:

voila my_notebook.ipynb --fps

@trungleduc
Copy link
Member

Maybe we need to think more about it but the first thing popped in my head is to keep a mapping between the server configuration (--fps, --jupyter_server, ...) and the class of server implementation, then the CLI app can instantiate the selected web server with self._server_class_mapping[self.server_config](args...)

@davidbrochart davidbrochart force-pushed the jupyverse branch 4 times, most recently from f58e770 to 186f00e Compare October 28, 2021 07:48
@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2021

Benchmark report

The execution time (in milliseconds) are grouped by test file, test type and browser.
For each case, the following values are computed: min <- [1st quartile - median - 3rd quartile] -> max.

Results table
Test file basics.ipynb bqplot.ipynb dashboard.ipynb gridspecLayout.ipynb interactive.ipynb ipympl.ipynb ipyvolume.ipynb multiple_widgets.ipynb query-strings.ipynb
Render
chromium
actual 3010 <- [3020 - 3156 - 3176] -> 3520 2912 <- [2916 - 2938 - 3006] -> 3093 3014 <- [3121 - 3203 - 3283] -> 3418 3412 <- [3818 - 3821 - 3869] -> 3894 2037 <- [2038 - 2047 - 2071] -> 2124 3974 <- [4060 - 4229 - 4513] -> 5782 14836 <- [17250 - 18231 - 19158] -> 19177 12668 <- [12704 - 12836 - 12951] -> 13236 1629 <- [1684 - 1698 - 1771] -> 1915
expected 3379 <- [3442 - 3517 - 3701] -> 3876 2976 <- [3227 - 3321 - 3421] -> 3604 3608 <- [3623 - 3709 - 3793] -> 3825 4453 <- [4453 - 4523 - 4661] -> 4748 2559 <- [2655 - 2656 - 2660] -> 2674 3982 <- [4079 - 4213 - 4356] -> 4743 12183 <- [18509 - 19553 - 20811] -> 21515 15319 <- [15660 - 15796 - 15912] -> 16056 1517 <- [1920 - 1997 - 2103] -> 2113

❗ Test metadata have changed
--- /dev/fd/63	2021-11-04 11:58:41.981693399 +0000
+++ /dev/fd/62	2021-11-04 11:58:41.981693399 +0000
@@ -8,33 +8,33 @@
   },
   "systemInformation": {
     "cpu": {
-      "brand": "Xeon® E5-2673 v4",
+      "brand": "Xeon® E5-2673 v3",
       "cache": {
         "l1d": 65536,
         "l1i": 65536,
         "l2": 524288,
-        "l3": 52428800
+        "l3": 31457280
       },
       "cores": 2,
       "family": "6",
-      "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt md_clear",
+      "flags": "fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single pti fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt md_clear",
       "governor": "",
       "manufacturer": "Intel®",
-      "model": "79",
+      "model": "63",
       "physicalCores": 2,
       "processors": 1,
       "revision": "",
       "socket": "",
-      "speed": 2.3,
+      "speed": 2.4,
       "speedMax": null,
       "speedMin": null,
-      "stepping": "1",
+      "stepping": "2",
       "vendor": "GenuineIntel",
       "virtualization": false,
       "voltage": ""
     },
     "mem": {
-      "total": 7289622528
+      "total": 7291699200
     },
     "osInfo": {
       "arch": "x64",
@@ -42,11 +42,11 @@
       "codename": "Focal Fossa",
       "codepage": "UTF-8",
       "distro": "Ubuntu",
-      "kernel": "5.11.0-1020-azure",
+      "kernel": "5.8.0-1040-azure",
       "logofile": "ubuntu",
       "platform": "linux",
       "release": "20.04.3 LTS",
-      "serial": "92bef7b423eb4bb0b05dd0208eb3d3da",
+      "serial": "cfc067bfcb844f35865e279a1b0e66c5",
       "servicepack": "",
       "uefi": false
     }

@davidbrochart davidbrochart force-pushed the jupyverse branch 4 times, most recently from 541eee9 to ecd05cb Compare October 29, 2021 08:59
@davidbrochart davidbrochart marked this pull request as ready for review October 29, 2021 09:14
@trungleduc
Copy link
Member

Thank @davidbrochart for your work on this, this is looking very nice!

@trungleduc
Copy link
Member

One question about testing, can we make all tests run on both jupyter-server and fps ?

voila/handler.py Outdated
self.voila_configuration = kwargs['voila_configuration']
# we want to avoid starting multiple kernels due to template mistakes
self.kernel_started = False
async def _get(self, path=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might need docstring and typing for this function because using self as a function parameter is a little bit confusing.

@davidbrochart
Copy link
Member Author

One question about testing, can we make all tests run on both jupyter-server and fps ?

I didn't look at tests, I think they are very tightly coupled with Tornado and jupyter-server.

@davidbrochart
Copy link
Member Author

UI tests are now passing.

@trungleduc
Copy link
Member

trungleduc commented Nov 8, 2021

I think you need to update the screenshots for voila project of playwright

@davidbrochart davidbrochart force-pushed the jupyverse branch 4 times, most recently from 9d776d2 to e78fddb Compare November 8, 2021 16:07
@trungleduc
Copy link
Member

@davidbrochart should we close this PR? It looks like FPS won't be maintained anymore.

@davidbrochart
Copy link
Member Author

I didn't remember we started that. Yes I'll close it and we will need to open a new PR when jupyter-server/jupyverse#277 is merged.

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

Successfully merging this pull request may close these issues.

Implement a fps plugin for Voila
3 participants