Skip to content

Commit

Permalink
Clean up Community Cloud troubleshooting (#1056)
Browse files Browse the repository at this point in the history
* Clean up Community Cloud troubleshooting

* Remove old Community Cloud troubleshooting

* Update Community Cloud limitations

* Clarifications

* Update per review

* Add debian to "other limitations"
  • Loading branch information
sfc-gh-dmatthews authored Jun 5, 2024
1 parent b43ea9c commit a32361b
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 158 deletions.
12 changes: 11 additions & 1 deletion content/deploy/community-cloud/deploy-your-app/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ your-repository/
└── requirements.txt
```

Additionally, any files that need to be locally available to your app should be included in your repo.

<Tip>

If you have really big or binary data that you change frequently, and git is feeling slow, you might want to check out [Git Large File Store (LFS)](https://git-lfs.github.com/) as a better way to store large files in GitHub. You don't need to make any changes to your app to start using it. If your GitHub repo uses LFS, it will _just work_ with Streamlit Community Cloud.

</Tip>

<Important>

Although you can deploy multiple apps from the same repository, there can be only one configuration file.
Although you can deploy multiple apps from the same repository, there can be only one configuration file. This configuration file must be in a `.streamlit` directory in the root of your repository.

</Important>

Expand All @@ -53,6 +61,8 @@ Although you can deploy multiple apps from the same repository, there can be onl

![Fill in your app's information to deploy your app](/images/streamlit-community-cloud/deploy-an-app.png)

While Community Cloud attempts to suggest available repos and files, these suggestions are not always complete. If you do not see the desired information populating a drop-down list in each field, type it in manually.

## Advanced settings for deployment

<Note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This page contains additional information about the authorization needed to conn

## Authorize your GitHub account

There are two different authorization prompts to grant access between Streamlit and your GitHub account. The first authorization&mdash;"Authorize Streamlit"&mdash;happens when you connect your GitHub account to Streamlit. The second authorization&mdash;"Streamlit is requesting additional permissions"&mdash;happens when you deploy your first app. You must click "**Authorize streamlit**" on both. If you are a member of any GitHub organizations, read below to understand the extras steps to [authorize an organization](#organization-access). Questions about GitHub permissions? Read some frequently asked questions about our [GitHub integration](/deploy/streamlit-community-cloud/troubleshooting#github-integration).
There are two different authorization prompts to grant access between Streamlit and your GitHub account. The first authorization&mdash;"Authorize Streamlit"&mdash;happens when you connect your GitHub account to Streamlit. The second authorization&mdash;"Streamlit is requesting additional permissions"&mdash;happens when you deploy your first app. You must click "**Authorize streamlit**" on both. If you are a member of any GitHub organizations, read below to understand the extras steps to [authorize an organization](#organization-access). For additional information about why we require these permissions, see [GitHub OAuth scope](/deploy/streamlit-community-cloud/status#github-oauth-scope).

<Image alt="Authorize your GitHub account" src="/images/streamlit-community-cloud/GitHub-auth-none.png" />

Expand Down
39 changes: 39 additions & 0 deletions content/deploy/community-cloud/status-and-limitations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Status and limitations
slug: /deploy/streamlit-community-cloud/status
---

# Status and limitations of Community Cloud

## Community Cloud Status

You can view the current status of Community Cloud at [streamlitstatus.com](https://www.streamlitstatus.com/).

## GitHub OAuth scope

To deploy your app, Streamlit requires access to your app's source code in GitHub and the ability to manage the public keys associated with your repositories. The default GitHub OAuth scopes are sufficient to work with apps in public GitHub repositories. However, to access your private repositories, we create a read-only [GitHub Deploy Key](https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys) and then access your repo using an SSH key. When we create this key, GitHub notifies repo admins of the creation as a security measure.

Streamlit requires the additional `repo` OAuth scope from GitHub to work with your private repos and manage deploy keys. We recognize that the `repo` scope provides Streamlit with extra permissions that we do not really need and which, as people who prize security, we'd rather not even be granted. This was the permission model available from GitHub when Community Cloud was created. However, we are working on adopting the new GitHub permission model to reduce uneeded permissions.

### Developer permissions

Because of the OAuth limitations noted above, a developer must have administrative permissions to a repository to deploy apps from it.

## Repository file structure

You can deploy multiple apps from your repository, and your entrypoint file(s) may be anywhere in your directory structure. However, Community Cloud initializes all apps from the root of your repository, even if the entrypoint file is in a subdirectory. This has the following consequences:

- Community Cloud only recognizes one `.streamlit/configuration.toml` file at the root (of each branch) of your repository.
- You must declare image, video, and audio file paths for Streamlit commands relative to the root of your repository. For example, `st.image`, `st.logo`, and the `page_icon` parameter in `st.set_page_config` expect file locations relative to your working directory (i.e. where you execute `streamlit run`).

## Python environments

- You cannot mix and match Python package managers for a single app. Community Cloud configures your app's Python environment based on the first environment configuration file it finds. For more information, see [Other Python package managers](/deploy/streamlit-community-cloud/deploy-your-app/app-dependencies#other-python-package-managers).
- If you pin `streamlit< 1.20.0`, you must also pin `altair<5`. Earlier versions of Streamlit did not correctly restrict Altair's version. A workaround script running on Community Cloud will forcibly install `altair<5` if a newer version is detected. This could unintentionally upgrade Altair's dependencies in violation of your environment configuration. Newer versions of Streamlit support Altair version 5.
- Community Cloud only supports released versions of Python that are still receiving security updates. You may not use end-of-life, prerelease, or feature versions of Python. For more information, see [Status of Python versions](https://devguide.python.org/versions/).

## Other limitations

- When you print something to the Cloud logs, you may need to do a `sys.stdout.flush()` before it shows up.
- Community Cloud hosts all apps in the United States. This is currently not configurable.
- Community Cloud is built on Debian Linux. All file paths must use forward-slash path separators.
153 changes: 0 additions & 153 deletions content/deploy/community-cloud/troubleshooting.md

This file was deleted.

15 changes: 15 additions & 0 deletions content/develop/api-reference/charts/pyplot.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,18 @@ description: st.pyplot displays a matplotlib.pyplot figure.
---

<Autofunction function="streamlit.pyplot" />

<Warning>
Matplotlib [doesn't work well with threads](https://matplotlib.org/3.3.2/faq/howto_faq.html#working-with-threads). So if you're using Matplotlib you should wrap your code with locks as shown in the snippet below. This Matplotlib bug is more prominent when you deploy and share your app apps since you're more likely to get concurrent users then.

```python
from matplotlib.backends.backend_agg import RendererAgg
_lock = RendererAgg.lock

with _lock:
fig.title('This is a figure)')
fig.plot([1,20,3,40])
st.pyplot(fig)
```

</Warning>
4 changes: 2 additions & 2 deletions content/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,8 @@ site_menu:
url: /deploy/streamlit-community-cloud/manage-your-account/update-your-email
- category: Deploy / Streamlit Community Cloud / Manage your account / Delete your account
url: /deploy/streamlit-community-cloud/manage-your-account/delete-your-account
- category: Deploy / Streamlit Community Cloud / Troubleshooting
url: /deploy/streamlit-community-cloud/troubleshooting
- category: Deploy / Streamlit Community Cloud / Status and limitations
url: /deploy/streamlit-community-cloud/status
- category: Deploy / Streamlit in Snowflake
url: https://docs.snowflake.com/developer-guide/streamlit/about-streamlit
- category: Deploy / Other platforms
Expand Down
3 changes: 2 additions & 1 deletion public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -1131,4 +1131,5 @@
/knowledge-base/components /develop/concepts/custom-components
/knowledge-base/components/component-blinking-stuttering-fix /develop/concepts/custom-components/limitations
/knowledge-base/components/how-streamlit-components-differ-base-package /develop/concepts/custom-components/limitations
/knowledge-base/components/not-possibe-streamlit-components /develop/concepts/custom-components/limitations
/knowledge-base/components/not-possibe-streamlit-components /develop/concepts/custom-components/limitations
/deploy/streamlit-community-cloud/troubleshooting /deploy/streamlit-community-cloud/status
Binary file not shown.

0 comments on commit a32361b

Please sign in to comment.