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

when building a non-Dockerfile x86 image on apple silicon (M1, M2, M2 Pro),repo2docker fails on mamba env update #1352

Open
shaneknapp opened this issue May 29, 2024 · 1 comment

Comments

@shaneknapp
Copy link

Bug description

repo2docker fails when a non-Dockerfile build hits the following step:

Step 40/53 : RUN TIMEFORMAT='time: %3R' bash -c 'time ${MAMBA_EXE} env update -p ${NB_PYTHON_PREFIX} --file "environment.yml" && time ${MAMBA_EXE} clean --all -f -y && ${MAMBA_EXE} list -p ${NB_PYTHON_PREFIX} '
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 35f6725e11e1

CondaError: Error encountered while attempting to create cache directory.
  Directory: /home/sknapp/.cache/conda/notices
  Exception: [Errno 13] Permission denied: '/home/sknapp/.cache/conda'

time: 0.407

the commands i tried were:

  1. repo2docker --user-id 501 --no-run --Repo2Docker.platform=linux/amd64 --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy .
  2. repo2docker --no-run --Repo2Docker.platform=linux/amd64 --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy .
  3. repo2docker --user-id 1000 --no-run --Repo2Docker.platform=linux/amd64 --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy .

the image that failed to build: https://github.com/berkeley-dsep-infra/datahub/tree/staging/deployments/data100/image

however, if you build an image that's based on a Dockerfile, you're good to go! you can try yourself with this image: https://github.com/berkeley-dsep-infra/datahub/tree/staging/deployments/dev/images/default

it appears that repo2docker might not be inheriting or passing on the correct permissions to allow writing to the local filesystem during the mamba env update step.

Expected behaviour

i would expect mamba to be able to update the conda env. :)

Actual behaviour

it fails.

How to reproduce

  1. get a mac w/an M chip, and run repo2docker --user-id 1000 --no-run --Repo2Docker.platform=linux/amd64 --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy . on an image dir that doesn't have a Dockerfile
  2. fail!

Your personal set up

  • OS: OSX sonoma
  • Docker version: 26.1.1
  • repo2docker version: 2024.03.0
@felder
Copy link

felder commented Jun 11, 2024

I found a workaround for this by specifying --target-repo-dir like so:

jupyter-repo2docker --user-id=1000 --user-name=jovyan --Repo2Docker.platform=linux/amd64 --target-repo-dir=/home/jovyan/.cache .

Looking at issue #1334 my theory was this would create the necessary directory with the necessary perms, and it does!

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

No branches or pull requests

2 participants