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.57k stars 390 forks source link

Make docker-socket optional, build volumes can be overridden #1795

Closed manics closed 1 year ago

manics commented 1 year ago

This enables KubernetesBuildExecutor to be subclassed and used with other builders such as Kaniko which doesn't need an mounted host socket.

With this BinderHub change it should be possible to use Kaniko using just the traitlets config using something like the following, instead of overriding the KubernetesBuildExecutor as suggested in https://github.com/jupyterhub/repo2docker/issues/560:

config:
  BinderHub:
    ....
  KubernetesBuildExecutor:
    docker_host:
    build_image: "ghcr.io/manics/repo2kaniko@sha256:9b2ef803c4c089f40643e2f40d58d0c697b5bdbed16482f7f1fceb3a525355fe"
  BuildExecutor:
    repo2docker_extra_args:
      - --engine=kaniko
      - --debug
      - --KanikoEngine.cache_registry=cache-registry-docker-registry:5000/cache
      - --KanikoEngine.cache_registry_credentials=username=user
      - --KanikoEngine.cache_registry_credentials=password=password
      - --KanikoEngine.cache_registry_insecure=true

I've made the volumes into an overridable method so that additional volumes could be added by subclasses.

Related:

manics commented 1 year ago

Done, thanks for reviewing!

yuvipanda commented 1 year ago

yw!