# Binderhub for kernels? KernelHub?

**URL:** <https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274>\
**Category:** Binder\
**Created:** [December 13, 2018, 12:58pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274 "2018-12-13T12:58:27Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [December 13, 2018, 12:58pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/1 "2018-12-13T12:58:27Z")

</div>

This is something I’ve been pondering for a bit…

Binderhub lets me define a repo, which may be a kernel defining repo, and create a build against it that eg lets me open a notebook against that (dynamically built) kernel.

But what if I have my own notebook server and just want to connect to a remote kernel built from that repo?

What I’m wondering is, is the notion of a KernelHub meaningful, where eg you pass a git repo URL, KernelHub builds and runs the repo as a kernel process and gives you a connection string back that you can use to access the kernel, as a remote kernel, from your own notebook server.

(One of the things I’ve noticed about installing custom kernels is that they may have a stack of other dependencies that are required and for which installation guides are less than helpful…)

---

<div class="post-metadata">

**Author:** ![choldgraf](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/choldgraf/32/1264_2.png) [@choldgraf](https://discourse.jupyter.org/u/choldgraf)\
**Post date:** [December 13, 2018, 7:17pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/2 "2018-12-13T19:17:30Z")

</div>

you should check out these repos, that are nibbling around the edges of what you’re thinking about here 🙂

- [https://github.com/ines/juniper](https://github.com/ines/juniper)
- [https://github.com/minrk/thebelab](https://github.com/minrk/thebelab)
- [https://github.com/SamLau95/nbinteract](https://github.com/SamLau95/nbinteract)

And an example of juniper in action: [https://spacy.io/](https://spacy.io/)

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [December 14, 2018, 3:53pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/3 "2018-12-14T15:53:19Z")

</div>

Yes and no… What I’m wondering is: what’s the lightest way of running just a kernel?

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [December 14, 2018, 3:54pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/4 "2018-12-14T15:54:30Z")

</div>

(Thebelab et al are client packages that call on a kernel running via Binderhub. Do they need the full machinery of all the stuff Binderhub builds into its images?)

---

<div class="post-metadata">

**Author:** ![choldgraf](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/choldgraf/32/1264_2.png) [@choldgraf](https://discourse.jupyter.org/u/choldgraf)\
**Post date:** [December 14, 2018, 4:13pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/5 "2018-12-14T16:13:06Z")

</div>

ah - I guess my question then is: what do you mean by “just a kernel”? I thought you were asking for arbitrary binder-like environments running via a text interface in the cloud.

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [December 14, 2018, 8:14pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/6 "2018-12-14T20:14:30Z")

</div>

By “kernel”, I guess I mean a minimal environment that includes just the Linux and language specific packages to execute the programme language commands that I would be able to execute in a notebook code cell associated with that “kernel”.

So eg for gnuplot kernel, that would be gunplot and its dependencies, metakernal / gnuplot metakernel and its dependencies, and whatever other dependencies are required so that I could fire up a container containing that stuff and connect to it, as “a kernel” from something like ThebeLab.

–tony

---

<div class="post-metadata">

**Author:** ![choldgraf](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/choldgraf/32/1264_2.png) [@choldgraf](https://discourse.jupyter.org/u/choldgraf)\
**Post date:** [December 14, 2018, 10:53pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/7 "2018-12-14T22:53:25Z")

</div>

I think in this case BinderHub is actually a decent choice - if you specify a minimal number of requirements, it basically just uses a barebones ubuntu environment which is quite lightweight, then spins up a jupyter server so you can connect with it. I think you can do the same thing w/ JupyterHub too (that’s what binderhub is using under the hood)

---

<div class="post-metadata">

**Author:** ![betatim](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/betatim/32/10_2.png) [@betatim](https://discourse.jupyter.org/u/betatim)\
**Post date:** [December 16, 2018, 9:39pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/8 "2018-12-16T21:39:53Z")

</div>

I’d start prototyping this with a JupyterHub or BinderHub. Also investigate kernel gateway as it sounds like it should be made for this. I’ve never found time to look at it and through all the enterprise talk can’t quite work out what it does.

In terms of minimalism [https://github.com/binder-examples/minimal-dockerfile/blob/c7928dc713893d8aba4d8e2c3fe6025681524636/Dockerfile](https://github.com/binder-examples/minimal-dockerfile/blob/c7928dc713893d8aba4d8e2c3fe6025681524636/Dockerfile) is the minimal `Dockerfile` to get things going on BinderHub (or I guess a JupyterHub)

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [December 17, 2018, 9:30am UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/9 "2018-12-17T09:30:36Z")

</div>

Ah, yes… kernel gateway… maybe that’s what I need…

Lost track of that one!

Thanks  
–tony

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [May 19, 2019, 7:59pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/10 "2019-05-19T19:59:52Z")

</div>

Here’s another take on this:

- suppose I’m running Jupyter notebook locally on a Windows machine. I want to run a particular thing that requires a particular Linux package. There’s a Binderised repo that does the job. Can I add a repo as a (remote) Binderised kernel to my notebook kernel list and run notebooks against it?

(This is perhaps also relevant to the Juniper and Carnets iOS clients?)

- suppose further that I’m writing some notebooks where the markdown analysis / evaluation is sensitive even if the code / code outputs aren’t (maybe because they lack context, or because the data is only meaningful / sensitive only if I know who / where / what it relates to). If I can run my notebook code against the remote kernel running on MyBinder, will the notebook be saved to the MyBinder container or is the only transport the code cell code to be executed and the execution response?

---

<div class="post-metadata">

**Author:** ![yuvipanda](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/yuvipanda/32/17_2.png) [@yuvipanda](https://discourse.jupyter.org/u/yuvipanda)\
**Post date:** [May 19, 2019, 8:51pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/11 "2019-05-19T20:51:34Z")

</div>

> [@psychemedia](#):
>
> - suppose further that I’m writing some notebooks where the markdown analysis / evaluation is sensitive even if the code / code outputs aren’t (maybe because they lack context, or because the data is only meaningful / sensitive only if I know who / where / what it relates to). If I can run my notebook code against the remote kernel running on MyBinder, will the notebook be saved to the MyBinder container or is the only transport the code cell code to be executed and the execution response?

My understanding here is that only the code and output are sent to the _kernel_, assuming the kernel is different from the notebook server. All contents are sent to the notebook server.

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [May 20, 2019, 11:05am UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/12 "2019-05-20T11:05:40Z")

</div>

Right. So this _would_ provide a way of keeping notebook text secret whilst still using public MyBinder compute resource.

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [August 12, 2019, 4:16pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/13 "2019-08-12T16:16:53Z")

</div>

Loosely related to this, a scrappy attempt at a Python client for launching a MyBinder server, starting a kernel, and running a bit of code on it, cf. Juniper and ThebeLab: [https://gist.github.com/psychemedia/ca2d41ea5fcf37d1c6473d4384742021](https://gist.github.com/psychemedia/ca2d41ea5fcf37d1c6473d4384742021)

There are probably better ways of doing this, but I was trying to think something through for myself about what having this sort of client to hand might make possible!

---

<div class="post-metadata">

**Author:** ![psychemedia](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/psychemedia/32/24_2.png) [@psychemedia](https://discourse.jupyter.org/u/psychemedia)\
**Post date:** [December 9, 2019, 2:10pm UTC](https://discourse.jupyter.org/t/binderhub-for-kernels-kernelhub/274/14 "2019-12-09T14:10:16Z")

</div>

Another take on launching and accessing a remote MyBinder kernel, wrapped up in hacky magic…

> **[innovationOUtside/ipython\_binder\_magic](https://github.com/innovationOUtside/ipython_binder_magic)**
>
> Run commands on a remote MyBinder kernel. Contribute to innovationOUtside/ipython\_binder\_magic development by creating an account on GitHub.

It works more or less just enough to POC how this sort of thing might be used, as long as you set your expectations quite low…

I’m guessing there’s a way of connecting to and conversing with the kernel using code from the jupyter notebook/client code, but I was riffing on a code fragment from Sagemath that I’d previously had working…
