Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

manics
Copy link
Member

@manics manics commented Nov 7, 2023

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 jupyterhub/repo2docker#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:

This enables KubernetesBuildExecutor to be subclassed and used with other builders such as Kaniko which doesn't need a host socket
binderhub/build.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@yuvipanda yuvipanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one suggestion, but otherwise lgtm

binderhub/build.py Outdated Show resolved Hide resolved
@manics
Copy link
Member Author

manics commented Nov 8, 2023

Done, thanks for reviewing!

@yuvipanda yuvipanda merged commit e7995d6 into jupyterhub:main Nov 8, 2023
11 checks passed
@yuvipanda
Copy link
Collaborator

yw!

@manics manics deleted the docker-socket-optional branch November 8, 2023 18:02
consideRatio pushed a commit to jupyterhub/helm-chart that referenced this pull request Nov 8, 2023
jupyterhub/binderhub#1795 Merge pull request #1795 from manics/docker-socket-optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants