PackageCompiler + myBinder Template


We’ve produced a simple template which people can use with git repos to deliver myBinder instances with AOT-compiled packages. This makes it much easier to use the myBinder service (which runs Jupyter notebooks in the cloud), as it does away with some of the performance overhead.

The repository is here. There are options for adding two types of dependencies (“regular,” and “PackageCompiler’d”), and the instructions for doing so are in the README.

Thanks to @jlperla and @davidanthoff for their helpful suggestions and assistance with this.




Indeed, this is brilliant.

1 Like

One question is whether all of this docker stuff is required. The short answer is (1) that we couldn’t figure out how to get it working with the postbuild scripts; and (2) that it really should be built directly into the mybinder Julia support directly.

We think that we know how to do it, but based on how mybinder works (and their standards) we need to have the list of packages to precompile inside of the standard project files. the mybinder crew only wants to support standard package/project/etc. files without incompatible extensions.

One proposed solution is:

  • Allow for a list of packages white-listed for compiling an image inside of the Project.toml file directly. I imagine there could be plenty of other users of that information, even if the Pkg.jl doesn’t use it directly.
  • The mybinder support conditionally looks to see if there are any listed packages to be precompiled into the system image. If not, it uses a normal image. If so, it does a packagecompiler step.
  • To users, this would all be seamless… you would just put a Project.toml and Manifest.toml in the folder, as mybinder currently supports.

As a strawman to discuss imagine a new compile which is allowed in the targets. If you wanted to whitelist Plots and GR for compiling into the images, you would add

compile = ["GR", "Plots"]

into your Project.toml file.

(consider moving this to a different thread if you think appropriate)