aiidalab / aiidalab-docker-stack

Docker images with the basic software stack for AiiDAlab
https://aiidalab.net
Other
9 stars 14 forks source link

bashrc disappear in the k8s deployment #347

Closed unkcpz closed 1 year ago

unkcpz commented 1 year ago

In the THEOS deployment, it is weird that the .bashrc is not there after the server start. @danielhollas do you have the same issue in your development? Luckily most of the things work fine, just the verdi completion is not working at the moment since the base conda environment is not activated.

danielhollas commented 1 year ago

I haven't seen this issue, but I am only using aiidalab-launch

unkcpz commented 1 year ago

Yes, the aiidalab-launch has no issue.

unkcpz commented 1 year ago

I think I find the catch of this issue. Running the container locally by docker run or using aiidalab-launch will start the container by start-notebook.sh, while starting container each user by spawned from jupyterhub on k8s and ansible deployment the container is started by start-singleuser.sh. The difference can be find:

This explains the issues I and @yakutovicha encountered that the environment variable DOCKER_STACKS_JUPYTER_CMD set in the lab stack didn't take effect. I need more investigation where the bash profile is set or wiped.

unkcpz commented 1 year ago

Here is a relevant discussion how to properly using start-singleuser.sh. https://github.com/jupyter/docker-stacks/issues/1528, and a dedicate issue open at https://github.com/jupyter/docker-stacks/issues/1848

unkcpz commented 1 year ago

I did some investigation and think the problem caused from that the k8s deployment (also the ansible deployment) where the home is mounted after the spawner will wipe the configurations setted such as the .bashrc and .vimrc. It mentioned in the issue https://github.com/jupyter/docker-stacks/issues/815#issuecomment-478363912.

This means in our docker stack we need to avoid modifying the ~/.bashrc directly but /etc/skel/bashrc and copy it to ~/.bashrc afterward in before-notebook.d.