-
Notifications
You must be signed in to change notification settings - Fork 1
JupyterLab
JupyterLab is a browser-based IDE for running Python and R programs in Jupyter NoteBook. PadoGrid provides the following commands for integrating PadoGrid workspaces with JupyterLab workspaces.
Command | Description |
---|---|
start_jupyter |
Start Jupyter Notebook server in the current RWE JupyterLab workspace |
open_jupyter |
Open the current RWE JupyterLab workspace |
show_jupyter |
Display Jupyter Notebook server status |
stop_jupyter |
Stop Jupyter Notebook server |
To install JupyterLab, please follow the instructions provided in the following link.
You can verify the installation by running the jupyter
executable. The PadoGrid Jupyter commands will fail if the jupyter
executable is not found.
If you are running PadoGrid locally on your PC, then you can run open_jupyer
to open JupyterLab in the browser. This command starts the JupyterLab server if it is not running and then launches the browser with PadoGrid integrated. The screen will look similar to the example shown below. The browser display is divided with the workspace's README.md
file if exists and three (3) terminals.
# Start Jupyter server on the default port 8888 if it's not running and then launch browser
open_jupyter
# Start Jupyter server on the specified port and then launch browser
open_jupyter -port 8889
Example Output:
Saved workspace: /Users/dpark/.jupyter/lab/workspaces/labworkspacesrwe-bundles-5382.jupyterlab-workspace
Notebook server started.
http://localhost:8888/lab/workspaces/rwe-bundles
You can use start_jupyter
to launch the Jupyter Notebook server without opening the browser. This command is useful if your workspace is remotely distributed and you are not able to launch the browser from there. Once the Jupyter Notebook server is started using this command, you can launch the browser from your local machine and enter the Jupyter Notebook server URL in the browser to remotely access the PadoGrid workspace.
# Start Jupyter Notebook server on the default port 8888
start_jupyter
# Start Jupyter Notebook server on the specified port
start_jupyter -port 8889
Example Output:
Notebook server started.
http://localhost:8888/lab/workspaces/rwe-bundles
The workspace in the Jupyter terminals may be incorrect due to JupyterLab limitations. Switch
into the current workspace by running the following command in each Jupyter terminal.
switch_rwe rwe-bundles/bundle-hazelcast-4-k8s-cdc_demo
✏️ The open_jupyter
command opens each terminal in the current workspace directory but the workspace context is set by the login shell script, i.e., .bashrc
or .bash_profile
. You must explicitly run the switch_rwe
command in each terminal to switch into the current workspace as described in the open_jupyter
output. You can copy/paste the command output in each Jupyter terminal.
The Jupyter Notebook server URL can be obtained by running show_jupyter
which displays all running servers with their URL information.
# Display running servers
show_jupyter
Example Output:
Currently running servers:
http://localhost:8888/?token=f169c6368999c83df5179fdece046d136040668e1204af21 :: /Users/dpark/Padogrid/workspaces/rwe-bundles
You can stop a specific Jupyter Notebook server or all servers with stop_jupyter
.
# Stop the server running on the default port 8888
stop_jupyter
# Stop the server running on the specified port
stop_jupyter -port 8889
# Stop all servers
stop_jupyter -all
Example Output:
Jupyter notebook server stopped: [8888]
You can install JupyterLab on any of PadoGrid installed EC2 instances and remotely manage PadoGrid using your browser. Once you have created a VM workspace with AWS EC2 instances as described in Geode on AWS EC2 and Hazelcast on AWS EC2, follow the instructions below to install and run JupyterLab.
# ssh into one of the EC2 instances
cd_workspace
ssh -i mykey.pem ec2-user@3.19.14.241
From the EC2 instance install JupyterLab:
# Amazon Linux, Red Hat
sudo yum install python3-pip
# Amazon Linux, Red Hat
sudo apt install python3-pip
pip3 install jupyterlab
Create a self-signed certificate to be used for SSL.
switch_workspace myworkspace
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout .mycert.pem -out .mycert.pem
chmod 400 .mycert.pem
Encrypt password that you will be using in the browser to login to JupyterLab.
ipython
from IPython.lib import passwd
passwd()
quit()
Output:
Python 3.9.7 (default, Sep 16 2021, 08:50:36)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.29.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from IPython.lib import passwd
In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'sha1:75f4df39063f:a7f26527cfb94b5fafba0e11d380b065ea5791b6'
In [3]: quit()
Generate and update a Jupyter server config file. Use the encrypted password for c.ServerApp.password
as shown below.
jupyter server --generate-config
cat <<EOF >> ~/.jupyter/jupyter_server_config.py
c = get_config()
c.ServerApp.certfile = u'/home/ec2-user/Padogrid/workspaces/rwe-hazelcast/ws-aws-hazelcast/.mycert.pem'
c.ServerApp.ip = '*'
c.ServerApp.password = u'sha1:75f4df39063f:a7f26527cfb94b5fafba0e11d380b065ea5791b6'
c.ServerApp.port = 8888
EOF
Start JupyterLab
# The '-import' option is introduced in PadoGrid v0.9.21 to import workspace
# templates. If this option is not specified then the initial web page defaults
# to a blank page.
start_jupyter -import
Use the public IP address of the EC2 instance to login from your browser. For our example, the public IP address is the IP address we used to ssh into the EC2 instance, i.e., 3.19.14.241
.
- Create a pod with enough memory for the primary node. This example allocates 4 GiB on the
ubuntu/focal64
Vagrant box, which has the latest Python3 version installed.
create_pod -quiet -box ubuntu/focal64 -avahi -pod mypod -pm 4096 -dir /Users/dpark/Padogrid/products/linux
-
Install Linux products such as Java, GemFire, Hazelcast, Redis, etc. in
/Users/dpark/Padogrid/products
. You can download and untar them in that directory. -
Build pod
switch_pod mypod
build_pod
- Install
pip
ssh
into pnode.local
.
ssh vagrant@pnode.local
From pnode.local
, install pip
.
sudo apt install python3-pip
- Install JupyterLab
✏️ JupyterLab requires jinja2>=3.0.3
.
pip install jinja2==3.1.2
pip install jupyterlab
- Start JupyterLab
# Specify '-import' to import the PadoGrid workspace datashboard
start_jupyter -import
- Enter the URL in the browser
URL: http://pnode-local:8888/lab/workspaces/rwe-bundles
PadoGrid Manual
Overview
- Home
- PadoGrid in 5 Minutes
- Quick Start
- Introduction
- Bundle Catalogs
- Building PadoGrid
- Supported Data Grid Products and Downloads
- PadoGrid Components
- Installing PadoGrid
- Root Workspaces Environments (RWEs)
- Initializing PadoGrid
- Bash Auto-Completion
- Viewing PadoGrid Summaries
- Updating Products
- Upgrading PadoGrid
- Migrating Workspaces
- PadoGrid Pods
- Kubernetes
- Docker
- Apps
- Software List
Operations
- Workspace Lifecycle Management
- Creating RWE
- Creating Workspace and Starting Cluster
- Managing Workspaces
- Understanding Workspaces
- Understanding Clusters
- Running Clusters
- Default Port Numbers
- Running Clusters Independent of PadoGrid
- Running Apps
- Understanding Groups
- Running Groups
- Understanding Bundles
- User Bundle Repos
- Using Bundle Templates
- Bundle Repo Guidelines
- User Bundle Catalogs
- Private Bundle Repos
- Gitea Repos
- Running Bundles in Container
- PadoGrid Addon Jars
- Understanding PadoGrid Pods
- Tested Vagrant Boxes
- VM-Enabled Pods
- Multitenancy
- Multitenancy Best Practices
- PadoGrid Configuration Files
Tools
Platforms
Clouds
Pado
Geode/GemFire
- Geode CLASSPATH
- Geode Kubernetes
- Geode Minikube
- Geode Minikube on WSL
- Geode Docker Compose
- Geode Grafana App
- Geode
perf_test
App - Geode WAN Example
- Geode Workspaces on VMs
- Geode on AWS EC2
- Reactivating Geode Workspaces on AWS EC2
Hazelcast/Jet
- Hazelcast CLASSPATH
- Creating Jet Workspace
- Configuring Hazelcast Addon
- HQL Query
- Hazelcast Kubernetes
- Hazelcast GKE
- Hazelcast Minikube
- Hazelcast Minikube on WSL
- Hazelcast Minishift/CDK
- Hazelcast OpenShift
- Hazelcast Docker Compose
- Hazelcast Desktop App
- Hazelcast Grafana App
- Hazelcast
jet_demo
App - Hazelcast
perf_test
App - Hazelcast WAN Example
- Hazelcast Workspaces on VMs
- Hazelcast on AWS EC2
- Reactivating Hazelcast Workspaces on AWS EC2
ComputeDB/SnappyData
Coherence
Hadoop
Kafka/Confluent
Mosquitto
- Mosquitto CLASSPATH
- Mosquitto Overview
- Installing/Building Mosquitto
- Clustering MQTT
- Cluster Archetypes
- Enabling Mosquitto SSL/TLS
- Mosquitto Docker Compose
- MQTT perf_test App
Redis
Spark