Skip to content

Commit

Permalink
Allow users to disable the fix_notebook call
Browse files Browse the repository at this point in the history
  • Loading branch information
castrom committed Nov 29, 2023
1 parent 2eca6f1 commit 7e04a13
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
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

0 comments on commit 7e04a13

Please sign in to comment.