nebari-dev / jhub-apps

Application creator and general launcher for JupyterHub
https://jhub-apps.nebari.dev/
BSD 3-Clause "New" or "Revised" License
27 stars 12 forks source link

[ENH] - Deploy apps from git repository #422

Open aktech opened 3 months ago

aktech commented 3 months ago

Feature description

At the moment for deploying apps you have to fill up the "Create App" form where you'd fill up all the details about app and then select server options (if available) and then deploy.

The proposal is to add the ability to create app from repository. Here is a mock UI

The Create App button will dropdown into two Options:

The create app form would look something like: (Also see the alternative approach described below, we might end up taking that one)

Screenshot 2024-07-30 at 8 35 05 am

πŸ—’οΈ Configuration File

The app configuration can be defined in the git repository as following:

## jhub_app.yml
name: My Panel App
description: This is a panel app
framework: panel
software_environment: environment.yml # relative path from git repository root
filepath: src/panel_app.py # relative path from git repository root
# non critical environment variables
# critical ones can be added from the UI
environment:
  SOMETHING_FOO: bar
  SOMETHING_BAR: beta
keep_alive: false
public: false
thumbnail: src/thumbnail.jpg # relative path from git repository root

πŸ“¦ Software Environment

The environment value (e.g environment.yml) can ideally be an environment file provided in the git repo, which will then be created in conda-store via API and then used for deploying the app, but for now in the first iteration we can start with not specifying it in the config file and letting the user chose from the UI.

βš™οΈ Environment variables

The environment variables has be provided from the UI as it would not be ideal from security point of view to add those in the git repo. Non-critical environment variables can be added in the git repository.

πŸš€ Implementation

✨ Alternative approach (could be the main approach)

Clone the repo directory and pre-fill the form could be easier, but cloning repo might be a slow process and can potentially cause the UI to be non-responsive if the repository is too big, This may not be the average case as apps repo might just be really very light and cloning it with min depth (--depth 1), might just be quite fast, so we should definitely try this approach first before moving on to the other approach.

jhub-apps-from-repo

Value and/or benefit

This is a good approach for creating/testing new apps, but there isn't a way

Anything else?

No response

aktech commented 2 months ago

The backend support for this is implemented and merged: https://github.com/nebari-dev/jhub-apps/pull/445