question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support running without kubernetes, just docker

See original GitHub issue

Proposed change

There’s nothing inherent about binderhub that requires kubernetes. What it needs really is:

  1. A way to spawn repo2docker
  2. A way to tell a JupyterHub to run users with a specific image

This is doable without kubernetes! If you look at where we use kubernetes, it is mostly only in build.py. We already support another build backend - FakeBuild.

I’d like to support an additional backend that lets you run binderhub on a single host, with docker + a jupyterhub with dockerspawner. This will make it much easier for people to set up ‘small’ binderhubs internally, and also exercise our abstraction for future users (who might want it on HPCs, for example).

Alternative options

Decide that we have a hard dependency on kubernetes, and other setups will not be supported. I don’t think we should do this though.

Who would use this feature?

  1. People who want to run binderhub on a single node, since they don’t expect a lot of traffic (or it is authenticated)
  2. People who want to code for different backends eventually. This would also involve finishing up @manics’s work in https://github.com/jupyterhub/repo2docker/pull/848 in repo2docker, but that can happen independent of work here.

(Optional): Suggest a solution

  1. Turn Build in https://github.com/jupyterhub/binderhub/blob/00bd8304e99e9a4edbdfcca6fd98293fb1fb2e6a/binderhub/build.py#L18 into an abstract, well defined interface. I think this involves definint __init__, submit and stream_logs
  2. Implement a DockerBuild that implements Build on top of the docker API
  3. Investigate features we need that are deployed as part of the helm chart, rather than in the python package. Refactor as needed (keeping in mind needs of simplicity for mybinder.org)
  4. Move our kubernetes imports to a file, and make it conditional. This helps us make kubernetes an optional dependency!
  5. Add tests to make sure things work with just docker!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
yuvipandacommented, Jul 2, 2021

Counterpoint to myself: if we can run BinderHub with just docker, it will make local testing of most of the logic way easier, maybe improving maintenance of the whole thing.

+1

We can also put the docker logic in a separate package, so we end up in a situation like we have with spawners. I use SimpleLocalProcessSpawner for testing, and that’s so much nicer than requiring k8s for it.

1reaction
manicscommented, Jul 2, 2021

👍 to putting the Docker logic in a separate package. I think just the act of defining interfaces (e.g. BinderBuilder and BinderLauncher?) will improve maintainability of the code through clear documentation, at the moment there’s an assumption you know a lot of Kubernetes concepts which can make the code hard to understand.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run Kubernetes without Docker - SIGHUP
If you have a cluster already provisioned by major cloud providers like GKE, EKS, or AKS‌ (which defaults to containerd) or if you...
Read more >
Kubernetes is deprecating Docker: What you need to know
Kubernetes is removing support for Docker as a container runtime. Kubernetes does not actually handle the process of running containers on a ...
Read more >
Kubernetes is Removing Docker Support, Kubernetes is Not ...
Even though Kubernetes is moving away from Docker, it will always support the OCI and Docker image formats. Kubernetes doesn't pull and run...
Read more >
Don't Panic: Kubernetes and Docker
Kubernetes is deprecating Docker as a container runtime after v1.20. You do not need to panic. It's not as dramatic as it sounds....
Read more >
Dockerless, part 1: Which tools to replace Docker with and why
There is no Docker Compose replacement for Podman. There is a way to just run Kubernetes-compliant Pod YAMLs locally, but it's not mature...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found