Leverage the power of Digital Ocean droplets to deploy a Jupyter Notebook IDE with Jupyter AI in minutes! Whether you’re using Jupyter Lab for data science or machine learning tasks, use this marketplace app to set up a powerful experimentation environment without the hassle of manual installation.
Package | Version | License |
---|---|---|
JupyterLab + Jupyter | 4.2.4 | BSD-3-Clause License |
Anaconda | 2024.06-1 | Non-Commercial Use Only |
Click the Deploy to DigitalOcean button to create a Droplet based on this 1-Click App. If you aren’t logged in, this link will prompt you to log in with your DigitalOcean account.
In addition to creating a Droplet from the Jupyter Notebook 1-Click App using the control panel, you can also use the DigitalOcean API. As an example, to create a 4GB Jupyter Notebook Droplet in the SFO2 region, you can use the following curl
command. You need to either save your API access token) to an environment variable or substitute it in the command below.
curl -X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer '$TOKEN'' -d \
'{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image": "sharklabs-jupyternotebook"}' \
"https://api.digitalocean.com/v2/droplets"
JupyterLab is an interactive development environment for working with notebooks, code, and data. It offers a flexible and powerful interface for data science and scientific computing, allowing you to create and share documents that contain live code, equations, visualizations, and narrative text.
Jupyter AI extends JupyterLab with capabilities for integrating machine learning and artificial intelligence workflows. It provides tools and extensions to leverage AI models directly within the Jupyter environment, making it easier to incorporate AI into your data science tasks.
Consider the following to ensure you choose the right configuration for your needs:
Access the Droplet Console:
root
user using the password you set during droplet creation.root
:ssh root@your_droplet_public_IP
+ Ensure your SSH key is added to the SSH agent, or specify the key file directly:
ssh -i /path/to/your/private_key root@your_droplet_public_IP
+ Once connected, you will be logged in as the root user without needing a password.
Login via SSH (Method 2: Using Password):
root
:ssh root@your_droplet_public_IP
* When prompted, enter the password you set during droplet creation.- This will log you into the droplet as the root user.
Check the Message of the Day (MOTD) for Jupyter Access Token:
Access the Jupyter Lab IDE:
http://your_droplet_public_IP
.Enter the Jupyter Lab Access Token:
Start Using Jupyter Lab:
Switch to the Anaconda user:
su - anaconda
Checking Your Conda Installation:
/home/anaconda/anaconda3/bin/conda init
* This command will set up the necessary configuration in the ~/.bashrc file. You may need to source ~/.bashrc or exit and run su - anaconda again.
Creating and Managing Conda Environments:- Use Conda to create isolated environments for your projects.
To create a new Conda environment, use:conda create --name myenv
Activate the environment by running:conda activate myenv
Install required packages and libraries within the environment using Conda or pip.
For more detailed instructions and tips on using Conda and Jupyter, refer to the Conda documentation: https://docs.conda.io/
- Jupyter Notebook is installed under the jupyter environment. You can manage the jupyter-notebook.service provided.
- To check the status of the service, run the following:
sudo systemctl status jupyter-notebook
If you want to run Jupyter Notebook instead of JupyterLab, you can manually enter the Jupyter virtual environment by running conda activate jupyter.
The droplet already starts up an instance of the Jupyter Notebook on boot. If you need multiple instances, you’ll have to run them up manually by providing port number to have different instances listening on different ports.
conda activate jupyter
jupyter lab
To leverage Jupyter AI in your projects, follow these steps:
Install Jupyter AI extensions:
conda activate jupyter
jupyter labextension install @jupyterlab/google-drive
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install @jupyterlab/git
Configure Jupyter AI:
Using AI Models:
from keras.models import load_model
model = load_model('path_to_model.h5')
result = model.predict(your_input_data)
Exploring AI Capabilities:
Note: If you have small compute, skip this and go to Example 2. Running this on <16 vCPU may cause the process to be killed.
To run the “stable diffusion 1.5” model, ensure your Droplet meets the following specifications:
Commands:
su - anaconda
cd examples/stable\_diffusion.openvino/
conda activate stable-diffusion-1.5
python demo.py --prompt "Beautiful lake, sunset, and a mountain"
The output is stored in output.png
. If connected to Jupyter notebook, you should be able to view the file in the notebook itself.
This tutorial guides you through running the DistilBERT sequence classification in a JupyterLab environment.
Navigating to the Notebook:
/home/anaconda/examples/openvino_notebooks/notebooks/229-distilbert-sequence-classification
229-distilbert-sequence-classification.ipynb
notebook.Selecting the Kernel:
Running the Notebook:
Note: If you encounter the “mo command not found” error, replace mo
with its full path: /home/anaconda/.conda/envs/openvino_notebooks/bin/mo
.
If you encounter issues, refer to the following resources:
save-9GB-by-deleting-examples
file in the /home/anaconda
directory.
/home/anaconda/anaconda3/bin/conda init
sudo systemctl status jupyter-notebook
Refer to the Conda cheat sheet for a list of commands: Conda Cheat Sheet
Inspect the source Packer files of this image at: DigitalOcean Droplet 1-Clicks GitHub