Skip to content

Commit

Permalink
docs(deploy): Add a deployment section
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Nov 10, 2022
1 parent ea6fec4 commit 2b5e122
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/content/docs/deploy-cloud.md
@@ -0,0 +1,19 @@
# Cloud

Trame applications can be bundled into a standalone docker container image that can then be deployed in the cloud with various mechanisms.

The [trame-cookiecutter](https://github.com/Kitware/trame-cookiecutter) provide an initial example for building such image under `bundles/docker/*`.

For single file application you can find an example in that [repository](https://github.com/Kitware/trame-app-cone) along with [a multi-application setup](https://github.com/Kitware/trame-app-cone/tree/multi-app).

## CapRover

To even streamline the deployment of such docker image, you can leverage [CapRover](https://caprover.com/) to automatically enable HTTPS/WSS on public domains for your trame app.

Both the cookiecutter in `bundles/docker/DEPLOY.md` and the [single file app repo](https://github.com/Kitware/trame-app-cone) go over the steps to deploy any trame application to CapRover.

## Infinite scaling

Trame applications have the possibility to be launched on server less architecture and therefore virtually scale to infinity by using a routing server and the reverse connection infrastructure of its server. Such feature can be leverage both in the cloud or in HPC.

For more details on that feature please reach out to [Kitware](https://www.kitware.com/contact/).
9 changes: 9 additions & 0 deletions docs/content/docs/deploy-desktop.md
@@ -0,0 +1,9 @@
# Desktop

Trame applications can be bundled into a standalone desktop application and presented to the user like a native application without the need of a browser to expose the UI.

For that part we usually rely on [PyInstaller](https://pyinstaller.org/en/stable/#) to bundle the Python part of the code into something executable. Then you can either rely on [PyWebView](https://pywebview.flowrl.com/) or [Tauri](https://tauri.app/) to hide the browser and enable a native app look.

The [trame-cookiecutter](https://github.com/Kitware/trame-cookiecutter) provide an initial example for using PyWebView under `bundles/desktop/*`.

For tauri, you can look at an example [here](https://github.com/Kitware/trame-tauri/tree/master/examples/simple-cone). Then you can browse around for more...
5 changes: 5 additions & 0 deletions docs/content/docs/deploy-hpc.md
@@ -0,0 +1,5 @@
# HPC

High Performance Computing is a world on its own where every center may have its own set of rules. So due to the specificities it might be worth [reaching out to a specialist at Kitware](https://www.kitware.com/contact/) to discuss what options might be available for your environment.

For more general purpose system, we've created a simple template for [Open OnDemand](https://osc.github.io/ood-documentation/latest/index.html#) that is available [here](https://github.com/Kitware/trame-ondemand-bc-cone) for reference.
16 changes: 16 additions & 0 deletions docs/content/docs/deploy-jupyter.md
@@ -0,0 +1,16 @@
# Jupyter

Trame applications can be imported and shown within a Jupyter cell without missing any of your application capabilities.

The [trame-cookiecutter](https://github.com/Kitware/trame-cookiecutter) provide an initial helper that live under `{package_name}/app/jupyter.py` which provide a `show()` method.

But such `show()` method can be implemented for a single file application like below when no additional parameter are required for your application:

```python
def show(**kwargs):
from trame.app import jupyter
jupyter.show(server, **kwargs)
```

The way such integration works is by running the trame server as an asynchronous task within Tornedo (Jupyter kernel) and opening a new port so that iframe can connect to it.
This means that everything defined within your Jupyter environment is accessible within trame and vice-versa.
7 changes: 7 additions & 0 deletions docs/content/docs/deploy-pypi.md
@@ -0,0 +1,7 @@
# PYPI / CLI

Trame applications are regular Python code which means they can be deployed to PyPI or conda and be used as command line tools.

The [trame-cookiecutter](https://github.com/Kitware/trame-cookiecutter) provide an initial structure for streamlining such use case.

But technically nothing would separate a trame app than any other Python package.
6 changes: 6 additions & 0 deletions docs/tpl/__en__
Expand Up @@ -38,6 +38,12 @@ sidebar:
t_html: HTML
t_application: Application
t_pv: ParaView
deploy: Deploy targets
d_pypi: Python CLI
d_jupyter: Jupyter
d_desktop: Desktop
d_cloud: Cloud
d_hpc: HPC / Clusters

examples:
getting_started: Getting Started
Expand Down
6 changes: 6 additions & 0 deletions docs/tpl/__sidebar__
Expand Up @@ -17,6 +17,12 @@ docs:
t_html: tutorial-html.html
t_application: tutorial-application.html
t_pv: tutorial-paraview.html
deploy:
d_pypi: deploy-pypi.html
d_jupyter: deploy-jupyter.html
d_desktop: deploy-desktop.html
d_cloud: deploy-cloud.html
d_hpc: deploy-hpc.html

examples:
getting_started:
Expand Down

0 comments on commit 2b5e122

Please sign in to comment.