I try to add an s3 folder to the jupyter notebooks, where people would be able to put some shared notebooks there.
I do have the config to put in jupyter_notebook_config.py but i have no clue how to modify that in a kubernetes setup.
The bucket used depend on the environment, so i cannot really change the config in the docker build, since containers are used in multiple environment.
from s3contents import S3ContentsManager
from hybridcontents import HybridContentsManager
from notebook.services.contents.largefilemanager import LargeFileManager
c = get_config()
c.NotebookApp.contents_manager_class = HybridContentsManager
c.HybridContentsManager.manager_classes = {
"shared": S3ContentsManager,
"": LargeFileManager,
}
c.HybridContentsManager.manager_kwargs = {
"shared": {
"bucket": "${notebook_bucket}",
"prefix": os.path.join("jupyter", "shared")
},
"": {
"root_dir": "/home/jovyan/",
},
}
Does someone have an idea ?
I did consider the lifecyclehooks but not tried yet.