Skip to content

Commit

Permalink
Document ploomber-cloud examples (#138)
Browse files Browse the repository at this point in the history
* main doc, framework draft

* tabs, snippets

* fix tabs

* cannot include full code blocks

* spacing

* nesting, headers

* finalize + other frameworks

* name fix, complete
  • Loading branch information
bryannho authored Mar 6, 2024
1 parent dc8ea9f commit c378e3b
Show file tree
Hide file tree
Showing 6 changed files with 276 additions and 13 deletions.
52 changes: 51 additions & 1 deletion doc/apps/panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,58 @@ panel serve app.py

## Deploy

`````{tab-set}
````{tab-item} Web
__Deploy from the menu__
Once you have all your files, create a zip file.
To deploy a Panel app from the deployment menu, follow these instructions:
![](../static/panel.png)
To learn more about deploying Panel applications on Ploomber Cloud [click here](https://panel.holoviz.org/how_to/deployment/ploomber.html)
To learn more about deploying Panel applications on Ploomber Cloud [click here](https://panel.holoviz.org/how_to/deployment/ploomber.html)
````
````{tab-item} Command-line
__Try an example__
To download and deploy an example Panel application start by installing Ploomber Cloud and setting your API key:
```sh
pip install ploomber-cloud
ploomber-cloud key YOUR-KEY
```
```{tip}
If you don't have an API key yet, follow the [instructions here.](../quickstart/apikey.md)
```
Now, download an example. It will prompt you for a location to download the app. To download in the current directory, just press enter.
```sh
ploomber-cloud examples panel/data-viz
```
```{note}
A full list of Panel example apps is available [here.](https://github.com/ploomber/doc/tree/main/examples/panel)
```
You should see a confirmation with instructions on deploying your app. Now, navigate to your application:
```sh
cd location-you-entered/data-viz
```
__Deploy from the CLI__
Initialize and deploy your app with:
```sh
ploomber-cloud init
ploomber-cloud deploy --watch
```
````
`````
49 changes: 48 additions & 1 deletion doc/apps/shiny-r.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,58 @@ Rscript install.R
Rscript startApp.R
```


## Deploy

`````{tab-set}
````{tab-item} Web
__Deploy from the menu__
Once you have all your files, create a zip file.
To deploy a Shiny app from the deployment menu, select the Shiny (R) option and follow the instructions:
![](../static/shiny-r.png)
````
````{tab-item} Command-line
__Try an example__
To download and deploy an example Shiny-R application start by installing Ploomber Cloud and setting your API key:
```sh
pip install ploomber-cloud
ploomber-cloud key YOUR-KEY
```
```{tip}
If you don't have an API key yet, follow the [instructions here.](../quickstart/apikey.md)
```
Now, download an example. It will prompt you for a location to download the app. To download in the current directory, just press enter.
```sh
ploomber-cloud examples shiny-r/shiny-r-data-visualization
```
```{note}
A full list of Shiny-R example apps is available [here.](https://github.com/ploomber/doc/tree/main/examples/shiny-r)
```
You should see a confirmation with instructions on deploying your app. Now, navigate to your application:
```sh
cd location-you-entered/shiny-r-data-visualization
```
__Deploy from the CLI__
Initialize and deploy your app with:
```sh
ploomber-cloud init
ploomber-cloud deploy --watch
```
````
`````
49 changes: 46 additions & 3 deletions doc/apps/solara.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,56 @@ solara run app.py

## Deploy

`````{tab-set}
````{tab-item} Web
__Deploy from the menu__
Once you have all your files, create a zip file.
To deploy a Solara app from the deployment menu, follow these instructions:
![](../static/solara.png)
````
````{tab-item} Command-line
__Try an example__
To download and deploy an example Solara application start by installing Ploomber Cloud and setting your API key:
```sh
pip install ploomber-cloud
ploomber-cloud key YOUR-KEY
```
```{tip}
If you don't have an API key yet, follow the [instructions here.](../quickstart/apikey.md)
```
Now, download an example. It will prompt you for a location to download the app. To download in the current directory, just press enter.
```sh
ploomber-cloud examples solara/gpt-4-tokenizer
```
```{note}
A full list of Solara example apps is available [here.](https://github.com/ploomber/doc/tree/main/examples/solara)
```
You should see a confirmation with instructions on deploying your app. Now, navigate to your application:
## Example
Ploomber has created an example solara app for your convenience.
```sh
cd location-you-entered/gpt-4-tokenizer
```
__Deploy from the CLI__
Initialize and deploy your app with:
```sh
ploomber-cloud init
ploomber-cloud deploy --watch
```
Check it out [here.](https://github.com/ploomber/doc/blob/main/examples/solara/gpt-4-tokenizer/app.py)
````
`````
50 changes: 50 additions & 0 deletions doc/apps/streamlit.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,56 @@ streamlit run app.py

## Deploy

`````{tab-set}
````{tab-item} Web
__Deploy from the menu__
Once you have all your files, create a zip file.
To deploy a Streamlit app from the deployment menu, follow these instructions:
![](../static/streamlit.png)
````
````{tab-item} Command-line
__Try an example__
To download and deploy an example Streamlit application start by installing Ploomber Cloud and setting your API key:
```sh
pip install ploomber-cloud
ploomber-cloud key YOUR-KEY
```
```{tip}
If you don't have an API key yet, follow the [instructions here.](../quickstart/apikey.md)
```
Now, download an example. It will prompt you for a location to download the app. To download in the current directory, just press enter.
```sh
ploomber-cloud examples streamlit/data-viz
```
```{note}
A full list of Streamlit example apps is available [here.](https://github.com/ploomber/doc/tree/main/examples/streamlit)
```
You should see a confirmation with instructions on deploying your app. Now, navigate to your application:
```sh
cd location-you-entered/data-viz
```
__Deploy from the CLI__
Initialize and deploy your app with:
```sh
ploomber-cloud init
ploomber-cloud deploy --watch
```
````
`````
62 changes: 54 additions & 8 deletions doc/apps/voila.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# Voilà

```{tip}
If you haven't deployed your first application, check out the [quickstart guide.](../quickstart/app.md)
```
## Voila applications

To deploy a application you need two files:
To deploy an application you need two files:

1. A Jupyter notebook file (`.ipynb`)
2. A dependencies file (`requirements.txt`)

## Voilà

Currently, Ploomber Cloud supports `Voilà` for deploying Jupyter notebooks as applications. For information on how to write Voilà applications, [please check the documentation](https://voila.readthedocs.io/en/stable/).
For information on how to write Voilà applications, [please check the documentation](https://voila.readthedocs.io/en/stable/).

Click here to see [some examples.](../examples/voila.md)

Expand All @@ -28,6 +24,56 @@ matplotlib

## Deploy

`````{tab-set}
````{tab-item} Web
__Deploy from the menu__
Once you have all your files, create a zip file.
To deploy a Voilà app from the deployment menu, follow these instructions:
![](../static/voila.png)
![](../static/voila.png)
````
````{tab-item} Command-line
__Try an example__
To download and deploy an example Voila application start by installing Ploomber Cloud and setting your API key:
```sh
pip install ploomber-cloud
ploomber-cloud key YOUR-KEY
```
```{tip}
If you don't have an API key yet, follow the [instructions here.](../quickstart/apikey.md)
```
Now, download an example. It will prompt you for a location to download the app. To download in the current directory, just press enter.
```sh
ploomber-cloud examples voila/chat-with-csv
```
```{note}
A full list of Voila example apps is available [here.](https://github.com/ploomber/doc/tree/main/examples/voila)
```
You should see a confirmation with instructions on deploying your app. Now, navigate to your application:
```sh
cd location-you-entered/chat-with-csv
```
__Deploy from the CLI__
Initialize and deploy your app with:
```sh
ploomber-cloud init
ploomber-cloud deploy --watch
```
````
`````
27 changes: 27 additions & 0 deletions doc/user-guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,33 @@ Then, execute:
ploomber-cloud deploy
```

## Deploying an example

Ploomber Cloud hosts example applications for many different frameworks. To download and deploy one, run `ploomber-cloud examples`:

```sh
ploomber-cloud examples
```

Follow the prompts to choose a framework and specific example name. You may also specify a directory in which to download the example.

Once the application is downloaded, it's ready to deploy! For example, if you downloaded the `basic-app` example for `Flask` in the current directory:

```sh
ploomber-cloud key YOUR-KEY
cd basic-app
ploomber-cloud init
ploomber-cloud deploy --watch
```

If you already know which example you want, you can download it while avoiding prompts with `ploomber-cloud examples framework/example-name`:

```sh
ploomber-cloud examples flask/basic-app
```

A full list of example applications is available [here](https://github.com/bryannho/doc/tree/main/examples)

## Defining environment variables

If your project uses environment variables, you can define them in an `.env` file.
Expand Down

0 comments on commit c378e3b

Please sign in to comment.