Students have access to an online version of Jupyterhub if they have an NDA DUC. All students and others can get the same environment locally via docker, including the ability to use singularity within the docker container. For installing docker see Docker Desktop overview | Docker Documentation.
mkdir -p abcd-repronim
docker run -it --rm --privileged -p 8888:8888 -v $(pwd)/abcd-repronim:/home/jovyan \
satra/abcd-repronim:<tag> start.sh jupyter lab
- Note that the specific tag
<tag>
will change throughout the course as we update the container. The<tag>
in use will be updated here with the variablesingleuser_image_tag
: https://github.com/ABCD-ReproNim/reprohub/blob/reprohub/dandi-info/group_vars/all#L13 - When this initializes you will notice an output that ends with
http://127.0.0.1:8888/?token=43ea5391332129e84e6e87566089c88e429afe20a62d15fe
(the token will be different each time you start). Paste this in your browser to access jupyterlab. This is the same interface that we are using in the online version. - Once you are done, you can hit
Ctrl+C
in the terminal and theny
for yes to close down the session. if you have mounted the directory in the docker command and saved notebooks and files in the lab, your information will be preserved. - The
abcd-repronim
directory will be mounted inside and will preserve any changes you make in your home directory. The above command uses the full path. This is necessary. - The
--privileged
flag is necessary if you want to run singularity inside the container.
Linux specific issue
The user inside the docker container is jovyan
(userid 1000). Thus this user is unable to write to the home directory since that linux directory has a different outside user id. One way to avoid this issue is to allow anyone to write to that directory.
mkdir test
chmod 700 test
mkdir test/home
chmod 777 test/home
docker ... -v $(pwd)/test/home:/home/jovyan ...
note the above command makes the first local directory inaccessible to group or others and makes the internal directory open to everyone. thus if you are on a shared system you will want to be very careful about who can see that path.
On a shared system with docker, please ensure that no one knows the full path. instead of calling the directory test
you could use a uuid to minimize guessing.
On a personal machine this is not an issue if you are the only user.
Once you run the above command the files and directories created inside test/home
will belong to some arbitrary user with uid:gid === 1000:1000
. unless you can become that user or have root privileges on the system you will not be able to edit or delete the test/home
directory. you will have to use the docker container and mount the parent directory (i.e. test
) to some location (e.g. /outside_test
) to be able to delete the contents.