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

[BUG] start by singleuser doesn't has bashrc properly set in user folder #1848

Closed
unkcpz opened this issue Dec 16, 2022 · 2 comments
Closed
Labels
type:Bug A problem with the definition of one of the docker images maintained here

Comments

@unkcpz
Copy link

unkcpz commented Dec 16, 2022

What docker image(s) are you using?

minimal-notebook

OS system and architecture running docker image

Ubuntu 18.04 amd64

What Docker command are you running?

---
singleuser:
    image:
        name: "docker.io/jupyter/minimal-notebook"      
        tag: "python-3.9.13"
        pullPolicy: "Always"
    extraEnv:
        DOCKER_STACKS_JUPYTER_CMD: "notebook"
        #JUPYTERHUB_SINGLEUSER_APP: "notebook.notebookapp.NotebookApp"
    storage:
        dynamic:
            storageClass: aiidalab-storage
...

How to Reproduce the problem?

  1. open the container spawned (I use microk8s in my deployment).
  2. It is still running the lab mode, which I expect the notebook since I set DOCKER_STACKS_JUPYTER_CMD=notebook
  3. Also run ls -al, there is no .bashrc in the user home folder.

Command output

No response

Expected behavior

The entity start at notebook mode and the .bashrc setting is not being wiped out.

Actual behavior

It is all fine if I run the container without JUPYTHERHUB_API_TOKEN by docker run in my local machine. But spawn the user by spawner, the JUPYTERHUB_API_TOKEN will shift to start-singleuser.sh (as

if [[ -n "${JUPYTERHUB_API_TOKEN}" ]]; then
echo "WARNING: using start-singleuser.sh instead of start-notebook.sh to start a server associated with JupyterHub."
exec /usr/local/bin/start-singleuser.sh "$@"
fi
here indicated).

Is there anything run in my singleuser setting?

Anything else?

No response

@unkcpz unkcpz added the type:Bug A problem with the definition of one of the docker images maintained here label Dec 16, 2022
yuvipanda added a commit to yuvipanda/docker-stacks that referenced this issue Jul 5, 2023
This reads any .bashrc, .profile, etc files present in user
folders while starting. Matches what repo2docker does
in
https://github.com/jupyterhub/repo2docker/blob/b36a6a75f54bfb47903b68671e9e157305f92fa6/repo2docker/buildpacks/python3-login.

There is a specific downside here when used with JupyterHub -
users' broken .bashrc files may break these scripts from executing,
and hence prevent their servers from starting.

Fixes jupyter#1848
@mathbunnyru
Copy link
Member

Hi @unkcpz.
Sorry for the late response.

DOCKER_STACKS_JUPYTER_CMD is indeed only for non-jupyterhub.
You can use these docs to switch the command.
Hope this helps.
I also described this in our docs: https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#switching-back-to-the-classic-notebook-or-using-a-different-startup-command

.bashrc being wiped is a duplicate of the following issue (which has been with us for many years): #815

@mathbunnyru
Copy link
Member

I'm closing this issue (actually 2 issues) - there is a solution for the first issue and it's documented, and the second one is a duplicate.
Please, let me know, if I got something wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug A problem with the definition of one of the docker images maintained here
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants