Skip to content

Commit

Permalink
Support provisioned storage with incorrect permissions
Browse files Browse the repository at this point in the history
I ran into an issue when trying to get this to work with a NFS server which I did not have direct control over (EFS).  As part of the PersistentVolumeClaim, there is no easy way to set the UID and GID of the created directory.on the networked FS.

My only concern with this chown is that some user out there might be running jupyterhub in an odd configuration where $NB_USER is not supposed to have these exact permissions on the storage.  I think this is quite unlikely, but it is worth mentioning. 

I chronicled my experiences with working around this issue and setting up z2jh on EFS in jupyterhub/zero-to-jupyterhub-k8s#421 with @yuvipanda.
  • Loading branch information
cam72cam authored Jan 31, 2018
1 parent 27ba573 commit b4d2d6f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base-notebook/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ if [ $(id -u) == 0 ] ; then
# Handle username change. Since this is cheap, do this unconditionally
echo "Set username to: $NB_USER"
usermod -d /home/$NB_USER -l $NB_USER jovyan

# Handle case where provisioned storage does not have the correct permissions by default
# Ex: default NFS/EFS (no auto-uid/gid)
chown $NB_UID:$NB_GID /home/$NB_USER

# handle home and working directory if the username changed
if [[ "$NB_USER" != "jovyan" ]]; then
Expand Down

0 comments on commit b4d2d6f

Please sign in to comment.