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

--collaborative flag is not correctly interpreted when jupyter-collaboration package is installed #14774

Closed
echarles opened this issue Jul 1, 2023 · 10 comments · Fixed by #14792 or jupyterlab/jupyter-collaboration#177

Comments

@echarles
Copy link
Member

echarles commented Jul 1, 2023

The --collaborative flag aims to indicate if JupyterLab should run or not with RTC.

When you use use flag without jupyter-collaboration package, the server stops with "To enable real-time collaboration, you must install the extension jupyter_collaboration You can install it using pip for example: python -m pip install jupyter_collaboration" which is the expected behavior.

When jupyter-collaboration is installed, the RTC mode is enabled even if you start without the --collaborative flag. RTC should be enabled only if you give --collaborative (see also #14715 (comment))

@echarles echarles added bug status:Needs Triage Applied to new issues that need triage labels Jul 1, 2023
@echarles echarles changed the title --collaborative flag is not applied when jupyter-collaboration package is installed --collaborative flag is not correctly interpreted when jupyter-collaboration package is installed Jul 1, 2023
@minrk
Copy link
Contributor

minrk commented Jul 1, 2023

One way to address this would be for Jupyter-collaboration to remove its "enable-by-default" config from the installation process. That seems like the correct behavior if collab is meant to be opt-in at runtime rather than install time.

@hbcarlos
Copy link
Member

hbcarlos commented Jul 3, 2023

Hi, @echarles.

Removing the collaborative flag was intentional, and the current behavior is correct. We keep the flag in JupyterLab to point users to the new extension.

@echarles
Copy link
Member Author

echarles commented Jul 3, 2023

Removing the collaborative flag was intentional, and the current behavior is correct. We keep the flag in JupyterLab to point users to the new extension.

True, I remember this has been discussed but not sure where, but it sounds like it is already bringing questions from 3 Jupyter user/developers (@fperez, @minrk and myself). I can imagine others have also questions on that. Is there a room to revisit that point?

@minrk
Copy link
Contributor

minrk commented Jul 3, 2023

Removing the collaborative flag was intentional, and the current behavior is correct

I think it's reasonable to follow the standard practice of extensions being on by default. But the --collaborative flag has not been removed, and still claims to be the way to enable collaboration in 4.0.2, implying that if it's not specified collaboration will be disabled:

# jupyter lab --help
--collaborative
    Whether to enable collaborative mode.
    Equivalent to: [--LabApp.collaborative=True]

The help string should probably mention more clearly that setting this flag is equivalent to enabling the jupyter-collaboration extension.

If you still want it to be easy to run in both ways without modifying packages (this makes sense to me in my use), it may be worth adding an opt-out --no-collaboration, since the default will be on from now own. Alternately, rely on the labextension disable for the opt-out to not treat it specially. But going that way suggests the --collaborative flag should show a deprecation message pointing to the standard extension mechanisms, rather than being a silent no-op.

@hbcarlos
Copy link
Member

hbcarlos commented Jul 3, 2023

If you still want it to be easy to run in both ways without modifying packages (this makes sense to me in my use), it may be worth adding an opt-out --no-collaboration, since the default will be on from now own. Alternately, rely on the labextension disable for the opt-out to not treat it specially

I prefer to use the labextension disable, but I'm fine adding the --no-collaboration flag to jupyter-collaboration.

But going that way suggests the --collaborative flag should show a deprecation message pointing to the standard extension mechanisms, rather than being a silent no-op.

We should deprecate it, we forgot to do it when we moved RTC to the jupyter-collaboration extension. In addition, we should change the help message to the same message we currently use when the flag is enabled.

To enable real-time collaboration, you must install the extension `jupyter_collaboration`.

@minrk
Copy link
Contributor

minrk commented Jul 8, 2023

Makes sense for it to behave like a standard extension.

FWIW, relying on filesystem state will make this harder for JupyterHub users, where deployments that have asked for RTC have generally only wanted it sometimes, so folks want the ability to have a single image that can be launched with and without RTC for different containers, which usually means differing only in CLI args or environment variables. opt-in --collaborative or opt-out --no-collaborative make that easy. I'm not sure how easy it is to specify extension disable/enable overrides for a single launch via CLI and/or env.

Additional configuration directories to add to JUPYTER_CONFIG_PATH or something may work, but will be a lot harder to document/communicate/implement.

@hbcarlos
Copy link
Member

Disabling and enabling an extension is a bit more complicated, so I added a new flag in jupyter-collaboration to turn off real-time collaboration on documents.

It is implemented here:
jupyterlab/jupyter-collaboration#177

Once released, it will be possible to disable RTC with --YDocExtension.disable_rtc=True while keeping every other collaborative feature (list of collaborators, chat, etc.)

@minrk
Copy link
Contributor

minrk commented Jul 13, 2023

@hbcarlos that sounds great!

@echarles
Copy link
Member Author

@hbcarlos I have just tried the --YDocExtension.disable_rtc=True and it does not work for me on my local dev env. Can you double confirm it is working for you?

@hbcarlos
Copy link
Member

hbcarlos commented Sep 4, 2023

Hi @echarles,

I just tried with a dev env from the main branch and the latest release, jupyter-collaboration v1.1.0, and it seems to work fine.

mdengler added a commit to mdengler/jupyterlab that referenced this issue Oct 24, 2023
… clear the process is exiting and why (jupyterlab#14774)

Updates error message from fix to [jupyterlab#14774](jupyterlab#14774)
mdengler added a commit to mdengler/jupyterlab that referenced this issue Oct 28, 2023
… clear the process is exiting and why (jupyterlab#14774)

Updates error message from fix to [jupyterlab#14774](jupyterlab#14774)
mdengler added a commit to mdengler/jupyterlab that referenced this issue Oct 28, 2023
… clear the process is exiting and why (jupyterlab#14774)

Updates error message from fix to [jupyterlab#14774](jupyterlab#14774)
mdengler added a commit to mdengler/jupyterlab that referenced this issue Nov 2, 2023
… clear the process is exiting and why (jupyterlab#14774)

Updates error message from fix to [jupyterlab#14774](jupyterlab#14774)
mdengler added a commit to mdengler/jupyterlab that referenced this issue Nov 3, 2023
… clear the process is exiting and why (jupyterlab#14774)

Updates error message from fix to [jupyterlab#14774](jupyterlab#14774)
mdengler added a commit to mdengler/jupyterlab that referenced this issue Nov 4, 2023
… clear the process is exiting and why (jupyterlab#14774)

Updates error message from fix to [jupyterlab#14774](jupyterlab#14774)
krassowski pushed a commit that referenced this issue Nov 25, 2023
… clear the process is exiting and why (#14774) (#15300)

Updates error message from fix to [#14774](#14774)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants