-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serverapp_config
support added in #248 is not working for my ExtensionApp
#536
Comments
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗 |
Hi @telamonian, I took a closer look at ExtensionApp (I was surprised your example didn’t work too). It turns out So, Jupyter Server doesn’t currently support loading static config into ServerApp from extensions that aren’t starting apps, but there should be a simple work around. ExtensionApp’s are “linked” before the ServerApp is fully configured, then “loaded”. This means you can inject ServerApp config during the linking step by overriding the link method in your ExtensionApp. e.g. def _link_jupyter_server_extension(self, serverapp):
if “contents_manager_class“ not in serverapp.config[”ServerApp“]:
static_config = {
“ServerApp": {
contents_manager_class": "jupyterfs.metamanager.MetaManager"
}
}
serverapp.update_config(static_config)
super()._link_jupyter_server_extension(serverapp) |
@Zsailer That's what I figured, but thanks for doing that dive.
Whelp, that's a lovely hideous hack. I'd guess my only addition would be to hard-fail (or at least warn) on preexisting Still, this hack obviously isn't the best way we could be doing these things. As discussed in the last juptyer_server meeting, the ideal solution would probably be to build the needed functionality into the code that parses the subconfigs from |
Yeah, I agree. This is a compelling case for enabling extensions to set config statically in config.d. There are a few things here we need to discuss in that new issue.
|
Haven't tried it since a long time, but I think to remember that you can override via python config like described in #207 (comment) So to make it clear, it is correct to say that it does not work via json, but does work via python. Agree to try to remove any surprise, but the pressure should not be set too much on the sever extension system as by nature/design, the jupyter configuration system introduces those potential surprise (in other words, surprises may already exist even if you don't use the server extension system) |
Following the conversation in #207, I attempted to refactor the
jupyterfs.extension
server extension into anExtensionApp
, with the goal that the refactor extension would set"contents_manager_class": "jupyterfs.metamanager.MetaManager"
as part of the extension's init via theserverapp_config
mechanism added in #248. But it seems likeserverapp_config
just gets ignored in my case:What I'm seeing is that the
isinstance
check fails and the_mm_config_warning_msg
warning prints, meaning that the"contents_manager_class"
is never actually set. Is this a valid use ofExtensionApp
andserverapp_config
? Am I doing something wrong here?The text was updated successfully, but these errors were encountered: