WIP: Add Python runtime environments#2704
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| pass | ||
|
|
||
|
|
||
| class MissingPreparedPythonProjectError(PythonProjectRuntimeEnvironmentError): |
There was a problem hiding this comment.
prefer simpler error - only define a single one
|
|
||
| @property | ||
| def convention(self) -> str: | ||
| return "pixi-backed-uv" if self.pixi_toml_path.exists() else "uv" |
There was a problem hiding this comment.
can just use a has_pixi flag since all projects have pyproject.toml
| for atom in blueprint.blueprints: | ||
| placement_owner_by_module[atom.module] = blueprint_index | ||
| all_disabled_modules = tuple( | ||
| module for bp in blueprints for module in bp.disabled_modules_tuple |
There was a problem hiding this comment.
what is disabled modules? also this whole new block seems to be adding a bunch of things together... might need some comment/cleanup
There was a problem hiding this comment.
and what's the usecase of disabled modules in the codebase?
| runtime_environment_registry: RuntimeEnvironmentRegistry | None = None, | ||
| runtime_placement_map: Mapping[type[ModuleBase], RuntimePlacement] | None = None, |
There was a problem hiding this comment.
deployment/coordinator should stay more highlevel, too dirty to put all venv specific logic here. need better abstraction
Problem
Python modules currently run in the coordinator environment, which forces module-specific dependency stacks into
dimos runand makes modules with complex or conflicting dependencies difficult to deploy safely.Closes N/A
Solution
Adds Python runtime environments for isolated module workers:
examples/dimos-demo-worker-module/with a runnable script showing main venv → isolated worker venv execution.Key tradeoffs:
How to Test
Result: 96 passed.
Expected: prints the repo/main Python executable, a worker Python executable under
examples/dimos-demo-worker-module/.venv/, runtime-only dependency outputRuntimeDependency, andworker result: demo-runtime:HELLO FROM MAIN VENV.Result: valid.
Contributor License Agreement