Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Enabling Real Time Collaboration

    JupyterHub
    4
    12
    806
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      Camille last edited by

      Hi,

      How can I enable real time collaboration in JupyterHub?
      The doc (https://jupyterlab.readthedocs.io/en/stable/user/rtc.html) says

      Editors are not collaborative by default; to activate it, start JupyterLab with the --collaborative flag.

      How can I do that in a Cloudron env?
      Thanks,
      Camille

      jdaviescoates 1 Reply Last reply Reply Quote 0
      • jdaviescoates
        jdaviescoates @Camille last edited by

        @Camille does this help?

        https://docs.cloudron.io/apps/jupyterhub/#other-custom-configuration

        I use Cloudron with Gandi & Hetzner

        C 1 Reply Last reply Reply Quote 0
        • C
          Camille @jdaviescoates last edited by

          @jdaviescoates Thanks.
          It's not clear to me what parameters can be changed in /app/data/customconfig.py
          besides c.Spawner.mem_limit and c.DockerSpawner.container_image.
          I searched in https://jupyterhub.readthedocs.io/en/stable/search.html?q=collaborative but didn't find many clues.
          I'll try c.Spawner.cmd = 'jupyter-lab --collaborative' but that'll be mostly guesswork 😉

          girish 1 Reply Last reply Reply Quote 1
          • girish
            girish Staff @Camille last edited by

            @Camille I think the collaborative flag only works with BinderHub - https://github.com/jupyterhub/binderhub . With JupyterHub, I think https://github.com/jupyterhub/jupyterhub/issues/394 was the issue tracker task to fix this , but it didn't progress far.

            Also, to pass extra args, use something like this in customconfig.py:

            c.Spawner.environment = {
                'NOTEBOOK_ARGS': '--collaborative'
            }
            

            (this comes from https://github.com/jupyter/docker-stacks/blob/master/base-notebook/start-notebook.sh#L26 and https://github.com/jupyterhub/jupyterhub/blob/dcf21d53fd9e6c131a269550c0a46f08ca9df5bb/docs/source/reference/spawners.md#environment-variables-and-command-line-arguments

            C 1 Reply Last reply Reply Quote 1
            • C
              Camille @girish last edited by

              Thanks @girish for all the pointers!

              C 1 Reply Last reply Reply Quote 0
              • C
                Camille @Camille last edited by

                Reading https://github.com/jupyterhub/jupyterhub/issues/3578 and https://discourse.jupyter.org/t/jupyterhub-collaboration-and-tags/11259
                it seems that collaborative flag would also work with JupyterHub.
                It tried adding c.LabApp.collaborative = True in customconfig.py with no luck.
                I'll investigate more thouroughly later.

                girish 1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff @Camille last edited by

                  @Camille The sharing involves using this "token" for authentication which I think works only on Binder. I am not 100% sure about this though, documentation is very sparse.

                  C 1 Reply Last reply Reply Quote 0
                  • girish
                    girish Staff last edited by

                    So, from https://jupyter.org/binder , "BinderHub is a web application that allows users to create sharable, interactive, reproducible environments from code repositories" . Docs are here - https://binderhub.readthedocs.io/en/latest/ . There is says "BinderHub is a kubernetes-based cloud service that allows users to share reproducible interactive computing environments from code repositories." .

                    I think we need to understand how all this ties into this "token" for collaboration.

                    1 Reply Last reply Reply Quote 0
                    • C
                      Camille @girish last edited by

                      Hi @girish Token authentication works great on our Cloudron JupyterHub. We can share notebooks fine but with no real time collaboration: we just get the usual overwrite problems.

                      girish 1 Reply Last reply Reply Quote 0
                      • girish
                        girish Staff @Camille last edited by

                        @Camille Oh, that's interesting. Can you tell me how you enabled it and how you made it work ? (i.e just shared notebooks without real time)

                        C 1 Reply Last reply Reply Quote 0
                        • C
                          Camille @girish last edited by

                          @girish Actually, I'm not really sure how we got there 😉
                          I have installed the https://github.com/jupyterlab-contrib/jupyterlab-link-share extension, which kind of works, but we have to manually add the token to the URL it provides.
                          So maybe it enabled settings in the background.
                          I will try to redo it from a fresh install and keep you posted.

                          1 Reply Last reply Reply Quote 1
                          • RubenFixit
                            RubenFixit last edited by

                            Adding the following to /app/data/customconfig.py worked for me:

                            c.Spawner.args = ['--collaborative']
                            

                            You also need to run /app/code/remove_notebook_containers.py after making changes.

                            For a list of parameters check out: https://jupyterhub.readthedocs.io/en/stable/api/spawner.html

                            1 Reply Last reply Reply Quote 2
                            • First post
                              Last post
                            Powered by NodeBB