Commit
·
de71074
1
Parent(s):
2a11918
chore: Update metadata
Browse files- LESSONS.md +41 -8
- README.md +1 -1
LESSONS.md
CHANGED
|
@@ -2,14 +2,15 @@
|
|
| 2 |
|
| 3 |
## Table of Contents
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
## 1. Docker
|
| 15 |
|
|
@@ -340,3 +341,35 @@ jobs:
|
|
| 340 |
- Runs when you **push or create a pull request** to the `main` branch.
|
| 341 |
- Uses **Ubuntu** as the environment.
|
| 342 |
- Sets up **Python 3.10**, installs dependencies, and runs **pytest** for tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
## Table of Contents
|
| 4 |
|
| 5 |
+
1. [Docker](#1-docker)
|
| 6 |
+
2. [Dev Containers](#2-dev-containers)
|
| 7 |
+
3. [Redis](#3-redis)
|
| 8 |
+
4. [Postgres](#4-postgres)
|
| 9 |
+
5. [Unit Tests](#5-unit-tests)
|
| 10 |
+
6. [Locust](#6-locust)
|
| 11 |
+
7. [AWS](#7-aws)
|
| 12 |
+
8. [GitHub Actions](#8-github-actions)
|
| 13 |
+
9. [Streamlit](#9-streamlit)
|
| 14 |
|
| 15 |
## 1. Docker
|
| 16 |
|
|
|
|
| 341 |
- Runs when you **push or create a pull request** to the `main` branch.
|
| 342 |
- Uses **Ubuntu** as the environment.
|
| 343 |
- Sets up **Python 3.10**, installs dependencies, and runs **pytest** for tests.
|
| 344 |
+
|
| 345 |
+
## 9. Streamlit
|
| 346 |
+
|
| 347 |
+
To fix **telemetry issues** and **403 errors on file uploads** during deployment (Docker/Hugging Face Spaces)., configure Streamlit with a `config.toml` in `/app/.streamlit/`:
|
| 348 |
+
|
| 349 |
+
```toml
|
| 350 |
+
[browser]
|
| 351 |
+
gatherUsageStats = false
|
| 352 |
+
|
| 353 |
+
[server]
|
| 354 |
+
enableCORS = false
|
| 355 |
+
enableXsrfProtection = false
|
| 356 |
+
```
|
| 357 |
+
|
| 358 |
+
In Dockerfile:
|
| 359 |
+
|
| 360 |
+
```dockerfile
|
| 361 |
+
RUN mkdir -p /app/.streamlit /app/tmp
|
| 362 |
+
COPY .streamlit/ /app/.streamlit/
|
| 363 |
+
```
|
| 364 |
+
|
| 365 |
+
Or generate the same configuration in build stage:
|
| 366 |
+
|
| 367 |
+
```dockerfile
|
| 368 |
+
RUN mkdir -p /app/.streamlit \
|
| 369 |
+
&& echo "[browser]\n" \
|
| 370 |
+
"gatherUsageStats = false\n\n" \
|
| 371 |
+
"[server]\n" \
|
| 372 |
+
"enableCORS = false\n" \
|
| 373 |
+
"enableXsrfProtection = false\n" \
|
| 374 |
+
> /app/.streamlit/config.toml
|
| 375 |
+
```
|
README.md
CHANGED
|
@@ -7,7 +7,7 @@ sdk: docker
|
|
| 7 |
app_port: 8501
|
| 8 |
tags:
|
| 9 |
- streamlit
|
| 10 |
-
pinned:
|
| 11 |
short_description: A CNN-based image classification with TensorFlow
|
| 12 |
license: mit
|
| 13 |
---
|
|
|
|
| 7 |
app_port: 8501
|
| 8 |
tags:
|
| 9 |
- streamlit
|
| 10 |
+
pinned: true
|
| 11 |
short_description: A CNN-based image classification with TensorFlow
|
| 12 |
license: mit
|
| 13 |
---
|