Hi Jess, everyone
I've started the below as a simple and quick email... but then I wanted to provide the right error messages... and I've got into this long description of which stesp I tried.
TLDR; It works now so I probably was missing something - but I still don't know the right workflow on how to puppetise a machine where I won't have root access.
After trying different stuff I've found out some other things that may throw some light into the issues.
- The home directories, thought the authentication happens via LDAP is mounted by NFS. Additionaly, since a few days the NFS of the university have been having problems - I don't know whether that was affecting too.
- If the jupyterhub (via systemctl) starts with the formgrade service and the directory - `cwd` - doesn't exist then jupyterhub fails.
- if such directory is in the instructor home - then I get the permission denied I showed in the first email - `PermissionError: [Errno 13] Permission denied`
- if the directory is pointing to a place locally, then I get `FileNotFoundError: [Errno 2] No such file or directory: '/srv/nbgrader/myusers/WorldMusic'`
- if in the other hand the directory exists but it's empty - then the above happens again if in the instructor directory, but works if in the local directory. In that casein creates `gradebook.db` owned by root.
-rw-r--r-- 1 root root 128K May 4 12:04 gradebook.db
and formgrader shows as service no provider (sure, the directory doesn't contain the `nbgrader_config.py`)
adding the assignment with the config files and source and restarting jupyterhub, it works!!! Yay!!!! - formgrade service is shown!!
- With that working, then I go ahead with the next step: "assign" - this fails as the database is owned by root. If I change from root the owner to myuser, then assign works. However, I won't have access as root in the production machine.
Let's try to stop jupyterhub, remove the database, assign the course (so the database is created by the instructor) - that works too!! (you may not feel it in my writting, but I'm jumping of happiness in my office :))
So it's working now... but I have a little problem with the workflow to set up all this. The reason of why I'm trying with an empty directory is that this machine needs to be set up using puppet, so I'm trying to do it in a similar way than in
https://github.com/jupyterhub/jupyterhub-deploy-teaching/ - Having some kind of template yaml file for the instructors to write, then run puppet to create the services and start jupyterhub. The problem is that unless the course assigment has already been created (and a gradebook.db) exist in the right location, jupyterhub will create a db owned by root.
The only solution I've found, which it seems to work now is to create an empty file (`touch gradebook.db`), set the owner to the instructor, and start jupyterhub afterwards (which will write to the file). But then I need also the nbconfig_config so the server starts looking at the right place. If I add this then I don't know how to allow the instructors to update (add) new assignments to the course, without having to restart the jupyterhub (which only root can do so - jupyterhub admins can stop it, but I've not found a way to restart it).
The only way I can find to use it is to run formgrade locally in my machine, and keep the jupyterhub only with nbgrader. Suggestions, ideas or work arounds are very welcome.