jhub-apps


Namejhub-apps JSON
Version 2024.10.1 PyPI version JSON
download
home_pageNone
SummaryJupyterHub Apps
upload_time2024-10-25 16:43:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # JupyterHub Apps Launcher

[![Lint](https://github.com/nebari-dev/jhub-apps/actions/workflows/lint.yml/badge.svg)](https://github.com/nebari-dev/jhub-apps/actions/workflows/lint.yml)
[![Test](https://github.com/nebari-dev/jhub-apps/actions/workflows/test.yml/badge.svg)](https://github.com/nebari-dev/jhub-apps/actions/workflows/test.yml)

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:

- [x] Panel
- [x] Bokeh
- [x] Streamlit
- [x] Plotly Dash
- [x] Voila
- [x] Gradio
- [x] JupyterLab
- [x] Generic Python Command

![JHub Apps Demo](https://raw.githubusercontent.com/nebari-dev/jhub-apps/main/demo.gif)

## Installation

```
pip install jhub-apps
```

or via conda

```bash
conda install -c conda-forge jhub-apps
```

## Development Installation

### Install Dependencies

```bash
conda env create -f environment-dev.yml
conda activate jhub-apps-dev
pip install -e .
```

To develop the React UI frontend, also run:

```bash
cd ui
npm install
cd -
```

## Starting JupyterHub

Set the following environment variable:

```bash
export JHUB_APP_JWT_SECRET_KEY=$(openssl rand -hex 32)
```

Start JupyterHub:

```bash
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._

1. To start the JupyterHub Backend, run the following in a terminal:

```bash
jupyterhub -f jupyterhub_config.py
```

2. To start the React UI frontend, run the following in a separate terminal from the `ui` directory:

```bash
npm run watch
```

## Running Tests

### Unit Tests

```bash
pytest jhub_apps/tests
```

### E2E Tests

```bash
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

```python
pip install git+https://github.com/nebari-dev/jhub-apps.git
```

- Add the following in The Littlest JupyterHub's `jupyterhub_config.py`

```python
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)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "jhub-apps",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9c/77/ab2921e3b953418f73124c56a83163e693beff490f5cde75d5d8eed2affe/jhub_apps-2024.10.1.tar.gz",
    "platform": null,
    "description": "# JupyterHub Apps Launcher\n\n[![Lint](https://github.com/nebari-dev/jhub-apps/actions/workflows/lint.yml/badge.svg)](https://github.com/nebari-dev/jhub-apps/actions/workflows/lint.yml)\n[![Test](https://github.com/nebari-dev/jhub-apps/actions/workflows/test.yml/badge.svg)](https://github.com/nebari-dev/jhub-apps/actions/workflows/test.yml)\n\nJupyterHub Apps Launcher is a generalized server launcher. The goal of this project is to support\nlaunching anything like say a Flask Server, FastAPI server or a Panel Dashboard via a user supplied\ncommand. Currently, the following frameworks are supported:\n\n- [x] Panel\n- [x] Bokeh\n- [x] Streamlit\n- [x] Plotly Dash\n- [x] Voila\n- [x] Gradio\n- [x] JupyterLab\n- [x] Generic Python Command\n\n![JHub Apps Demo](https://raw.githubusercontent.com/nebari-dev/jhub-apps/main/demo.gif)\n\n## Installation\n\n```\npip install jhub-apps\n```\n\nor via conda\n\n```bash\nconda install -c conda-forge jhub-apps\n```\n\n## Development Installation\n\n### Install Dependencies\n\n```bash\nconda env create -f environment-dev.yml\nconda activate jhub-apps-dev\npip install -e .\n```\n\nTo develop the React UI frontend, also run:\n\n```bash\ncd ui\nnpm install\ncd -\n```\n\n## Starting JupyterHub\n\nSet the following environment variable:\n\n```bash\nexport JHUB_APP_JWT_SECRET_KEY=$(openssl rand -hex 32)\n```\n\nStart JupyterHub:\n\n```bash\njupyterhub -f jupyterhub_config.py\n```\n\nNow go to http://127.0.0.1:8000/hub/home to access JHub Apps Launcher\n\n## API Endpoints\n\nThe Hub service is exposed via FastAPI endpoints. The documentation for the same can be accessed at:\nhttp://127.0.0.1:10202/services/japps/docs\n\nTo try out authenticated endpoints click on the Authorize button on the top right of\nthe above url and chose `OAuth2AuthorizationCodeBearer` and click on Authorize.\n\n## Developing Locally\n\n_Note: In order to develop locally, both the JupyterHub backend and React UI frontend should be running._\n\n1. To start the JupyterHub Backend, run the following in a terminal:\n\n```bash\njupyterhub -f jupyterhub_config.py\n```\n\n2. To start the React UI frontend, run the following in a separate terminal from the `ui` directory:\n\n```bash\nnpm run watch\n```\n\n## Running Tests\n\n### Unit Tests\n\n```bash\npytest jhub_apps/tests\n```\n\n### E2E Tests\n\n```bash\npytest jhub_apps/tests_e2e -vvv -s --headed\n```\n\n## Usage\n\nJHub Apps has been tested with local JupyterHub using `SimpleLocalProcessSpawner` and with\nThe Littlest JupyterHub using `SystemdSpawner`.\n\n- Install JHub Apps\n\n```python\npip install git+https://github.com/nebari-dev/jhub-apps.git\n```\n\n- Add the following in The Littlest JupyterHub's `jupyterhub_config.py`\n\n```python\nfrom tljh.user_creating_spawner import UserCreatingSpawner\nfrom jhub_apps.configuration import install_jhub_apps\n\nc.JupyterHub.bind_url = \"<YOUR_JUPYTERHUB_URL>\"\nc.SystemdSpawner.unit_name_template = 'jupyter-{USERNAME}{JHUBSERVERNAME}'\nc.JAppsConfig.apps_auth_type = \"oauth\" # or none (if you don't want authentication on apps)\nc.JAppsConfig.python_exec = \"python3\"\n# Pass in the path to jupyterhub config\nc.JAppsConfig.jupyterhub_config_path = \"jupyterhub_config.py\"\n# Either a static list of conda environments to show in the\n# create panel apps form or a callable to fetch conda enviornments\n# dynamically, e.g. from conda-store API\nc.JAppsConfig.conda_envs = []\nc = install_jhub_apps(c, UserCreatingSpawner)\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "JupyterHub Apps",
    "version": "2024.10.1",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "be43d965c8a22fc2b82897400f78f468da249d5ba281666cde76008975c113ea",
                "md5": "8872a1442f772cafd3bd8a70b95492e3",
                "sha256": "7ef182ad35b6e0be7dc845324ba7e2f55842492493a109c448c0f715b65b92eb"
            },
            "downloads": -1,
            "filename": "jhub_apps-2024.10.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8872a1442f772cafd3bd8a70b95492e3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 3785203,
            "upload_time": "2024-10-25T16:43:08",
            "upload_time_iso_8601": "2024-10-25T16:43:08.953027Z",
            "url": "https://files.pythonhosted.org/packages/be/43/d965c8a22fc2b82897400f78f468da249d5ba281666cde76008975c113ea/jhub_apps-2024.10.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9c77ab2921e3b953418f73124c56a83163e693beff490f5cde75d5d8eed2affe",
                "md5": "91d2c2ecef7db3894bab6e3afe20a356",
                "sha256": "43118d3dce2ed4fe385a0d399770f13220da267cd60b1bc4e3968d3bb78db55c"
            },
            "downloads": -1,
            "filename": "jhub_apps-2024.10.1.tar.gz",
            "has_sig": false,
            "md5_digest": "91d2c2ecef7db3894bab6e3afe20a356",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 13171152,
            "upload_time": "2024-10-25T16:43:11",
            "upload_time_iso_8601": "2024-10-25T16:43:11.756680Z",
            "url": "https://files.pythonhosted.org/packages/9c/77/ab2921e3b953418f73124c56a83163e693beff490f5cde75d5d8eed2affe/jhub_apps-2024.10.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-25 16:43:11",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "jhub-apps"
}
        
Elapsed time: 0.66149s