jupyterhub / the-littlest-jupyterhub

Simple JupyterHub distribution for 1-100 users on a single server
https://tljh.jupyter.org
BSD 3-Clause "New" or "Revised" License
1.03k stars 339 forks source link

Add a command to uninstall TLJH #128

Closed choldgraf closed 4 years ago

choldgraf commented 6 years ago

I've had a few moments where I need to delete the hub and just start fresh. I know to delete /opt/tljh, but I always feel like I might be missing something. Moreover, most people probably won't think to check /opt/tljh. What if we added a tljh-config clean command that would require you to confirm, and if so would completely erase all jupyterhub-related changes to the machine?

yuvipanda commented 6 years ago

This would be an 'uninstall' command I guess? I agree we should have one!

What do you do about user home directories?

choldgraf commented 6 years ago

good question - maybe a flag? tljh-config uninstall -u ?

fm75 commented 5 years ago

From my experience after trying to delete (and restore) a user, I suspect that the uninstall might leave some user artifacts behind.

olivierverdier commented 5 years ago

At least instructions as to which files are installed where would be welcome. As far as I can see, the following locations would have to be removed during an uninstall:

Then there is the three services located at:

Edit: you would remove those services by first running sudo systemctl disable <service>, and then remove the files themselves, I guess.

Two other things to do are

Of course, as @yuvipanda said, if you allowed your users to run arbitrary command, then there is no point at all in uninstalling. However, in some cases it might make sense to include the information above in the documentation.

fm75 commented 5 years ago

And

choldgraf commented 5 years ago

how about we:

  1. Close #134 (I think this is perhaps too fraught to do with a "one-command uninstall"
  2. Open a docs PR to add a page to howto that explains what you two just mentioned above

WDYT?

willingc commented 5 years ago

Makes sense @choldgraf. It may also be helpful to provide information on "what/where" things are installed in a default deployment.

fm75 commented 5 years ago

I don't think that there is anything wrong with the goal.

Documenting the complexity will make understanding the system better which will help both users and developers. Maybe when it is all done, we will have a one-line uninstall and if it leaves artifacts of some sort we will understand the limitations.

fm75 commented 5 years ago

Uninstall is probably most relevant for real servers (pets). For the virtual versions (cattle), the VM just gets destroyed.

choldgraf commented 5 years ago

@fm75 I think those are all good points...I'm gonna close down that PR, and let's get some docs in there! :-D

fm75 commented 5 years ago

@choldgraf If we agree that this is a "real-server-only" issue, the nearest existing doc that I can think of is Installing on your own server.

The docs/howto/admin-users is vaguely related on the user admin part, but I think it already covers what I know about adding and removing users. I think my knowledge there might be less than complete. We also have non-user stuff to document.

/docs/topic probably needs an entirely new topic - but it probably would need to be labelled for "your server", since the information does not seem valuable for the virtual servers.

/docs/troubleshooting seems wrong, too.

WDYT?

yuvipanda commented 5 years ago

@olivierverdier @choldgraf @willingc http://tljh.jupyter.org/en/latest/topic/installer-actions.html already contains information about what TLJH puts on your system.

Perhaps we can add a section to each thing there on how to get rid of it? That would be specific and actionable.

I'm unconvinced you can really 'uninstall' TLJH though. For example, once you give a user root access, they can practically do whatever they want (including giving themselves other ways to access the system). 'Uninstall' can't really do anything about that. Same with extra packages they might have installed, etc. The only clean way is to wipe the whole server.

So I'd prefer we not use the word 'uninstall', and instead provide targeted information in http://tljh.jupyter.org/en/latest/topic/installer-actions.html

jzf2101 commented 5 years ago

Ok so how would you recommend we tear down a TLJH?

gvdr commented 5 years ago

P.S. @yuvipanda I agree about the difficulty of unistalling TLJH after it has been used, but it is still possible to wipe out a fresh installation. It's a common enough operation (e.g., to re-install with better settings, because of discovered conflicts with other components of the stack, ...).

yuvipanda commented 5 years ago

I think we should recommend people tear down a TLJH by deleting the VM it was installed on. This is probably not workable for a bare metal server though.

yuvipanda commented 5 years ago

Good point, @gvdr. Do you think adding sections in http://tljh.jupyter.org/en/latest/topic/installer-actions.html on 'how to remove' would solve that use case?

Ibsardar commented 4 years ago

Has the 'how to remove' been added to the docs? I wasn't able to locate any info on how to uninstall/reinstall tljh...

So I asked a question on here: https://discourse.jupyter.org/t/how-do-i-reinstall-the-littlest-jupyterhub/2910

purplecat7 commented 4 years ago

This is a great system, but sometimes one needs to remove it... even with all the details of what the installer does, I'm not really able to work out what to do to remove it cleanly from a host. Please add documentation, or an uninstall facility. The list near the top of this thread is the only info available (that I've found after extensive searching). I've not got the option of destroying the VM - too much work into it already.

choldgraf commented 4 years ago

maybe adding some short documentation on this is something that @GeorgianaElena could help out with?

GeorgianaElena commented 4 years ago

@choldgraf, I just added this issue to my todo list. I'll look into it, try to track down the limitations and come up with some steps.

manics commented 4 years ago

We could use standard package managers as a guide for what to support? For example if you install PostgreSQL server with yum or apt, then uninstall it, the following are removed:

The following are not removed:

Similarly with Nginx: the nginx system user, user created HTML files and modified configuration files are not removed.

manics commented 4 years ago

https://github.com/jupyterhub/the-littlest-jupyterhub/pull/545 was merged. Is there anything left to do here?

choldgraf commented 4 years ago

I'm +1 on closing this and seeing if folks bring up the issue again

yuvipanda commented 4 years ago

Woop woop, gonna close this. Thanks for getting this done, @GeorgianaElena!

nguyenvulong commented 4 years ago
  • Remove the jupyterhub-admins and jupyterhub-users groups with sudo delgroup <group>

Thanks so much for the comprehensive list. I just want to add that we also need to remove users under home directory /home/user with sudo deluser <user>

meeseeksmachine commented 3 years ago

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/kernel-error-typeerror-kernel-spec-manager-changed/7490/3

1kastner commented 3 years ago

Another reason for an uninstall might be if you develop a tuhh plugin that you want to try out. If there is any bug in the installation process, a fresh start would be great!

ptiwari2407 commented 1 year ago

@choldgraf This issue is a real problem even now, when I updated from Ubuntu 20.04 to 22.04 and there is no clean way to uninstall it. Some-one should have a makefile or something that one can run to do the uninstallation. There is very high coupling for this software and that makes it very hard still in 2023, to do the uninstalltion.