repo2docker-action icon indicating copy to clipboard operation
repo2docker-action copied to clipboard

Docker run tests defined in `image-tests` as root user

Open jnywong opened this issue 1 year ago • 5 comments

Fixes #110

jnywong avatar Mar 18 '24 10:03 jnywong

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Mar 18 '24 10:03 welcome[bot]

Hmm, not sure why this change broke all the CI/CD tests...

jnywong avatar Mar 18 '24 10:03 jnywong

The error is:

docker.errors.DockerException: invalid tag 'localhost:5000/repo2docker-test:43c232c553a9': invalid reference format

😕

sgibson91 avatar Mar 18 '24 16:03 sgibson91

@jnywong https://github.com/jupyterhub/repo2docker-action/pull/118 should fix the failing tests once merged.

yuvipanda avatar Mar 26 '24 00:03 yuvipanda

Hoorah the tests have passed 🎉

jnywong avatar Mar 26 '24 20:03 jnywong

We are running into this as well - anything we can do to help get this merged, @yuvipanda ?

cc @sunu

batpad avatar May 17 '24 11:05 batpad

Congrats on your first merged pull request in this project! :tada: congrats Thank you for contributing, we are very proud of you! :heart:

welcome[bot] avatar May 23 '24 15:05 welcome[bot]

Sorry for not commenting on this earlier, but I don't think this will fix it. My vague understanding is that this only happens when using Dockerfile, and in that case perhaps what's needed is a --chown for the COPY step. repo2docker does this automatically for non-Dockerfile uses, and we should probably document this for Dockerfile uses? I think @batpad did a little more investigation of this as well but it's not listed here.

I think running as root will break (or at least cause weird artifacts) for users that are using non-Dockerfile methods with repo2docker. For now, I'd like to revert this temporarily until we hear back from @batpad (or @sunu, who may have done the actual investigation). Sorry for not raising this earlier here :(

@jnywong @sgibson91 are you ok with reverting this?

yuvipanda avatar May 23 '24 17:05 yuvipanda

So sorry for the delay commenting here - was hoping @sunu who looked into this could explain a bit better, but he's out sick today :(

I see the fix was to add something like this to the Dockerfile:

# enable image-tests; workaround for https://github.com/jupyterhub/repo2docker-action/issues/110
RUN chown -R ${NB_USER}:${NB_USER} /srv/repo

USER ${NB_USER}

You can see the Dockerfile here: https://github.com/sunu/ghg-workshop-python-image/blob/main/Dockerfile

Speaking to Yuvi a bit about this, it seems like we it maybe better to add this to the documentation as something you need to do if writing your own Dockerfile?

Apologies again for not commenting here earlier with a link to our workaround / fix in the Dockerfile!

batpad avatar May 23 '24 17:05 batpad

Thanks @yuvipanda for your insight here, I trust that you know better and happy to help with documenting workarounds 👍

jnywong avatar May 23 '24 17:05 jnywong

@batpad @sunu I think if https://github.com/sunu/ghg-workshop-python-image/pull/1 passes tests, then we can add documentation to https://github.com/jupyterhub/repo2docker-action?tab=readme-ov-file#testing-the-built-image to the effect of:

  1. If you're using a Dockerfile, you need to copy image-tests into the docker image yourself
  2. You have to make sure the ownership of that is 'correct', and suggest using COPY --chown for that

yuvipanda avatar May 23 '24 18:05 yuvipanda