Skip to content

feat(runtime): Task 15 Phase 1 — decouple Studio dataflow lifecycle from Dora CLI #38

@vivekrajsingh04

Description

@vivekrajsingh04

Files affected:

  • mofa-dora-bridge/src/controller.rs
  • mofa-dora-bridge/src/error.rs
  • mofa-dora-bridge/src/lib.rs
  • mofa-dora-bridge/examples/runtime_backend_demo.rs
  • mofa-dora-bridge/examples/README.md

Summary

This issue tracks Task 15 (Phase 1) from GSoC: preparing MoFA Studio to migrate from Dora-dependent lifecycle execution toward mofa-rs native runtime.

Today, DataflowController is tightly coupled to Dora CLI lifecycle commands (dora up/start/list/stop).
For migration, we need a runtime abstraction seam while keeping current behavior stable.

Problem

Current lifecycle methods are Dora-specific:

  • daemon management assumes Dora (dora up)
  • start/stop/status use Dora CLI directly
  • no explicit runtime backend model in controller API

This makes native-runtime migration invasive and risky.

Proposed Fix (Phase 1)

  1. Introduce runtime backend abstraction in controller:
    • RuntimeBackend::{DoraCli, MofaNative}
    • DataflowController::new_with_runtime(...)
    • runtime_backend() getter
  2. Keep default behavior unchanged:
    • DataflowController::new(...) uses RuntimeBackend::DoraCli
  3. Add explicit error for unimplemented backend paths:
    • BridgeError::UnsupportedRuntime(...)
  4. Add practical usage example:
    • mofa-dora-bridge/examples/runtime_backend_demo.rs
    • mofa-dora-bridge/examples/README.md
  5. Add tests for phase-1 guarantees:
    • backend selection is persisted
    • MofaNative start path fails explicitly (not silently)

Validation

  • cargo check -p mofa-dora-bridge
  • cargo check -p mofa-dora-bridge --example runtime_backend_demo
  • cargo test -p mofa-dora-bridge controller::tests::new_with_runtime_sets_backend -- --nocapture
  • cargo test -p mofa-dora-bridge controller::tests::mofa_native_start_is_explicitly_unsupported_for_now -- --nocapture
  • Example dry run:
    • cargo run -p mofa-dora-bridge --example runtime_backend_demo -- apps/mofa-fm/dataflow/voice-chat.yml
  • Example native-backend explicit error:
    • MOFA_RUNTIME_BACKEND=mofa-native cargo run -p mofa-dora-bridge --example runtime_backend_demo -- apps/mofa-fm/dataflow/voice-chat.yml --start

Scope

This is Phase 1 only (abstraction + example + tests).
Actual mofa-rs native lifecycle wiring for MofaNative is planned in follow-up phase(s).

I would like to work on this issue.
GitHub username: @vivekrajsingh04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions