jupyterhub / binderhub

Run your code in the cloud, with technology so advanced, it feels like magic!
https://binderhub.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.54k stars 388 forks source link

Use Traitlets for passing parameters to `Build` classes #1518

Closed manics closed 2 years ago

manics commented 2 years ago

BinderHub is slowly gaining the ability to move beyond running on Kubernetes with Docker.

This is the first step to make it possible to configure parameters specific to the underlying infrastructure (Kubernetes, Docker, Podman, Local, etc). I've tried to minimise the changes.

See:

The build.py changes look very large, but it's mostly rearranging the existing code:

builder.py now checks whether the BuildClass is the old existing Build or the newer BuildExecutor based classes. If it's the former the behaviour is unchanged. If it's the latter then parameters should be set using Traitlets in a config file or similar, the current BinderHub command-line args will be ignored.

For some reason switching to Traitlets surfaced a unset IOLoop.current(), so I've switched to avoiding tornado.ioloop.IOLoop.current()other than in the BinderHub initialization code. Instead the loop is passed as a parameter to theBuild*` classes. I can try and split it into a separate PR if you prefer but it'll end up conflicting here due to the refactoring.

This PR currently includes unmerged PR:

yuvipanda commented 2 years ago

Omg so excited for this!!!!!

manics commented 2 years ago

Thanks for reviewing! I've rebased this PR onto master.

consideRatio commented 2 years ago

@minrk wdyt, merge?

minrk commented 2 years ago

Wonderful!