Skip to content

Commit 4a0608b

Browse files
tgberkeleyTom Gotsman
andauthored
Improve cloud docs (#1165)
* migrate hosting docs * move env varibales to its own page * add docs for logs and deployment logs * update env vars docs * add docs on stopping and deleting apps * fix for simon comments * add final pages * small fix --------- Co-authored-by: Tom Gotsman <[email protected]>
1 parent 4979d86 commit 4a0608b

19 files changed

+225
-84
lines changed

assets/deleting_app.webp

24.2 KB
Loading

assets/environment_variables.webp

59.8 KB
Loading
50.7 KB
Loading

assets/stopping_app.webp

59.2 KB
Loading

assets/view_deployment_logs.webp

54.6 KB
Loading

assets/view_deployment_logs_2.webp

37.4 KB
Loading

assets/view_deployment_logs_3.webp

52.4 KB
Loading

assets/view_logs.webp

60.6 KB
Loading
Lines changed: 88 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
```python exec
22
import reflex as rx
33
from reflex_image_zoom import image_zoom
4+
from pcweb.pages.docs import hosting
45
from pcweb.pages import docs
56
from pcweb.styles.styles import get_code_style, cell_style
67

@@ -59,78 +60,13 @@ vmtypes = [
5960

6061
```
6162

63+
# App
6264

63-
# Reflex Cloud - Additional Concepts
65+
In Reflex Cloud an "app" (or "application" or "website") refers to a web application built using the Reflex framework, which can be deployed and managed within the Cloud platform.
6466

65-
To go back, i.e. from an app to a project or from a project to your list of projects you just click the `REFLEX logo` in the top left corner of the page.
67+
You can deploy an app using the `reflex deploy` command.
6668

67-
```md alert info
68-
# All flag values are saved between runs
69-
All your flag values, i.e. environment variables or regions or tokens, are saved between runs. This means that if you run a command and you pass a flag value, the next time you run the same command the flag value will be the same as the last time you ran it. This means you should only set the flag values again if you want to change them.
70-
```
71-
72-
## Environment Variables
73-
74-
75-
Below is an example of how to use an environment variable file. You can pass the `--envfile` flag with the path to the env file. For example:
76-
77-
```bash
78-
reflex deploy --project f88b1574-f101-####-####-5f########## --envfile .env
79-
```
80-
81-
In this example the path to the file is `.env`.
82-
83-
84-
If you prefer to pass the environment variables manually below is deployment command example:
85-
86-
```bash
87-
reflex deploy --project f88b1574-f101-####-####-5f########## --env OPENAI_API_KEY=sk-proj-vD4i9t6U############################
88-
```
89-
90-
They are passed after the `--env` flag as key value pairs.
91-
92-
To pass multiple environment variables, you can repeat the `--env` tag. i.e. `reflex deploy --project f88b1574-f101-####-####-5f########## --env KEY1=VALUE1 --env KEY2=VALUE`. The `--envfile` flag will override any envs set manually.
93-
94-
95-
```md alert info
96-
# More information on Environment Variables
97-
Environment variables are encrypted and safely stored. We recommend that backend API keys or secrets are entered as `envs`. Make sure to enter the `envs` without any quotation marks. We do not show the values of them in any CLI commands, only their names (or keys).
98-
99-
You access the values of `envs` by referencing `os.environ` with their names as keys in your app's backend. For example, if you set an env `ASYNC_DB_URL`, you are able to access it by `os.environ["ASYNC_DB_URL"]`. Some Python libraries automatically look for certain environment variables. For example, `OPENAI_API_KEY` for the `openai` python client. The `boto3` client credentials can be configured by setting `AWS_ACCESS_KEY_ID`,`AWS_SECRET_ACCESS_KEY`. This information is typically available in the documentation of the Python packages you use.
100-
```
101-
102-
## Adding Team Members
103-
104-
If you are a User you have the ability to create, deploy and delete apps, but you do not have the power to add or delete users from that project. You must be an Admin for that.
105-
106-
As an Admin you will see the an `Add user` button in the top right of the screen, as shown in the image below. Clicking on this will allow you to add a user to the project. You will need to enter the email address of the user you wish to add.
107-
108-
```python eval
109-
image_zoom(rx.image(src="/hosting_adding_team_members.png", alt="Adding team members to Reflex Cloud"))
110-
```
111-
112-
```python eval
113-
rx.box(height="20px")
114-
```
115-
116-
```md alert warning
117-
# Currently a User must already have logged in once before they can be added to a project.
118-
At this time a User must be logged in to be added to a project. In future there will be automatic email invites sent to add new users who have never logged in before.
119-
```
120-
121-
122-
123-
124-
125-
## Tokens
126-
127-
A token gives someone else all the permissions you have as a User or an Admin. They can run any Reflex Cloud command from the CLI as if they are you using the `--token` flag. A good use case would be for GitHub actions (you store this token in the secrets).
128-
129-
Tokens are found on the Project List page. If you cannot find it click the Reflex Logo in the top left side of the page until it appears as in the image below.
130-
131-
```python eval
132-
image_zoom(rx.image(src="/hosting_tokens.png", alt="Adding tokens to Reflex Cloud"))
133-
```
69+
There are many actions you can take in the Cloud UI to manage your app. Below are some of the most common actions you may want to take.
13470

13571

13672
## VMTypes
@@ -176,6 +112,7 @@ rx.table.root(
176112
)
177113
```
178114

115+
179116
## Regions
180117

181118
Below is an example of how to deploy your app in several regions:
@@ -206,4 +143,85 @@ rx.table.root(
206143
),
207144
variant="surface",
208145
)
209-
```
146+
```
147+
148+
149+
## View Logs
150+
151+
To view the app logs follow the arrow in the image below and press on the `Logs` dropdown.
152+
153+
```python eval
154+
image_zoom(rx.image(src="/view_logs.webp", padding_bottom="20px"))
155+
```
156+
157+
```md alert info
158+
# CLI Command to view logs
159+
`reflex cloud apps logs [OPTIONS] [APP_ID]`
160+
```
161+
162+
## View Deployment Logs and Deployment History
163+
164+
To view the deployment history follow the arrow in the image below and press on the `Deployments`.
165+
166+
```python eval
167+
image_zoom(rx.image(src="/view_deployment_logs.webp"))
168+
```
169+
170+
This brings you to the page below where you can see the deployment history of your app. Click on deployment you wish to explore further.
171+
172+
```python eval
173+
image_zoom(rx.image(src="/view_deployment_logs_2.webp", padding_bottom="20px"))
174+
```
175+
176+
```md alert info
177+
# CLI Command to view deployment history
178+
`reflex cloud apps history [OPTIONS] [APP_ID]`
179+
```
180+
181+
This brings you to the page below where you can view the deployment logs of your app by clicking the `Build logs` dropdown.
182+
183+
```python eval
184+
image_zoom(rx.image(src="/view_deployment_logs_3.webp"))
185+
```
186+
187+
188+
## Stopping an App
189+
190+
To stop an app follow the arrow in the image below and press on the `Stop app` button. Pausing an app will stop it from running and will not be accessible to users until you resume it. In addition, this will stop you being billed for your app.
191+
192+
```python eval
193+
image_zoom(rx.image(src="/stopping_app.webp", padding_bottom="20px"))
194+
```
195+
196+
```md alert info
197+
# CLI Command to stop an app
198+
`reflex cloud apps stop [OPTIONS] [APP_ID]`
199+
```
200+
201+
## Deleting an App
202+
203+
To delete an app click on the `Settings` tab in the Cloud UI on the app page.
204+
205+
```python eval
206+
image_zoom(rx.image(src="/environment_variables.webp"))
207+
```
208+
209+
Then click on the `Danger` tab as shown below.
210+
211+
```python eval
212+
image_zoom(rx.image(src="/deleting_app.webp"))
213+
```
214+
215+
Here there is a `Delete app` button. Pressing this button will delete the app and all of its data. This action is irreversible.
216+
217+
```md alert info
218+
# CLI Command to delete an app
219+
`reflex cloud apps delete [OPTIONS] [APP_ID]`
220+
```
221+
222+
223+
## Other app settings
224+
225+
Clicking on the `Settings` tab in the Cloud UI on the app page also allows a user to change the `app name`, change the `app description` and check the `app id`.
226+
227+
The other app settings also allows users to edit and add secrets (environment variables) to the app. For more information on secrets, see the [Secrets (Environment Variables)]({hosting.secrets_environment_vars.path}) page.

docs/hosting/deploy-quick-start.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,12 @@ That’s it! You should receive some feedback on the progress of your deployment
7070
If you go back to the Cloud UI you should be able to see your deployed app and other useful app information.
7171

7272

73+
```md alert info
74+
# Moving around the Cloud UI
75+
To go back, i.e. from an app to a project or from a project to your list of projects you just click the `REFLEX logo` in the top left corner of the page.
76+
```
7377

74-
78+
```md alert info
79+
# All flag values are saved between runs
80+
All your flag values, i.e. environment variables or regions or tokens, are saved between runs. This means that if you run a command and you pass a flag value, the next time you run the same command the flag value will be the same as the last time you ran it. This means you should only set the flag values again if you want to change them.
81+
```

0 commit comments

Comments
 (0)