Skip to content
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

enhancement: Allow users to disable the fix_notebook call #1423

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/customize.md
Original file line number Diff line number Diff line change
Expand Up @@ -657,3 +657,11 @@ By default, Voilà's grace period for kernel startup time is 60 seconds. It can
```sh
voila --VoilaExecutor.startup_timeout=60
```

## Have voila attempt to solve a best fit kernel spec

By default, Voilà will attempt to resolve a kernel spec to the best fit, based on the available environments. You can disable this functionality as follows:

```py
c.VoilaConfiguration.attempt_fix_notebook = False
```
1 change: 1 addition & 0 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ For more information, you can also follow [the guide on the nginx blog](https://
### Using Apache2 as reverse proxy

Apache can also be used to serve voilà. These Apache modules need to be installed and enabled:

- mod_proxy
- mod_rewrite
- mod_proxy_http
Expand Down
6 changes: 6 additions & 0 deletions voila/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,9 @@ def _valid_file_blacklist(self, proposal):
help="""The dictionary of extension configuration, this dict is passed to the frontend
through the PageConfig""",
)

attempt_fix_notebook = Bool(
True,
config=True,
help="""Whether or not voila should attempt to fix and resolve a notebooks kernelspec metadata""",
)
3 changes: 2 additions & 1 deletion voila/notebook_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ async def load_notebook(self, path):
__, extension = os.path.splitext(model.get("path", ""))
if model.get("type") == "notebook":
notebook = model["content"]
notebook = await self.fix_notebook(notebook)
if self.voila_configuration.attempt_fix_notebook:
notebook = await self.fix_notebook(notebook)
return notebook
elif extension in self.voila_configuration.extension_language_mapping:
language = self.voila_configuration.extension_language_mapping[extension]
Expand Down