Introduction
Jupyter Notebooks In the Collaboratory
Jupyter notebooks are files in a format that allows you to store a narrative (text), code, and the output together. The Jupyter Notebook Server is a program which allows you to load the notebook file (with a .ipynb extension) on a web page in your browser and run the code. Jupyter Hub is a platform which allows you to do this remotely.
As part of the Collaboratory, we are running Jupyter Hub. You can access it at https://lab.ebrains.eu/. Once you log in, you are connected to a Jupyter Notebook Server running on the HBP resources. Everything you run in the notebook is executed on a server which we manage. It is integrated with the Collaboratory Drive so that you can access files and save them there.
Data, python environment and notebook persistence
Data and notebook persistence
When you run a Jupyter Notebook in the Lab, a private environment is created for you. When you run code, it will be executed in this environment. Other users cannot see what you are doing, or access the files there. When you do not interact with the notebook for 12 hours, your environment is stopped and destroyed. In order to persist documents across sessions, such as notebooks, configuration or data, you can use the Drive. You will find the drive folder in the home directory of your notebook server. Inside the drive directory, you will find four subdirectories:
My Libraries: these are libraries (folders) which you can manage. You can create or delete them, and share them with other users in the Drive.
Shared with me: these are libraries that have been shared directly with you by another user.
Shared with groups: these are libraries that belong to a Collab that you are a member of. This also includes libraries which users have shared directly with a group from Drive interface.
Shared with all: these are the libraries that belong to public Collabs, or that have been made public by the owner in the Drive interface.
Files you save in the Drive are persisted and can be accessed from the Drive.
Conda, Pip and virtual environments (Python)
When you install a package using pip or conda, it is installed in the current environment. By default, this is the global environment that the notebook server is running in. This will be reset when your environment is stopped after the 12 hours of inactivity. This will also affect other notebooks running in the same environment.