Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
451 changes: 451 additions & 0 deletions composer/events.py

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion composer/model/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ def handle_regular_nodes(self, nodes, launch_description, launcher):
launch_description (object): The launch description object.
"""
for n in nodes:
if n.action == STARTACTION or (n.action == NOACTION and self.should_node_run(n, launcher)):
action = n.action
if action == "":
action = NOACTION
if action == STARTACTION or (action == NOACTION and self.should_node_run(n, launcher)):
launch_description.add_action(Node(
package=n.pkg,
executable=n.exec,
Expand Down
653 changes: 266 additions & 387 deletions composer/muto_composer.py

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions composer/plugins/launch_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,13 @@ def _handle_stack_json_start(self, manifest):
"""Handle start for stack/json payload type."""
if manifest:
stack_data = manifest.get("launch")
stack = Stack(manifest=stack_data)
stack.launch(self.launcher)
return True
if stack_data:
stack = Stack(manifest=stack_data)
stack.launch(self.launcher)
return True
else:
self.get_logger().error("No 'launch' section found in stack/json manifest")
return False
return False

def _handle_raw_stack_start(self, stack_data):
Expand Down Expand Up @@ -541,24 +545,21 @@ def handle_apply(
if self.current_stack:
# Parse payload and determine type
payload_type, stack_data, launch_file, command = self._get_payload_type_and_data(self.current_stack)

stack_dict = None
if payload_type == "stack/json":
stack_dict = stack_data
elif payload_type == "raw":
stack_dict = stack_data
elif payload_type == "stack/archive":
# For archive, we might need to apply the full payload or just the properties
stack_dict = self.current_stack
else:
stack_dict = self.current_stack # fallback
stack_dict = stack_data if isinstance(stack_data, dict) else None

if stack_dict:
self.get_logger().info(
f"Apply requested with stack manifest keys: {list(stack_dict.keys())}"
)
stack = Stack(manifest=stack_dict)
stack.apply(self.launcher)
if payload_type == "raw":
stack = Stack(stack_dict)
stack.apply(self.launcher)
elif payload_type == "stack/json":
success = self._handle_stack_json_start(stack_dict)
elif payload_type == "stack/archive":
success = self._handle_archive_start(launch_file)
else:
# Fallback case
stack = Stack(manifest=stack_dict)
stack.apply(self.launcher)

response.success = True
response.err_msg = ""
else:
Expand Down
31 changes: 31 additions & 0 deletions composer/subsystems/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright (c) 2025 Composiv.ai
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Composiv.ai - initial API and implementation
#

"""
Subsystems package for the refactored Muto Composer.
Contains modular components for stack management, orchestration, and pipeline execution.
"""

from .message_handler import MessageHandler
from .stack_manager import StackManager
from .orchestration_manager import OrchestrationManager
from .pipeline_engine import PipelineEngine
from .digital_twin_integration import DigitalTwinIntegration

__all__ = [
"MessageHandler",
"StackManager",
"OrchestrationManager",
"PipelineEngine",
"DigitalTwinIntegration"
]
Loading