Implement perry/container and perry/workloads orchestration stack#65
Implement perry/container and perry/workloads orchestration stack#65yumin-chen wants to merge 1 commit into
Conversation
…ration This commit implements the full container orchestration stack for Perry, including: - The `perry-container-compose` crate: a native Rust reimplementation of container-compose functionality with platform-adaptive backend detection (prioritizing apple/container on macOS and podman elsewhere). - Topological sort (Kahn's algorithm) for service startup order and automatic rollback on failure. - `perry-stdlib` integration: a complete FFI bridge in `crates/perry-stdlib/src/container/` using the `spawn_for_promise_deferred` pattern for runtime safety. - Compiler integration: Added `perry/container`, `perry/compose`, and `perry/workloads` as built-in modules in `perry-hir`. - Codegen: Implemented a unified dispatch table in `perry-codegen` supporting direct FFI calls and automatic JSON serialization via `NA_JSON`. - WIT definition: Formally specified the container interface in `src/core/wit/perry-container.wit`. - Functional testing: Added a `MockBackend` and functional test suite for orchestration logic. Verified with property-based tests for topological sorting and workspace compilation checks. Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
I have implemented the complete
perry/containerandperry/workloadsorchestration stack.Key components:
perry-container-compose: A new crate that handles OCI backend detection, Compose specification parsing (YAML/JSON), and service orchestration. It uses Kahn's algorithm for deterministic startup order and handles cleanup/rollback on failures.perry-stdlib: Added a comprehensive FFI layer insrc/container/. It utilizes a deferred promise spawning pattern to ensure that complex JSON results are correctly marshaled back to the Perry runtime's arena-allocated memory without corruption.perry/container,perry/compose, andperry/workloadsas native modules, exempting them from standard dependency checks.lower_call.rswith a newNA_JSONargument kind that automatically stringifies JS objects before passing them to the Rust FFI, and added the full container/workload dispatch tables.src/core/wit/perry-container.wit.MockBackendto verify orchestration behavior (topological sorting, run commands, etc.) without requiring a live OCI runtime.All core logic is verified through unit and property tests. The crates compile successfully with the new
containerfeature flag enabled.PR created automatically by Jules for task 9509739616403750352 started by @yumin-chen