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

Cannot use with Podman when short-name resolution is enforced #1146

Closed
Christopher-Chianelli opened this issue Mar 23, 2022 · 4 comments · Fixed by #909
Closed

Cannot use with Podman when short-name resolution is enforced #1146

Christopher-Chianelli opened this issue Mar 23, 2022 · 4 comments · Fixed by #909

Comments

@Christopher-Chianelli
Copy link

Bug description

When using the podman engine (with https://pypi.org/project/repo2podman/), an exception occurs when the base image is retrieved:

STEP 1/52: FROM buildpack-deps:bionic
Error: error creating build container: short-name resolution enforced but cannot prompt without a TTY

This is caused by this line:

FROM buildpack-deps:bionic

Because the base image uses a short name (i.e. does not state what repository it is from), it will search the registries in the registries.conf file (see https://www.redhat.com/sysadmin/container-image-short-names ). Because the user cannot be prompted to select the registry to pull from, it fails (since short-name resolution is set to enforced).

Expected behaviour

jupyter-repo2docker --engine podman . would launch a Jupyter notebook sucessfully.

Actual behaviour

jupyter-repo2docker --engine podman .
Picked Local content provider.
Using local repo ..
Using PythonBuildPack builder
STEP 1/52: FROM buildpack-deps:bionic
Error: error creating build container: short-name resolution enforced but cannot prompt without a TTY
Traceback (most recent call last):
  File ".../bin/jupyter-repo2docker", line 8, in <module>
    sys.exit(main())
  File ".../python3.10/site-packages/repo2docker/__main__.py", line 418, in main
    r2d.start()
  File ".../python3.10/site-packages/repo2docker/app.py", line 830, in start
    self.build()
  File ".../python3.10/site-packages/repo2docker/app.py", line 801, in build
    for l in picked_buildpack.build(
  File ".../python3.10/site-packages/repo2docker/buildpacks/base.py", line 614, in build
    for line in client.build(**build_kwargs):
  File ".../python3.10/site-packages/repo2podman/podman.py", line 385, in build
    for line in exec_podman_stream(cmdargs + [builddir]):
  File ".../python3.10/site-packages/repo2podman/podman.py", line 205, in exec_podman_stream
    yield from p
  File ".../python3.10/site-packages/repo2podman/podman.py", line 148, in execute_cmd
    raise CalledProcessError(proc.returncode, cmd)
subprocess.CalledProcessError: Command '['podman', 'build', '--build-arg', 'NB_USER=...', '--build-arg', 'NB_UID=1000', '--force-rm', '--rm', '--tag', 'r2d-2e1648064885', '...']' returned non-zero exit status 125.

How to reproduce

  1. Git clone https://github.com/optapy/optapy-quickstarts
  2. Create a venv python -m venv venv
  3. Activate the venv . venv/bin/activate
  4. pip install jupyter-repo2docker repo2podman
  5. jupyter-repo2docker --engine podman .
  6. See error

Your personal set up

  • OS: Fedora 35
  • Podman version: podman version 3.4.4
  • repo2docker version 2022.02.0

Possible Fixes

. Provide an option to state what registry to pull from (which will be inserted into the Dockerfile string)
. Change the FROM line to FROM docker.io/buildpack-deps:bionic

@welcome
Copy link

welcome bot commented Mar 23, 2022

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@Christopher-Chianelli
Copy link
Author

(This cannot be fixed in repo2podman, since the Dockerfile comes from repo2docker, hence why the issue was created here)

@manics
Copy link
Member

manics commented Mar 23, 2022

Good point! buildpack-deps:bionic implicitly means docker.io/library/buildpack-deps:bionic so I think using the full name is reasonable.

The only people it'd affect are those who have a locally tagged buildpack-deps:bionic image which is different from the upstream one. However this isn't supported- there's a separate long discussion over whether the base-image should be configurable or not #487

@betatim @yuvipanda @minrk are you aware of any installations that would break if we use the full image name docker.io/library/buildpack-deps:bionic?

@yuvipanda
Copy link
Collaborator

Nah let's do it!

manics added a commit to manics/repo2docker that referenced this issue Jul 24, 2022
Non-default engines may require the full path including registry

Closes jupyterhub#1146
yuvipanda added a commit to yuvipanda/repo2docker that referenced this issue Jul 26, 2022
Fixes jupyterhub#1146

Co-authored-by: Simon Li <orpheus+devel@gmail.com>
yuvipanda added a commit to yuvipanda/repo2docker that referenced this issue Oct 8, 2022
Fixes jupyterhub#1146

Co-authored-by: Simon Li <orpheus+devel@gmail.com>
yuvipanda added a commit to yuvipanda/repo2docker that referenced this issue Dec 10, 2022
Fixes jupyterhub#1146

Co-authored-by: Simon Li <orpheus+devel@gmail.com>
@manics manics linked a pull request Apr 26, 2023 that will close this issue
1 task
@minrk minrk closed this as completed in #909 Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment