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

Support different container registry to push and pull #1904

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

rgaiacs
Copy link
Contributor

@rgaiacs rgaiacs commented Jan 6, 2025

This covers #1903.

@rgaiacs rgaiacs self-assigned this Jan 6, 2025
@rgaiacs rgaiacs changed the title WIP: Support different container registry to push and pull Support different container registry to push and pull Jan 14, 2025
@rgaiacs
Copy link
Contributor Author

rgaiacs commented Jan 14, 2025

When I run locally and request a launch for https://github.com/binder-examples/requirements, the output was

Waiting for build to start...
Picked Git content provider.
Cloning into '/tmp/repo2dockersul_16w8'...
HEAD is now at 50533eb Merge pull request #21 from minrk/default-branch
Building conda environment for python=3.10
Using PythonBuildPack builder
Step 1/50 : FROM docker.io/library/buildpack-deps:jammy
 ---> 9c6387be7092
...
Step 50/50 : CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]
 ---> Running in ee6ff4f7fcc2
 ---> Removed intermediate container ee6ff4f7fcc2
 ---> 6a38d51aece6
{"aux": {"ID": "sha256:6a38d51aece6f13a0a23116b2b4050ddd094a00a87eea438317bc298af4d5800"}}Successfully built 6a38d51aece6
Successfully tagged gesiscss/binder-binder-2dexamples-2drequirements-55ab5c:50533eb470ee6c24e872043d30b2fee463d6943f
Exception ignored in: <function Application.__del__ at 0x7fad6b188900>
Traceback (most recent call last):
  File "/opt/venv/lib/python3.11/site-packages/traitlets/config/application.py", line 1065, in __del__
  File "/opt/venv/lib/python3.11/site-packages/traitlets/config/application.py", line 1054, in close_handlers
  File "/opt/venv/lib/python3.11/site-packages/traitlets/traitlets.py", line 687, in __get__
  File "/opt/venv/lib/python3.11/site-packages/traitlets/traitlets.py", line 666, in get
TypeError: 'NoneType' object is not callable
Built image, launching...
Launching server...
Launch attempt 1 failed, retrying...
Launch attempt 2 failed, retrying...
Launch attempt 3 failed, retrying...
Failed to create temporary user for gesiscss/binder-binder-2dexamples-2drequirements-55ab5c:50533eb470ee6c24e872043d30b2fee463d6943f

There are a minor error related with traitlets. We should catch it during code review.

The launch attempt fail because I was not running Jupyter Hub locally.

@rgaiacs rgaiacs requested review from minrk and manics January 14, 2025 14:23
Copy link
Member

@manics manics left a comment

Choose a reason for hiding this comment

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

My initial thoughts are that most BinderHubs will use the same prefix for push and pull, so how about just have image_prefix as the default property as at present, and maybe add just one new property, image_prefix_pull?

I think it's fine to keep using the *_push and *_pull variables in builder.py if you want though, for clarity.

binderhub/app.py Outdated
@@ -443,6 +443,42 @@ def _pod_quota_deprecated(self, change):
config=True,
)

image_prefix_push = Unicode(
help="""
Prefix for built docker images push to container registry.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Prefix for built docker images push to container registry.
Prefix for built docker images being pushed to the container registry.

binderhub/app.py Outdated

image_prefix_pull = Unicode(
help="""
Prefix for built docker images pull from container registry.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Prefix for built docker images pull from container registry.
Prefix for built docker images being pulled from container registry.

@rgaiacs
Copy link
Contributor Author

rgaiacs commented Jan 15, 2025

My initial thoughts are that most BinderHubs will use the same prefix for push and pull

You are absolutely right. I think that 99% of BinderHubs will use a single registry. But there will be the 1% like GESIS that want to push to Docker Hub or GitHub Packages Registry and pull from a local Harbor that operates as proxy cache.

so how about just have image_prefix as the default property as at present, and maybe add just one new property, image_prefix_pull?

image_prefix is use as the default property, see https://github.com/rgaiacs/binderhub/blob/c322eabfdd78574e6b2ea03863f04ad4593060d7/binderhub/app.py#L460-L462 and https://github.com/rgaiacs/binderhub/blob/c322eabfdd78574e6b2ea03863f04ad4593060d7/binderhub/app.py#L478-L480. No change required to existing deployments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants