Tutorial: Setting Up a Collaborative Jupyter Lab
This tutorial outlines the steps to set up a collaborative Jupyter Lab environment for multiple users. Make sure to follow each step carefully.
A. Initial Preparation
-
Create a Tmux Session:
-
Open your terminal and run the command:
tmux new -t your_session_name
(replace "your_session_name" with your desired name). -
What is Tmux?
-
It keeps your terminal session active even if the SSH connection is lost.
-
It allows you to access the terminal session from different locations.
-
-
Important Tmux commands:
-
To exit the session: Press
Ctrl+b
thend
. -
To re-enter the session:
tmux a -t your_session_name
.
-
-
For more information on tmux, visit: https://tmuxcheatsheet.com/
-
-
Create a Conda Environment:
-
Ask all users for the required Python version.
-
Create a conda environment with the command:
conda create -n your_env_name python=python_version
(replace "your_env_name" and "python_version" accordingly).-
Example:
conda create -n collaboration python=3.9
-
-
Activate the environment:
conda activate your_env_name
-
-
Create a Working Directory:
-
Create a new directory to store your collaborative project. You can use the initials of each team member or person (e.g., NF, MH, RDWP).
-
Command:
mkdir your_directory_name
-
Enter the directory:
cd your_directory_name
-
B. Installing and Configuring Jupyter Lab
-
Install Jupyter Lab and Jupyter-Collaboration:
-
Ensure that the conda environment you created earlier is active.
-
Install Jupyter Lab and Jupyter-Collaboration:
pip install jupyter jupyter-collaboration
-
Alternatively: Install them when creating the conda environment by adding
jupyter jupyter-collaboration
to the end of theconda create
command.
-
-
Run Collaborative Jupyter Lab:
-
Run the following command in the terminal:
jupyter lab --collaborative --allow-root --no-browser --ip=0.0.0.0 --port your_desired_port
-
Replace "your_desired_port" with the port number you want to use.
-
-
Save the Jupyter Token:
-
After running the command above, a link containing a token will appear.
-
IMPORTANT: Save this token securely. Other people can access your Jupyter Lab if they know this token.
-
C. Tunnel Configuration and Jupyter Lab Access
-
Provide Jupyter Lab Details:
-
Inform the tunnel administrator (in this case, Naufal Faza) of the following information:
-
The name of the PC where Jupyter Lab is running.
-
The port number used.
-
The requested subdomain (if any).
-
Example:
uas-ai.digilabdte.com
, the subdomain isuas-ai
.
-
-
-
Access Jupyter Lab:
-
After the tunnel administrator has completed the configuration, you will be given a link to access Jupyter Lab.
-
The link will look like this:
your_requested_subdomain.digilabdte.com/lab?token=your_token_value
. -
Don't forget to enter the token you obtained in step 6.
-
-
Start Collaborating:
-
Inside Jupyter Lab, you can access the terminal and monitor resource usage with
nvtop
. -
Make sure to coordinate with your team via group chat to avoid conflicts when running programs. Remember that Jupyter Lab is like Google Docs, so collaboration is real-time.
-
No comments to display
No comments to display