diff --git a/bazel_common/score_modules_target_sw.MODULE.bazel b/bazel_common/score_modules_target_sw.MODULE.bazel index 96c595bd41f..75857b15689 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 5e93c31024a..0896ee61f40 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" + } +}