Quansight / Quansight.github.io

Quansight Github Website
https://Quansight.github.io/
MIT License
5 stars 9 forks source link

Add notebooks to the publishing cycle #1

Closed tonyfast closed 5 years ago

tonyfast commented 5 years ago

This pull request adds a github pages deployment to the blog. The pages deployment will convert notebooks in the _notebooks to markdown _posts. The post front matter is constructed from the notebook metadata and git revision histories.

This approach allows notebooks to be reused on binder for demonstration and read as blog documents.

Binder

Currently, the builds are passing on demo branches.

This is a decent start. I welcome any comments or ideas.

scopatz commented 5 years ago

This looks good to me! Any reason not to merge it?

scopatz commented 5 years ago

Maybe add some text to the readme about writing notebook entries?

tonyfast commented 5 years ago

I'll have to change the branches that the travis build is pointing to.

There is a little bit of a procedural question. Github pages deploys on specific branches, we don't want to publish preemptively otherwise an incomplete may be published.

We could either use a specific build branch like publish, add a _wip folder, or we could use the jekyll published flags.

I should probably turn the notebook I used to get this running into an actual document.

tonyfast commented 5 years ago

I still have to work on the pull request template with some instructions for making a post.

The build is now pointing at master and updating the blog.

Here is an example blog post. Is there anyway you could take a look at it and see if we want to keep it?

scopatz commented 5 years ago

That post looks great! It would be great to be have this. I'll review the PR again

saulshanabrook commented 5 years ago

This looks fun!

I would like to put an environment.yml or something per post so that Binder would pick this up. However Binder only seems to work as an environment per repository, see https://mybinder.readthedocs.io/en/latest/using.html

So I think what we could do is have one folder per notebook blog post. When it is published, we create a commit on a branch that is the name of the blog post. The contents of the repo in that branch are the contents of the folder. Then the binder link for each post points to that branch, so that it picks up any build files in that folder.

saulshanabrook commented 5 years ago

If this is merged, I can create a PR to try that out.

tonyfast commented 5 years ago

We should use environment.yml instead of requirements.txt. There could be a postBuild file that registers environments for each of the specific posts. The environments info could be stored in the notebook metadata.

saulshanabrook commented 5 years ago

We should use environment.yml instead of requirements.txt. There could be a postBuild file that registers environments for each of the specific posts. The environments info could be stored in the notebook metadata.

Sorry I don't think I was very explicit above, I meant just specifying build files for Binder to use not for us to use on Travis. For binder to use them, they could be any of their supported files but they have to be in a specific location in the repository (in the root or in the binder folder). So my suggestion was to make a commit for each post that has only the notebook and the binder config files in it, so that when you launch binder with that commit it picks up the right build information.

tonyfast commented 5 years ago

That is a cool idea. So each branch has an environment.yml that can be used explicitly. Maybe master only uses requirements.txt so it builds faster.

saulshanabrook commented 5 years ago

New branches for every notebook, that are created automatically, and have at the root whatever files you put in the folder for that notebook. i.e. in master you have structure: _notebooks/<notebook-name>/notebook.ipynb and _notebooks/<notebook-name>/<whatever-other-file>. Where <whatever-other-file> could be environment.yml or postBuild or requirements.txt, any file that binder recognizes (or just any file in general). Then we do some magic in Travis CI to make a new branch called <notebook-name> that has the contents of the _notebooks/<notebook-name> in the root of the repo. So when we tell binder to build that branch it picks up the right files.

So on every travis CI build it makes new commits to all notebook branches with the right files and pushes those.

saulshanabrook commented 5 years ago

Note: existing nbconvert in travis would behave the same with what I proposed, this would only be to change launch in binder behavior.

tonyfast commented 5 years ago

I dig that. Can you have a go at post and we'll use that to set this up the first time?

scopatz commented 5 years ago

Is there anything else that we need to do here?

tonyfast commented 5 years ago

lgtm. hopefully someone could try writing another post.