Turn off trash functionality

Hello,
I am using kubeflow with jupyter notebooks. The image I am using is the following kubeflownotebookswg/jupyter-tensorflow-full:v1.8.0.

I want to set c.FileContentsManager.delete_to_trash=False in the .jupyter/jupyter_notebook_config.py file but I am not sure how I would be able to. I have tried createing a custom Docker image where I COPY ./jupyter_notebook_config.py ~/.jupyter/jupyter_notebook_config.py but this does not seem to work. Does anyone have any suggestions?

Thanks in advance!

For modern Notebook versions (7.0+) you would be looking at saving configuration in jupyter_server_config.py not jupyter_notebook_config.py

2 Likes

Hello @krassowski I noticed that the file is not present in my notebook. When I ls .jupyter/ the jupyter_server_config.py file does not exist. Is there some step that would result in removing the files?

Or would I be able to add something like the following

# configure - jupyter
# NOTE: we use `--level=system` to write these configs at `/usr/local/etc/jupyter` because it defaults
##      to `/opt/conda/etc/jupyter` and conda cleans that directory after every install
RUN jupyter labextension disable --level=system "@jupyterlab/apputils-extension:announcements" \
 && jupyter labextension lock --level=system "@jupyterlab/apputils-extension"

It does not need to exist. There might be one in another location, see jupyter --paths. jupyter server --generate-config will create it. Please see Configuring a Jupyter Server — Jupyter Server documentation and Migrating from Notebook Server — Jupyter Server documentation

You can also pass traitlets in startup command like --FileContentsManager.delete_to_trash=False (or similar)