Skip to content

Commit

Permalink
reamde changes
Browse files Browse the repository at this point in the history
  • Loading branch information
neelasha23 committed Feb 2, 2024
1 parent 0e8608e commit 113fb18
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions doc/apps/shiny.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Shiny Core
# Shiny

To deploy a [Shiny Core](https://shiny.posit.co/py/docs/overview.html) application to Ploomber Cloud you need:
To deploy a [Shiny](https://shiny.posit.co/py/docs/overview.html) application to Ploomber Cloud you need:

- A `Dockerfile`
- A Shiny project

## `Dockerfile`

Use this [template](https://github.com/ploomber/doc/blob/main/examples/docker/shiny-core/Dockerfile) `Dockerfile`:
Use this [template](https://github.com/ploomber/doc/blob/main/examples/docker/shiny/Dockerfile) `Dockerfile`:

```Dockerfile
FROM python:3.11

COPY app-core.py app-core.py
COPY app.py app.py
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

ENTRYPOINT ["shiny", "run", "app-core.py", "--host", "0.0.0.0", "--port", "80"]
ENTRYPOINT ["shiny", "run", "app.py", "--host", "0.0.0.0", "--port", "80"]
```

## Testing locally
Expand All @@ -25,10 +25,10 @@ To test your app, you can use `docker` locally:

```sh
# build the docker image
docker build . -t shiny-core-app
docker build . -t shiny-app

# run it
docker run -p 5000:80 shiny-core-app
docker run -p 5000:80 shiny-app
```

Now, open [http://0.0.0.0:5000/](http://0.0.0.0:5000/) to see your app.
Expand All @@ -38,6 +38,6 @@ Now, open [http://0.0.0.0:5000/](http://0.0.0.0:5000/) to see your app.

Once you have all your files, create a zip file.

To deploy a Shiny Core app from the deployment menu, select the Docker option and follow the instructions:
To deploy a Shiny app from the deployment menu, select the Docker option and follow the instructions:

![](../static/docker.png)
6 changes: 4 additions & 2 deletions examples/docker/shiny/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ This app is built on Shiny and allows you to visualize model training accuracy s

## Connecting to MongoDB Cloud

For the purpose of this tutorial we will use the `MongoDB Atlas` cloud database. Let's see the steps for creating a cluster:
For the purpose of this tutorial we will use the `MongoDB Atlas` cloud database. It allows users to host a database for free.
Let's see the steps for creating a cluster:

First create an account on [MongoDB cloud](https://www.mongodb.com/atlas/database) and create a new project:

Expand All @@ -32,6 +33,7 @@ Once you have completed the access rules setup, select the `CONNECT` button on t
## Deploy application

Create a zip file using `Dockerfile`, `app-core.py` and `requirements.txt` and deploy this file to Ploomber cloud.
Refer to the [Shiny deployment documentation](https://docs.cloud.ploomber.io/en/latest/apps/shiny.html) for more details.
Once the `VIEW APPLICATION` button is enabled, you can start the training script and monitor the training.

## Train models
Expand All @@ -45,7 +47,7 @@ First create a virtual environment and install the required packages:
pip install tensorflow scikit-learn "pymongo[srv]"
```

Then run the training scripts parallely.:
Then run the training scripts parallely:

```bash
python train_one.py & python train_two.py & wait
Expand Down
2 changes: 0 additions & 2 deletions examples/docker/shiny/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import pandas as pd
import plotly.express as px
from shinywidgets import output_widget, render_widget
Expand Down

0 comments on commit 113fb18

Please sign in to comment.