fix(runtime): restore on-demand provisioning for flash run (AE-2167)#206
Open
fix(runtime): restore on-demand provisioning for flash run (AE-2167)#206
Conversation
Allow FLASH_IS_LIVE_PROVISIONING env var to override container detection. This restores on-demand provisioning during local development even when RUNPOD_ENDPOINT_ID or RUNPOD_POD_ID are present in the environment. Changes: - Update is_deployed_container() to check FLASH_IS_LIVE_PROVISIONING first - Add 8 new test cases for override behavior - Maintain backward compatibility with deployed containers When flash run executes, it sets FLASH_IS_LIVE_PROVISIONING=true, which now correctly enables local development mode regardless of other RunPod environment variables. Test coverage: 16/16 tests pass, 979 total tests pass, 69.37% coverage
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where local development with flash run was blocked from using on-demand provisioning when RunPod environment variables (RUNPOD_ENDPOINT_ID or RUNPOD_POD_ID) were present in the development environment. The fix introduces a FLASH_IS_LIVE_PROVISIONING environment variable that explicitly overrides container detection to enable local development mode.
Changes:
- Added
FLASH_IS_LIVE_PROVISIONINGenvironment variable check inis_deployed_container()to explicitly allow local development - Added 8 comprehensive test cases covering all override scenarios including case-insensitivity and edge cases
- Enhanced documentation in the
is_deployed_container()docstring to explain the new override behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/runpod_flash/runtime/context.py | Added FLASH_IS_LIVE_PROVISIONING check at the start of is_deployed_container() to override RunPod ID detection, with updated documentation |
| tests/unit/runtime/test_context.py | Added 8 new test cases covering override scenarios, case-insensitivity, false/empty values, and integration with is_local_development() |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jhcipar
approved these changes
Feb 15, 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
Restores on-demand provisioning for 'flash run' when RUNPOD_ENDPOINT_ID or RUNPOD_POD_ID environment variables are present in the local development environment.
Problem
The is_deployed_container() function only checked for RunPod environment variables but didn't account for local development scenarios where these might be set for testing purposes. This could block on-demand provisioning during 'flash run'.
Solution
Updated is_deployed_container() to explicitly allow local development when FLASH_IS_LIVE_PROVISIONING=true:
Changes
Test Plan
Integration
This prepares the main branch for when deployment guards from commit 0464e1b (branch deanq/ae-2079-fix-bad-local-calls) get merged, ensuring those guards won't break local development.