From 0876214c9faab40e231bf011e20768497a0ea3dc Mon Sep 17 00:00:00 2001 From: "amelia@ivis.ai" Date: Mon, 21 Sep 2026 16:24:41 +0900 Subject: [PATCH] Bump score_lifecycle pin and fix simple_lifecycle mw::com config Bumps score_lifecycle to the latest known-good hash and packages mw_com_config.json into the simple_lifecycle showcase so mw::com initializes correctly for components run by launch_manager. The config is staged both under etc/ (for launch_manager's own cwd) and bin/etc/ (for components chdir'd into bin_dir by ProcessGroupManager), since mw::com resolves the config path relative to each component's cwd at exec time. --- .../score_modules_target_sw.MODULE.bazel | 2 +- known_good.json | 2 +- showcases/simple_lifecycle/BUILD | 18 ++++ showcases/simple_lifecycle/configs/BUILD | 1 + .../configs/launch_manager_config.json | 12 +-- .../configs/mw_com_config.json | 100 ++++++++++++++++++ 6 files changed, 127 insertions(+), 8 deletions(-) create mode 100644 showcases/simple_lifecycle/configs/mw_com_config.json diff --git a/bazel_common/score_modules_target_sw.MODULE.bazel b/bazel_common/score_modules_target_sw.MODULE.bazel index 52ba2aa699a..db5ce6625c0 100644 --- a/bazel_common/score_modules_target_sw.MODULE.bazel +++ b/bazel_common/score_modules_target_sw.MODULE.bazel @@ -71,7 +71,7 @@ git_override( bazel_dep(name = "score_lifecycle") git_override( module_name = "score_lifecycle", - commit = "85da2168328d17a3cf53791ebf93534e5ed921fc", + commit = "9b86164ac1f850f76ac8ce743be903f98a60f422", remote = "https://github.com/eclipse-score/lifecycle.git", ) diff --git a/known_good.json b/known_good.json index 8024415c01a..6f776ccf7ce 100644 --- a/known_good.json +++ b/known_good.json @@ -115,7 +115,7 @@ "//score/health_monitor/src/rust:miri_tests" ] }, - "hash": "85da2168328d17a3cf53791ebf93534e5ed921fc" + "hash": "9b86164ac1f850f76ac8ce743be903f98a60f422" }, "score_logging": { "repo": "https://github.com/eclipse-score/logging.git", diff --git a/showcases/simple_lifecycle/BUILD b/showcases/simple_lifecycle/BUILD index 37afd26f68f..cc374f9e8ea 100644 --- a/showcases/simple_lifecycle/BUILD +++ b/showcases/simple_lifecycle/BUILD @@ -11,6 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_files") load("@score_lifecycle//:defs.bzl", "launch_manager_config") load("//bazel_common:bundlers.bzl", "score_pkg_bundle") @@ -20,6 +21,21 @@ launch_manager_config( flatbuffer_out_dir = "etc", ) +# launch_manager itself runs with the package's data dir as its cwd (see +# simple_lifecycle.score.json's "dir"), but ProcessGroupManager chdirs each +# supervised component into "bin_dir" before exec'ing it, and mw::com resolves +# "./etc/mw_com_config.json" relative to that cwd. So the config needs to be +# staged next to the binaries (bin/etc/), not just under data/simple_lifecycle/ +# like the other custom_layout entries below -- otherwise every component that +# uses mw::com (e.g. control_daemon, the state_manager component) fails mw::com +# initialization on launch and gets stuck in launch_manager's restart loop. +pkg_files( + name = "simple_lifecycle_bin_mw_com_config_pkg", + srcs = ["//showcases/simple_lifecycle/configs:mw_com_config.json"], + attributes = pkg_attributes(mode = "0444"), + prefix = "bin/etc", +) + score_pkg_bundle( name = "simple_lifecycle", bins = [ @@ -35,5 +51,7 @@ score_pkg_bundle( custom_layout = { ":lifecycle_configs": "etc/", "//showcases/simple_lifecycle/configs:logging.json": "etc/logging.json", + "//showcases/simple_lifecycle/configs:mw_com_config.json": "etc/mw_com_config.json", }, + other_package_files = [":simple_lifecycle_bin_mw_com_config_pkg"], ) diff --git a/showcases/simple_lifecycle/configs/BUILD b/showcases/simple_lifecycle/configs/BUILD index 802ad609605..7bdb0d69052 100644 --- a/showcases/simple_lifecycle/configs/BUILD +++ b/showcases/simple_lifecycle/configs/BUILD @@ -13,4 +13,5 @@ exports_files([ "launch_manager_config.json", "logging.json", + "mw_com_config.json", ]) diff --git a/showcases/simple_lifecycle/configs/launch_manager_config.json b/showcases/simple_lifecycle/configs/launch_manager_config.json index 1f9e1b87539..08ce602d41c 100644 --- a/showcases/simple_lifecycle/configs/launch_manager_config.json +++ b/showcases/simple_lifecycle/configs/launch_manager_config.json @@ -6,7 +6,7 @@ "ready_recovery_action": { "restart": { "number_of_attempts": 1, - "delay_before_restart": 0.5 + "delay_before_restart_ms": 500 } }, "sandbox": { @@ -22,7 +22,7 @@ "application_type": "Reporting", "is_self_terminating": false, "alive_supervision": { - "reporting_cycle": 0.1, + "reporting_cycle_ms": 100, "min_indications": 1, "max_indications": 3, "failed_cycles_tolerance": 1 @@ -35,7 +35,7 @@ } }, "run_target": { - "transition_timeout": 5, + "transition_timeout_ms": 5000, "recovery_action": { "switch_run_target": { "run_target": "fallback_run_target" @@ -43,7 +43,7 @@ } }, "alive_supervision" : { - "evaluation_cycle": 0.5 + "evaluation_cycle_ms": 500 } }, "components": { @@ -112,9 +112,9 @@ "fallback_run_target": { "description": "Switching off everything", "depends_on": ["state_manager"], - "transition_timeout": 1.5 + "transition_timeout_ms": 1500 }, "alive_supervision" : { - "evaluation_cycle": 0.5 + "evaluation_cycle_ms": 500 } } \ No newline at end of file diff --git a/showcases/simple_lifecycle/configs/mw_com_config.json b/showcases/simple_lifecycle/configs/mw_com_config.json new file mode 100644 index 00000000000..a478be5d746 --- /dev/null +++ b/showcases/simple_lifecycle/configs/mw_com_config.json @@ -0,0 +1,100 @@ +{ + "serviceTypes": [ + { + "serviceTypeName": "/score/mw/lifecycle/LmControlService", + "version": { + "major": 1, + "minor": 0 + }, + "bindings": [ + { + "binding": "SHM", + "serviceId": 7101, + "events": [ + { + "eventName": "ActivationResult", + "eventId": 1 + } + ], + "methods": [ + { + "methodName": "ActivateRunTarget", + "methodId": 2 + }, + { + "methodName": "GetActiveRunTarget", + "methodId": 3 + } + ] + } + ] + } + ], + "serviceInstances": [ + { + "instanceSpecifier": "LaunchManager/StateManager/Instance", + "serviceTypeName": "/score/mw/lifecycle/LmControlService", + "version": { + "major": 1, + "minor": 0 + }, + "instances": [ + { + "instanceId": 1, + "asil-level": "QM", + "binding": "SHM", + "events": [ + { + "eventName": "ActivationResult", + "numberOfSampleSlots": 8, + "maxSubscribers": 1 + } + ], + "methods": [ + { + "methodName": "ActivateRunTarget", + "queueSize": 1 + }, + { + "methodName": "GetActiveRunTarget", + "queueSize": 1 + } + ] + } + ] + }, + { + "instanceSpecifier": "StateManager/LaunchManager/Instance", + "serviceTypeName": "/score/mw/lifecycle/LmControlService", + "version": { + "major": 1, + "minor": 0 + }, + "instances": [ + { + "instanceId": 1, + "asil-level": "QM", + "binding": "SHM", + "events": [ + { + "eventName": "ActivationResult" + } + ], + "methods": [ + { + "methodName": "ActivateRunTarget", + "queueSize": 1 + }, + { + "methodName": "GetActiveRunTarget", + "queueSize": 1 + } + ] + } + ] + } + ], + "global": { + "asil-level": "QM" + } +}