Closed choldgraf closed 4 years ago
This would be an 'uninstall' command I guess? I agree we should have one!
What do you do about user home directories?
good question - maybe a flag? tljh-config uninstall -u
?
From my experience after trying to delete (and restore) a user, I suspect that the uninstall might leave some user artifacts behind.
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:
/opt/tljh
(directory)/usr/bin/tljh-config
(symlink)Then there is the three services located at:
/etc/systemd/system/configurable-http-proxy.service
/etc/systemd/system/traefik.service
/etc/systemd/system/jupyterhub.service
~but I don't know how to remove them in the appropriate way.~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
jupyterhub-admins
and jupyterhub-users
groups with sudo delgroup <group>
/etc/sudoers.d/jupyterhub-admins
.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.
And
how about we:
WDYT?
Makes sense @choldgraf. It may also be helpful to provide information on "what/where" things are installed in a default deployment.
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.
Uninstall is probably most relevant for real servers (pets). For the virtual versions (cattle), the VM just gets destroyed.
@fm75 I think those are all good points...I'm gonna close down that PR, and let's get some docs in there! :-D
@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?
@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
Ok so how would you recommend we tear down a TLJH?
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, ...).
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.
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?
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
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.
maybe adding some short documentation on this is something that @GeorgianaElena could help out with?
@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.
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:
postgres
system userSimilarly with Nginx: the nginx
system user, user created HTML files and modified configuration files are not removed.
https://github.com/jupyterhub/the-littlest-jupyterhub/pull/545 was merged. Is there anything left to do here?
I'm +1 on closing this and seeing if folks bring up the issue again
Woop woop, gonna close this. Thanks for getting this done, @GeorgianaElena!
- Remove the
jupyterhub-admins
andjupyterhub-users
groups withsudo 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>
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
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!
@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.
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 atljh-config clean
command that would require you to confirm, and if so would completely erase all jupyterhub-related changes to the machine?