Closed brian-rose closed 1 year ago
I think now that the best path forward is to simplify the "switching" between using binderbot and executing on github actions.
Why not use the execute_notebooks
field that's already in the _config.yml
file. JupyterBook uses this field to decide whether / how to execute the notebooks. We could piggyback on this by adding a new option:
execute_notebooks: binder
The various workflows can parse this file to see if they should execute via binderbot, in which case we would manually set execute_notebooks: 'off'
before calling jupyter-book build
(we already do that for the link-checker action, e.g. https://github.com/ProjectPythia/pythia-foundations/blob/9e2dc028d62e4f203ecdae860822f2c8d16ca939/.github/workflows/link-checker.yaml#L33)
Why not use the
execute_notebooks
field that's already in the_config.yml
file
with the eventual goal of migrating this functionality upstream into JupyterBook!
although the downside is that it would break jupyterbook build
for local builds.
A backwards-compatible alternative would be to add new field to the execute
section of _config.yml
. But then "switching" between execution modes would require changing more than one field.
Discussed this at the IWG today 10/31/2022, got the green light to go ahead and mock something up that overrides the execute_notebooks
field
I've implemented a solution for this, now merged into https://github.com/ProjectPythiaCookbooks/cookbook-actions
execute_notebooks: binder
in the _config.yml
file.Ok, closing this!
Following successful experiments in https://github.com/ProjectPythiaCookbooks/cmip6-cookbook/pull/27 and https://github.com/ProjectPythia/pythia-foundations/pull/322, it's time to build the binderbot functionality into the template and (once it's working) push those changes out to all cookbook repos.
My recent refactor of the infrastructure makes this much easier. Most (all?) the changes will actually occur in the reusable workflows over at https://github.com/ProjectPythiaCookbooks/cookbook-actions.
What I have in mind is a python script that parses
_config.yml
and_toc.yml
to get things needed for the call to binderbot:binderhub_url:
in_config.yml
)_toc.yml
)That would all happen within the reusable https://github.com/ProjectPythiaCookbooks/cookbook-actions/blob/main/.github/workflows/build-book.yaml
One question is whether this should be automatic (i.e. every Cookbook executes this way), or whether there should be a switch for the individual Cookbook to choose whether to execute via binderbot or on GitHub Actions.