TL;DR
How do you stop the nb_conda_kernels automatic kernel detection in a Vertex AI User Managed Notebook instance?
Details
I am building Vertex AI User Managed Notebook instances from a Docker image. It all works great, except that the default Jupyter Lab installation seems to include the nb_conda_kernels extension. As far as I have been able to tell, the extension is the root of icon duplication in the Launcher, such that there will be two icons for each environment. There are various threads that have discussed this: here, here, here.
I am able to remove the unwanted icons by manually entering each environment and running jupyter kernelspec remove <name>
. However, there must be a better way. I have tried uninstalling nb_conda_kernels, but the instance runs out of memory because of the complexity of the build (I think that's the cause, anyway). I have tried disabling the extension using python -m nb_conda_kernels.install --disable --prefix=$CONDA_PREFIX
from the base environment, and also from within other environments, but it doesn't have the desired effect. I have also tried modifying the configuration file located at /opt/conda/etc/jupyter/jupyter_config.json, to include a CondaKernelSpecManager env_filter based on the example here. This does not seem to work either.
I am not attached to removing the extension, but I would like to remove its effects, or otherwise stop the duplication. In theory, disabling should do the trick. Could someone please tell me how to efficiently remove the nb_conda_kernels automatically-detected kernels from my icon list that appears in the Launcher? Ideally the solution would be something I could include either in my Docker file (unlikely, I suspect), or as a post-startup-script when using gcloud notebooks instances create
(more likely, I suspect).
Thank you!