refactor: conform examples to latest Flash patterns#17
Merged
Conversation
Prevent accidental commits of Flash build artifacts: - flash_manifest.json (auto-generated by flash build) - uv.lock (example-specific lock files) - Root uv.lock tracks all consolidated dependencies
Add comprehensive mothership configuration documentation: - Document mothership.py pattern in project structure - Add mothership customization examples to CLAUDE.md - Simplify LiveServerless example in CONTRIBUTING.md - Clarify auto-generated file handling - Update directory structure patterns with mothership references
Enable mothership load-balanced endpoints for all examples: - Auto-scaling CPU-optimized load balancing - Configurable worker min/max scaling - Template showing GPU variant options - Instructions for disabling if not needed
Add quick start guides for hello_world and cpu_worker: - Installation and setup instructions - Local testing workflows with flash run - API endpoint documentation with curl examples - Architecture explanations and learning objectives - CPU vs GPU worker comparison and guidance
Fix incorrect project name and optimize instance type selections: - Fix 01_hello_world pyproject.toml name (was "02_cpu_worker") - Update cpu_worker to CPU3C_1_2 (right-sized for light workload) - Update dependencies examples to CPU3C_8_16 and CPU3C_1_2 - Optimize load_balancer GPU worker instance selection - Remove unused imports and config parameters
…code Mixed workers: - Merge preprocess_config and postprocess_config into single cpu_config - Both workers use identical resource requirements Load balancer: - Move VALID_OPERATIONS constant into function scope - Remove unused config parameters (workersMin, instanceIds, template) - Simplify to minimal required configuration
There was a problem hiding this comment.
Pull request overview
Comprehensive update to flash-examples to align with latest Flash patterns, improving documentation, configuration, and code maintainability across all examples.
Changes:
- Added mothership endpoint configurations to all examples with auto-scaling load balancing
- Improved documentation with comprehensive READMEs for hello_world and cpu_worker examples
- Fixed configuration bugs and optimized instance types for better resource utilization
- Refactored code to follow CLAUDE.md best practices, including moving constants to local scope in @Remote functions
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CONTRIBUTING.md | Simplified Flash patterns by removing verbose config parameters and version pins |
| CLAUDE.md | Added mothership configuration documentation, file structure patterns, and @Remote best practices |
| 03_advanced_workers/05_load_balancer/workers/gpu/endpoint.py | Removed unused gpus parameter from LiveLoadBalancer config |
| 03_advanced_workers/05_load_balancer/workers/cpu/endpoint.py | Moved VALID_OPERATIONS constant to local scope and removed unused config parameters |
| 03_advanced_workers/05_load_balancer/mothership.py | Added mothership endpoint configuration with examples |
| 03_advanced_workers/05_load_balancer/.gitignore | Added Flash auto-generated files to ignore patterns |
| 01_getting_started/04_dependencies/workers/gpu/endpoint.py | Updated GPU types to more specific models |
| 01_getting_started/04_dependencies/workers/cpu/endpoint.py | Optimized CPU instance types for workload characteristics |
| 01_getting_started/04_dependencies/mothership.py | Added mothership endpoint configuration |
| 01_getting_started/04_dependencies/.gitignore | Added Flash auto-generated files to ignore patterns |
| 01_getting_started/03_mixed_workers/workers/cpu/endpoint.py | Consolidated duplicate config objects into single cpu_config |
| 01_getting_started/03_mixed_workers/mothership.py | Added mothership endpoint configuration |
| 01_getting_started/03_mixed_workers/.gitignore | Added Flash auto-generated files to ignore patterns |
| 01_getting_started/02_cpu_worker/mothership.py | Added mothership endpoint configuration |
| 01_getting_started/02_cpu_worker/cpu_worker.py | Changed from ANY to specific CPU3C_1_2 instance type |
| 01_getting_started/02_cpu_worker/README.md | Added comprehensive example documentation |
| 01_getting_started/02_cpu_worker/.gitignore | Added Flash auto-generated files to ignore patterns |
| 01_getting_started/01_hello_world/pyproject.toml | Fixed project name from copy-paste error |
| 01_getting_started/01_hello_world/mothership.py | Added mothership endpoint configuration |
| 01_getting_started/01_hello_world/README.md | Added comprehensive example documentation |
| 01_getting_started/01_hello_world/.gitignore | Added Flash auto-generated files to ignore patterns |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jhcipar
approved these changes
Jan 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive updates to flash-examples to align with latest Flash patterns, documentation standards, and best practices.
Changes
Documentation & Configuration
Mothership Endpoints
Bug Fixes & Optimizations
Code Refactoring
Test Plan
flash runto verify all endpoints workmake quality-checkpasses (format, lint, type checking)