# PackageCompiler + myBinder Template

**URL:** https://discourse.julialang.org/t/packagecompiler-mybinder-template/22756
**Category:** Tooling
**Created:** [April 4, 2019, 3:04pm UTC](https://discourse.julialang.org/t/packagecompiler-mybinder-template/22756 "2019-04-04T15:04:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![arnavsood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arnavsood/32/4675_2.png) [@arnavsood](https://discourse.julialang.org/u/arnavsood)
#### Post date: [April 4, 2019, 3:04pm UTC](https://discourse.julialang.org/t/packagecompiler-mybinder-template/22756/1 "2019-04-04T15:04:33Z")

</div>

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](https://github.com/arnavs/compiled-binder-example). 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.

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [April 4, 2019, 3:38pm UTC](https://discourse.julialang.org/t/packagecompiler-mybinder-template/22756/2 "2019-04-04T15:38:08Z")

</div>

Fantastic!

---

<div class="post-metadata">

### Author: ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)
#### Post date: [April 4, 2019, 3:53pm UTC](https://discourse.julialang.org/t/packagecompiler-mybinder-template/22756/3 "2019-04-04T15:53:42Z")

</div>

Indeed, this is brilliant.

---

<div class="post-metadata">

### Author: ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)
#### Post date: [April 4, 2019, 4:23pm UTC](https://discourse.julialang.org/t/packagecompiler-mybinder-template/22756/4 "2019-04-04T16:23:30Z")

</div>

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

```julia
[[targets]]
compile = ["GR", "Plots"]

```

into your `Project.toml` file.

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