JupyterHub Apps
Project description
JupyterHub Apps Launcher
JupyterHub Apps Launcher is a generalized server launcher. The goal of this project is to support launching anything like say a Flask Server, FastAPI server or a Panel Dashboard via a user supplied command. Currently, the following frameworks are supported:
- Panel
- Bokeh
- Streamlit
- Plotly Dash
- Voila
- Gradio
- JupyterLab
- Generic Python Command
Installation
pip install jhub-apps
or via conda
conda install -c conda-forge jhub-apps
Development Installation
Install Dependencies
conda env create -f environment-dev.yml
conda activate jhub-apps-dev
pip install -e .
To develop the React UI frontend, also run:
cd ui
npm install
cd -
Starting JupyterHub
Set the following environment variable:
export JHUB_APP_JWT_SECRET_KEY=$(openssl rand -hex 32)
Start JupyterHub:
jupyterhub -f jupyterhub_config.py
Now go to http://127.0.0.1:8000/hub/home to access JHub Apps Launcher
API Endpoints
The Hub service is exposed via FastAPI endpoints. The documentation for the same can be accessed at: http://127.0.0.1:10202/services/japps/docs
To try out authenticated endpoints click on the Authorize button on the top right of
the above url and chose OAuth2AuthorizationCodeBearer
and click on Authorize.
Developing Locally
Note: In order to develop locally, both the JupyterHub backend and React UI frontend should be running.
- To start the JupyterHub Backend, run the following in a terminal:
jupyterhub -f jupyterhub_config.py
- To start the React UI frontend, run the following in a separate terminal from the
ui
directory:
npm run watch
Running Tests
Unit Tests
pytest jhub_apps/tests
E2E Tests
pytest jhub_apps/tests_e2e -vvv -s --headed
Usage
JHub Apps has been tested with local JupyterHub using SimpleLocalProcessSpawner
and with
The Littlest JupyterHub using SystemdSpawner
.
- Install JHub Apps
pip install git+https://github.com/nebari-dev/jhub-apps.git
- Add the following in The Littlest JupyterHub's
jupyterhub_config.py
from tljh.user_creating_spawner import UserCreatingSpawner
from jhub_apps.configuration import install_jhub_apps
c.JupyterHub.bind_url = "<YOUR_JUPYTERHUB_URL>"
c.SystemdSpawner.unit_name_template = 'jupyter-{USERNAME}{JHUBSERVERNAME}'
c.JAppsConfig.apps_auth_type = "oauth" # or none (if you don't want authentication on apps)
c.JAppsConfig.python_exec = "python3"
# Pass in the path to jupyterhub config
c.JAppsConfig.jupyterhub_config_path = "jupyterhub_config.py"
# Either a static list of conda environments to show in the
# create panel apps form or a callable to fetch conda enviornments
# dynamically, e.g. from conda-store API
c.JAppsConfig.conda_envs = []
c = install_jhub_apps(c, UserCreatingSpawner)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file jhub_apps-2024.10.1rc1.tar.gz
.
File metadata
- Download URL: jhub_apps-2024.10.1rc1.tar.gz
- Upload date:
- Size: 13.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c308ca1f06d5371a85f360033c0d3afe2a08f9c70696ce3c507c7a64aa48d1c |
|
MD5 | 4b3e8cf4094e119319f488567dc1b495 |
|
BLAKE2b-256 | 0b3754e35150a08cfaf8a0a2adc1f55881bff3cec91233133bee6af0571e4c5f |
File details
Details for the file jhub_apps-2024.10.1rc1-py3-none-any.whl
.
File metadata
- Download URL: jhub_apps-2024.10.1rc1-py3-none-any.whl
- Upload date:
- Size: 3.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5396c777d232d4de8d1ce06bc9b74ea9678dc3b31bbc3ea902e816cf837cd39 |
|
MD5 | 5639b6ac1fc975bc530648ee33e529c0 |
|
BLAKE2b-256 | c03940a3b963d97f7ed40da97e64262b0ffd196c53deaea442b6f5456dbdf601 |