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

Build via binderbot #89

Closed
brian-rose opened this issue Oct 11, 2022 · 8 comments
Closed

Build via binderbot #89

brian-rose opened this issue Oct 11, 2022 · 8 comments
Labels
infrastructure Infrastructure related issue

Comments

@brian-rose
Copy link
Member

Following successful experiments in ProjectPythia/cmip6-cookbook#27 and ProjectPythia/pythia-foundations#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:

  • the link to the binder (stored in the field binderhub_url: in _config.yml)
  • the list of all notebook files to be executed (from _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.

@brian-rose
Copy link
Member Author

#90 now has a working demo, and #91 shows how to disable binder-based execution.

@brian-rose
Copy link
Member Author

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)

@brian-rose
Copy link
Member Author

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!

@brian-rose
Copy link
Member Author

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.

@brian-rose
Copy link
Member Author

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

@brian-rose
Copy link
Member Author

I've implemented a solution for this, now merged into https://github.com/ProjectPythiaCookbooks/cookbook-actions

#94 shows how we can now switch to binderbot-based execution just by setting execute_notebooks: binder in the _config.yml file.

@brian-rose
Copy link
Member Author

#96 does some final cleanup of the new template. Once that's merged, I think we can close this issue and propagate the changes out to all the existing cookbook repos.

@brian-rose
Copy link
Member Author

Ok, closing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Infrastructure related issue
Projects
None yet
Development

No branches or pull requests

1 participant