Skip to content

Commit 72e717d

Browse files
authored
docs: Update Flash docs for .flashignore deprecation and built-in ignore patterns (#588)
2 parents ec78ab4 + 604ff64 commit 72e717d

6 files changed

Lines changed: 21 additions & 7 deletions

File tree

flash/apps/build-app.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ This is the structure of the project template created by `flash init`:
5555
<Tree.File name="gpu_worker.py" />
5656
<Tree.File name="cpu_worker.py" />
5757
<Tree.File name=".env.example" />
58-
<Tree.File name=".flashignore" />
5958
<Tree.File name=".gitignore" />
6059
<Tree.File name="pyproject.toml" />
6160
<Tree.File name="requirements.txt" />

flash/apps/deploy-apps.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ Each endpoint maintains its own connection to the state manager, querying for pe
336336
If the build process can't find your endpoint functions:
337337

338338
- Ensure functions are decorated with `@Endpoint(...)`.
339-
- Check that Python files aren't excluded by `.gitignore` or `.flashignore`.
339+
- Check that Python files aren't excluded by `.gitignore` or Flash's [built-in ignore patterns](/flash/cli/build#built-in-ignore-patterns).
340340
- Verify decorator syntax is correct.
341341

342342
### Deployment size limit exceeded

flash/apps/initialize-project.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ uv run flash init .
4141
<Tree.File name="gpu_worker.py" />
4242
<Tree.File name="cpu_worker.py" />
4343
<Tree.File name=".env.example" />
44-
<Tree.File name=".flashignore" />
4544
<Tree.File name=".gitignore" />
4645
<Tree.File name="pyproject.toml" />
4746
<Tree.File name="requirements.txt" />
@@ -57,8 +56,6 @@ uv run flash init .
5756

5857
**cpu_worker.py**: An example CPU queue-based worker. Contains `@Endpoint` functions that run on CPU-only instances. Provides `/runsync` route for job submission. Creates one endpoint when deployed.
5958

60-
**.flashignore**: Lists files and directories to exclude from the deployment artifact (similar to `.gitignore`).
61-
6259
Each worker file defines a resource configuration and its associated functions. When you deploy, Flash creates one Serverless endpoint per unique resource configuration.
6360

6461
## Set up the project

flash/cli/build.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ Comma-separated list of packages to exclude from the build (e.g., `torch,torchvi
5252
5. **Dependency installation**: Installs Python packages for Linux x86_64.
5353
6. **Packaging**: Bundles everything into `.flash/artifact.tar.gz`.
5454

55+
## Built-in ignore patterns
56+
57+
Flash automatically excludes certain files and directories from deployment artifacts. These patterns cover common development files that shouldn't be deployed to production.
58+
59+
| Category | Patterns |
60+
|----------|----------|
61+
| Build artifacts | `.build/`, `.flash/`, `.runpod/`, `*.tar.gz`, `.git/`, `__pycache__/`, `*.pyc`, `*.pyo`, `*.pyd`, `*.egg-info/`, `dist/`, `build/` |
62+
| Virtual environments | `.venv/`, `venv/`, `env/` |
63+
| IDE files | `.vscode/`, `.idea/` |
64+
| Environment files | `.env`, `.env.local` |
65+
| Tests | `tests/`, `test_*.py`, `*_test.py` |
66+
| Documentation | `docs/`, `*.md` (except `README.md`) |
67+
68+
Flash also respects your `.gitignore` file and excludes any files matching those patterns.
69+
70+
<Tip>
71+
If you use other environment file variants like `.env.dev` or `.env.staging`, add them to your `.gitignore` to exclude them from deployment artifacts.
72+
</Tip>
73+
5574
## Build artifacts
5675

5776
After running `flash build`:

flash/cli/init.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ The command creates the following project structure:
4848
<Tree.File name="gpu_worker.py" />
4949
<Tree.File name="cpu_worker.py" />
5050
<Tree.File name=".env.example" />
51-
<Tree.File name=".flashignore" />
5251
<Tree.File name=".gitignore" />
5352
<Tree.File name="pyproject.toml" />
5453
<Tree.File name="requirements.txt" />

flash/troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Tarball exceeds maximum size. File size: 1.6GB, Max: 1.5GB
244244
**Solution:**
245245

246246
1. Check for large files that shouldn't be included (datasets, model weights, logs).
247-
2. Add large files to `.flashignore` to exclude them from the build.
247+
2. Add large files to `.gitignore` to exclude them from the build.
248248
3. Use [network volumes](/flash/configuration/storage) to store large models instead of bundling them.
249249

250250
### Invalid tarball format

0 commit comments

Comments
 (0)