Skip to content

Implement Production-Ready Perry Container Subsystem#72

Open
yumin-chen wants to merge 2 commits into
feat/container-composefrom
feat/perry-container-subsystem-production-ready-2916472828020898139
Open

Implement Production-Ready Perry Container Subsystem#72
yumin-chen wants to merge 2 commits into
feat/container-composefrom
feat/perry-container-subsystem-production-ready-2916472828020898139

Conversation

@yumin-chen

Copy link
Copy Markdown

This PR implements the production-ready Perry container subsystem as per the canonical specification.

Key changes:

  • Core Orchestration: Updated ComposeEngine in perry-container-compose to implement the correct startup/teardown sequences, including external resource protection, idempotency checks, and image build/pull triggers.
  • FFI Bridge: Standardized all js_container_* and js_compose_* symbols in perry-stdlib to use i64 for handles and boolean flags, ensuring compatibility with the LLVM backend's NaN-boxing truncation.
  • Compiler Integration: Registered perry/container, perry/compose, and perry/workloads as native modules in perry-hir and updated the NATIVE_MODULE_TABLE in perry-codegen for static dispatch.
  • Naming Convention: Implemented the {md5_8chars}-{random_hex8} naming format in service.rs, derived from hashing the service configuration.
  • Security: Added support for read_only root filesystems and seccomp profiles via SecurityProfile and run_with_security backend calls.

The subsystem is fully functional across macOS/Podman/Docker backends and verified through comprehensive unit and integration tests.


PR created automatically by Jules for task 2916472828020898139 started by @yumin-chen

yumin-chen and others added 2 commits April 27, 2026 20:59
Implement the `perry/container` and `perry/container-compose` (workloads)
subsystems, finalising the OCI stack. This transition moves from initial
stubs to a hardened implementation featuring deterministic orchestration
and cross-runtime compatibility.

Core Subsystems:
- Orchestration: Implemented `WorkloadGraphEngine` using Kahn's algorithm for
  topological dependency resolution, deterministic startup, and rollback.
- Backend: Multi-layered auto-detection for 7+ runtimes (Apple Container,
  Podman, OrbStack, etc.) with liveness checks and strict priority ordering.
- Security: Integrated Sigstore/cosign for image verification and hardened
  ephemeral runners with `cap_drop: ALL`, `seccomp`, and `read_only` root.
- FFI Bridge: Expanded `perry-stdlib` with async-safe, promise-based handlers
  optimized for raw C-ABI passing of primitives and validated pointers.

Technical Details:
- Restructured `perry-container-compose` into a flat module layout.
- Refactored `CliBackend` to be generic over `CliProtocol` for zero vtable
  overhead.
- Standardised container naming to `{image_hash_8}-{random_hex}` with
  label-based orphan cleanup logic.
- Modernised internal registries using `DashMap` for improved concurrency.
- Integrated with Perry compiler (HIR registration and codegen dispatch).

Refinements & Fixes:
- Restored `Buffer` synonym and `process.argv` specialization in `lower.rs`.
- Fixed SQLite linker conflicts by gating runtime stubs.
- Implemented robust IP and label extraction for the `DockerProtocol`.
- Added Forgejo production example and exhaustive documentation.
- Standardize container naming to {md5_8chars}-{random_hex8}.
- Align ComposeEngine up/down orchestration with canonical spec.
- Implement comprehensive FFI bridge with standardized i64 signatures.
- Wire perry/container, perry/compose, and perry/workloads to HIR and Codegen.
- Add support for read-only rootfs and seccomp security profiles.
- Ensure idempotency and robust rollback in stack orchestration.
- Verified with unit tests and FFI contract tests.

Co-authored-by: yumin-chen <10954839+yumin-chen@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@yumin-chen yumin-chen force-pushed the feat/container-compose branch 24 times, most recently from a7e9d31 to dd181eb Compare May 3, 2026 01:35
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.

1 participant