Skip to content

fix(runtime): restore on-demand provisioning for flash run (AE-2167)#206

Open
deanq wants to merge 1 commit intomainfrom
deanq/ae-2167-fix-auto-provision
Open

fix(runtime): restore on-demand provisioning for flash run (AE-2167)#206
deanq wants to merge 1 commit intomainfrom
deanq/ae-2167-fix-auto-provision

Conversation

@deanq
Copy link
Member

@deanq deanq commented Feb 14, 2026

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:

  • Added check for FLASH_IS_LIVE_PROVISIONING at the beginning of the function
  • If set to "true" (case-insensitive), returns False even if RunPod IDs are present
  • Preserves existing behavior for deployed containers

Changes

  • Updated is_deployed_container() in runtime/context.py to check FLASH_IS_LIVE_PROVISIONING first
  • Added 8 new test cases covering all override scenarios
  • Maintains backward compatibility with deployed containers

Test Plan

  • All 16 unit tests in test_context.py pass
  • Full test suite passes (979 tests)
  • Code coverage: 69.37% (exceeds 65% requirement)
  • Quality checks pass (formatting, linting, type checking)

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.

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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_PROVISIONING environment variable check in is_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.

@deanq deanq requested review from KAJdev and jhcipar February 14, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants