sandbox: pooled Monty 0.0.22 runtime; apps mirror local sys.path - #1539
Open
kumare3 wants to merge 3 commits into
Open
sandbox: pooled Monty 0.0.22 runtime; apps mirror local sys.path#1539kumare3 wants to merge 3 commits into
kumare3 wants to merge 3 commits into
Conversation
- Bump pydantic-monty 0.0.17 -> 0.0.22 and run sandboxed code on a shared process-wide AsyncMonty worker pool (new sandbox/_runtime.py). The bridge drives feed_start/resume with async snapshots. - Update ORCHESTRATOR_SYNTAX_PROMPT for the relaxed Monty syntax subset. - Default sandbox image and examples install flyte[sandbox] instead of a bare pydantic-monty pin. - Apps: inject FLYTE_SYS_PATH when sync_local_sys_paths is on (both container and pod-template paths), so an app module loaded from a subdirectory can import sibling files at serve time. Factor the existing task logic into flyte._utils.local_sys_paths_env. - Codemode chat example: UI/agent updates for the new runtime. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XrdLwao7hk7u5tSubRQRz1
Plugin lockfiles depend on the root flyte package by path, so the pydantic-monty==0.0.22 pin in the sandbox extra has to be reflected in each of them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XrdLwao7hk7u5tSubRQRz1 Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
In the full suite an earlier test leaves a global init config with sync_local_sys_paths=True, which now injects _F_SYS_PATH into app containers and broke three env-var count assertions. Patch _get_init_config to None for the module; the sys-path tests opt in. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XrdLwao7hk7u5tSubRQRz1 Signed-off-by: Ketan Umare <kumare3@users.noreply.github.com>
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
AsyncMontyworker pool (src/flyte/sandbox/_runtime.py) instead of in-processMontyobjects.ExternalFunctionBridgedrives the asyncfeed_start/resumeloop; the dummy-input workaround is gone.ORCHESTRATOR_SYNTAX_PROMPTreflects the relaxed Monty syntax subset.flyte[sandbox]rather than a barepydantic-montypin; renovate tracks monty releases at0 days.sys.path. Whensync_local_sys_pathsis on,app_serdeinjectsFLYTE_SYS_PATH(container and pod-template paths), matching what_with_local_sys_pathsalready does for tasks. The shared logic lives inflyte._utils.local_sys_paths_env. This lets an app module in a subdirectory import sibling files at serve time.Test plan
pytest tests/flyte/sandbox tests/flyte/app/runtime/test_app_serde.py(251 passed)ruff check/ruff format --checkon touched filesexamples/sandbox/codemode/chat_app.pyremotely and confirm sibling imports resolve🤖 Generated with Claude Code
https://claude.ai/code/session_01XrdLwao7hk7u5tSubRQRz1