-
Notifications
You must be signed in to change notification settings - Fork 6
feat(cli): add flash build command for packaging application artifact #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Implements tarball-based packaging for Flash applications with automatic dependency management and gitignore-style file filtering. Features: - Package Flash apps into self-contained tarballs - Install pip dependencies as local modules - Respect .flashignore and .gitignore patterns - Extract dependencies from @Remote decorators automatically - Multiple pip command fallback support Command options: - flash build: Build with all dependencies - flash build --no-deps: Skip transitive dependencies - flash build --keep-build: Keep temporary build directory - flash build -o custom.tar.gz: Custom archive name Implementation: - Add build.py command (496 lines) - Add ignore.py utility for pattern matching (140 lines) - Add .flashignore template to project scaffolding - Add pathspec>=0.11.0 dependency for gitignore parsing - Register build command in CLI main Archive structure: - .tetra/archive.tar.gz with app folder at root - All pip packages installed alongside application code - Clean extraction to single app directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a flash build command to package Flash applications into self-contained tarballs with all dependencies bundled as local modules, similar to AWS Lambda deployment packages.
Key Changes:
- Implements build command with support for ignore patterns (.flashignore/.gitignore)
- Adds dependency collection from requirements.txt and @Remote decorators
- Provides CLI options for controlling transitive dependencies and build artifact retention
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/tetra_rp/cli/commands/build.py |
Core build command implementation with file collection, dependency installation, and tarball creation |
src/tetra_rp/cli/utils/ignore.py |
Gitignore-style pattern matching utilities using pathspec library |
src/tetra_rp/cli/utils/skeleton.py |
Added .flashignore template to project scaffolding |
src/tetra_rp/cli/main.py |
Registered build command in CLI |
pyproject.toml |
Added pathspec dependency for pattern matching |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR #104 review comments from GitHub Copilot by adding explicit encoding='utf-8' parameter to all read_text() calls in flash build command implementation. Changes: - cli/utils/ignore.py: Add encoding to ignore file parsing - cli/commands/build.py: Add encoding to main.py, requirements.txt, and worker file parsing Ensures consistent cross-platform file reading behavior regardless of system default encoding (Windows cp1252 vs Linux/Mac UTF-8).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR #104 review comments from GitHub Copilot: - Modern type hint use - Use only sys.executable -m pip to ensure correct environment - PIP_INSTALL_TIMEOUT_SECONDS constant
* feat: AE-1202 add flash cli cmd init and run * feat(client): add local execution mode to @Remote decorator Adds optional 'local' parameter to @Remote decorator enabling local function/class execution without remote server provisioning. This facilitates testing and development by bypassing remote execution while maintaining the same decorator interface. Also adds detection for RunPod worker mode to return unwrapped functions when already running on the platform. * feat(cpu): add CpuInstanceType.ANY with auto-expansion Add support for CpuInstanceType.ANY which automatically expands to all available CPU instance types, providing flexibility similar to GPU endpoint behavior. Changes: - Add CpuInstanceType.ANY enum value - Add CpuInstanceType.all() classmethod to return all types except ANY - Update CpuServerlessEndpoint default from CPU3G_2_8 to ANY - Add field validator to expand [ANY] to all instance types - Exclude ANY from CPU_INSTANCE_DISK_LIMITS dict Test coverage: - Test ANY enum value and all() method behavior - Test validator expansion and explicit list preservation - Update existing tests for new default behavior - Verify ANY exclusion from disk limits calculation * fix(dev): enable flash CLI in editable mode for local development Changes: - Add editable install to make dev target - Configure setuptools to find packages in src/ directory - Update CLI branding to "Runpod Flash CLI" The flash CLI now works correctly in development mode while maintaining proper packaging for end users. Editable install ensures src/ changes are immediately active without reinstall. * test: fix CPU LiveServerless default to use ANY (all instances) The default for CpuLiveServerless is CpuInstanceType.ANY which expands to all available CPU instance types. Updated test expectations to match actual behavior where ANY expands to all instances with minimum disk size of 10GB. * build: fix broken build * chore: local dev changes * build: make update * feat(cli): add flash build command for packaging application artifact (#104) * feat(cli): add flash build command for AWS Lambda-style packaging Implements tarball-based packaging for Flash applications with automatic dependency management and gitignore-style file filtering. Features: - Package Flash apps into self-contained tarballs - Install pip dependencies as local modules - Respect .flashignore and .gitignore patterns - Extract dependencies from @Remote decorators automatically - Multiple pip command fallback support Command options: - flash build: Build with all dependencies - flash build --no-deps: Skip transitive dependencies - flash build --keep-build: Keep temporary build directory - flash build -o custom.tar.gz: Custom archive name Implementation: - Add build.py command (496 lines) - Add ignore.py utility for pattern matching (140 lines) - Add .flashignore template to project scaffolding - Add pathspec>=0.11.0 dependency for gitignore parsing - Register build command in CLI main Archive structure: - .tetra/archive.tar.gz with app folder at root - All pip packages installed alongside application code - Clean extraction to single app directory * fix: add explicit UTF-8 encoding to file reads Address PR #104 review comments from GitHub Copilot by adding explicit encoding='utf-8' parameter to all read_text() calls in flash build command implementation. Changes: - cli/utils/ignore.py: Add encoding to ignore file parsing - cli/commands/build.py: Add encoding to main.py, requirements.txt, and worker file parsing Ensures consistent cross-platform file reading behavior regardless of system default encoding (Windows cp1252 vs Linux/Mac UTF-8). * fix: more feedback cleanup Address PR #104 review comments from GitHub Copilot: - Modern type hint use - Use only sys.executable -m pip to ensure correct environment - PIP_INSTALL_TIMEOUT_SECONDS constant --------- Co-authored-by: Dean Quiñanola <[email protected]> Co-authored-by: Dean Quiñanola <[email protected]>
Summary
Adds
flash buildcommand to package Flash applications into self-contained tarballs with dependencies as local modules.Changes
New Files
src/tetra_rp/cli/commands/build.py- Main build command implementationsrc/tetra_rp/cli/utils/ignore.py- Gitignore-style pattern matching utilityModified Files
pyproject.toml- Addedpathspec>=0.11.0dependencysrc/tetra_rp/cli/main.py- Registered build commandsrc/tetra_rp/cli/utils/skeleton.py- Added.flashignoretemplate to project scaffoldingFeatures
Command Options
Usage Example
Build Process
flowchart TD A[flash build] --> B[Load .flashignore + .gitignore] B --> C[Collect project files] C --> D[Create .tetra/.build/app-name/] D --> E[Copy files to build dir] E --> F[Collect requirements.txt] F --> G[Extract @remote dependencies] G --> H[pip install --target build_dir] H --> I[Create tarball] I --> J{--keep-build?} J -->|No| K[Delete .build/] J -->|Yes| L[Keep .build/] K --> M[.tetra/archive.tar.gz] L --> M