From c6506c2ff00a88970f9218cae9b8d7b136ae9ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Fu=C3=9Fberger?= Date: Mon, 23 Feb 2026 09:10:07 +0100 Subject: [PATCH] Migrate to new launch manager configuration --- MODULE.bazel | 1 + .../score_modules_target_sw.MODULE.bazel | 4 +- showcases/simple_lifecycle/BUILD | 59 +------ showcases/simple_lifecycle/configs/BUILD | 5 +- .../configs/cpp_supervised_app_demo.json | 14 -- .../simple_lifecycle/configs/hm_demo.json | 165 ----------------- .../configs/launch_manager_config.json | 120 +++++++++++++ .../simple_lifecycle/configs/lm_demo.json | 167 ------------------ .../configs/rust_supervised_app_demo.json | 15 -- 9 files changed, 131 insertions(+), 419 deletions(-) delete mode 100644 showcases/simple_lifecycle/configs/cpp_supervised_app_demo.json delete mode 100644 showcases/simple_lifecycle/configs/hm_demo.json create mode 100644 showcases/simple_lifecycle/configs/launch_manager_config.json delete mode 100644 showcases/simple_lifecycle/configs/lm_demo.json delete mode 100644 showcases/simple_lifecycle/configs/rust_supervised_app_demo.json diff --git a/MODULE.bazel b/MODULE.bazel index a9ccd471622..16fa3b355f5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -71,3 +71,4 @@ toolchains_qnx.sdp( ) use_repo(toolchains_qnx, "toolchains_qnx_sdp") use_repo(toolchains_qnx, "toolchains_qnx_ifs") + diff --git a/bazel_common/score_modules_target_sw.MODULE.bazel b/bazel_common/score_modules_target_sw.MODULE.bazel index 4ee74d63985..db8bd510af4 100644 --- a/bazel_common/score_modules_target_sw.MODULE.bazel +++ b/bazel_common/score_modules_target_sw.MODULE.bazel @@ -67,8 +67,8 @@ git_override( bazel_dep(name = "score_lifecycle_health") git_override( module_name = "score_lifecycle_health", - commit = "14ee704eeac03e03ca10bece5de8b694d3c5e2dd", - remote = "https://github.com/eclipse-score/lifecycle.git", + commit = "e538003a2cdb30b03c78158894dbd7289ea99479", + remote = "https://github.com/etas-contrib/score_lifecycle.git", ) bazel_dep(name = "score_logging") diff --git a/showcases/simple_lifecycle/BUILD b/showcases/simple_lifecycle/BUILD index 2bf578fb89b..02fcfd81940 100644 --- a/showcases/simple_lifecycle/BUILD +++ b/showcases/simple_lifecycle/BUILD @@ -13,6 +13,12 @@ load("@rules_cc//cc:cc_library.bzl", "cc_library") load("//bazel_common:bundlers.bzl", "score_pkg_bundle") +load("@score_lifecycle_health//:defs.bzl", "launch_manager_config") +launch_manager_config( + name ="lifecycle_configs", + config="//showcases/simple_lifecycle/configs:launch_manager_config.json" +) + score_pkg_bundle( name = "simple_lifecycle", bins = [ @@ -26,57 +32,6 @@ score_pkg_bundle( "//showcases/simple_lifecycle:simple_lifecycle.score.json", ], custom_layout = { - ":lm_demo.bin": "etc/lm_demo.bin", - ":hm_demo.bin": "etc/hm_demo.bin", - ":cpp_supervised_app_demo.bin": "etc/cpp_supervised_app_demo.bin", - ":rust_supervised_app_demo.bin": "etc/rust_supervised_app_demo.bin", + ":lifecycle_configs": "etc/", }, ) - -genrule( - name = "gen_lm_demo.bin", - srcs = [ - "@score_lifecycle_health//src/launch_manager_daemon:lm_flatcfg_fbs", - "//showcases/simple_lifecycle/configs:lm_demo.json", - ], - outs = ["lm_demo.bin"], - cmd = "$(location @flatbuffers//:flatc) --binary $(SRCS) && mv lm_demo.bin $(location lm_demo.bin)", - tools = ["@flatbuffers//:flatc"], - visibility = ["//visibility:public"], -) - -genrule( - name = "gen_hm_demo.bin", - srcs = [ - "@score_lifecycle_health//src/launch_manager_daemon/health_monitor_lib:hm_flatcfg_fbs", - "//showcases/simple_lifecycle/configs:hm_demo.json", - ], - outs = ["hm_demo.bin"], - cmd = "$(location @flatbuffers//:flatc) --binary $(SRCS) && mv hm_demo.bin $(location hm_demo.bin)", - tools = ["@flatbuffers//:flatc"], - visibility = ["//visibility:public"], -) - -genrule( - name = "gen_cpp_supervised_app_demo.bin", - srcs = [ - "@score_lifecycle_health//src/launch_manager_daemon/health_monitor_lib:hm_flatcfg_fbs", - "//showcases/simple_lifecycle/configs:cpp_supervised_app_demo.json", - ], - outs = ["cpp_supervised_app_demo.bin"], - cmd = "$(location @flatbuffers//:flatc) --binary $(SRCS) && mv cpp_supervised_app_demo.bin $(location cpp_supervised_app_demo.bin)", - tools = ["@flatbuffers//:flatc"], - visibility = ["//visibility:public"], -) - -genrule( - name = "gen_rust_supervised_app_demo.bin", - srcs = [ - "@score_lifecycle_health//src/launch_manager_daemon/health_monitor_lib:hm_flatcfg_fbs", - "//showcases/simple_lifecycle/configs:rust_supervised_app_demo.json", - ], - outs = ["rust_supervised_app_demo.bin"], - cmd = "$(location @flatbuffers//:flatc) --binary $(SRCS) && mv rust_supervised_app_demo.bin $(location rust_supervised_app_demo.bin)", - tools = ["@flatbuffers//:flatc"], - visibility = ["//visibility:public"], -) diff --git a/showcases/simple_lifecycle/configs/BUILD b/showcases/simple_lifecycle/configs/BUILD index 64d254dd1f8..9e3c8c39969 100644 --- a/showcases/simple_lifecycle/configs/BUILD +++ b/showcases/simple_lifecycle/configs/BUILD @@ -11,8 +11,5 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* exports_files([ - "hm_demo.json", - "lm_demo.json", - "cpp_supervised_app_demo.json", - "rust_supervised_app_demo.json", + "launch_manager_config.json" ]) diff --git a/showcases/simple_lifecycle/configs/cpp_supervised_app_demo.json b/showcases/simple_lifecycle/configs/cpp_supervised_app_demo.json deleted file mode 100644 index ba154982b5f..00000000000 --- a/showcases/simple_lifecycle/configs/cpp_supervised_app_demo.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "versionMajor": 8, - "versionMinor": 0, - "process": [], - "hmMonitorInterface": [ - { - "instanceSpecifier": "cpp_supervised_app", - "processShortName": "cpp_supervised_app", - "portPrototype": "Port", - "interfacePath": "lifecycle_cpp_supervised_app", - "refProcessIndex":0 - } - ] -} diff --git a/showcases/simple_lifecycle/configs/hm_demo.json b/showcases/simple_lifecycle/configs/hm_demo.json deleted file mode 100644 index f1dfa0121fb..00000000000 --- a/showcases/simple_lifecycle/configs/hm_demo.json +++ /dev/null @@ -1,165 +0,0 @@ -{ - "versionMajor": 8, - "versionMinor": 0, - "process": [ - { - "index": 0, - "shortName": "cpp_supervised_app", - "identifier": "cpp_supervised_app", - "processType": "REGULAR_PROCESS", - "refProcessGroupStates": [ - { - "identifier": "MainPG/Startup" - } - ], - "processExecutionErrors": [ - { - "processExecutionError": 1 - } - ] - }, - { - "index": 1, - "shortName": "rust_supervised_app", - "identifier": "rust_supervised_app", - "processType": "REGULAR_PROCESS", - "refProcessGroupStates": [ - { - "identifier": "MainPG/Startup" - } - ], - "processExecutionErrors": [ - { - "processExecutionError": 1 - } - ] - } - ], - "hmMonitorInterface": [ - { - "instanceSpecifier": "cpp_supervised_app", - "processShortName": "cpp_supervised_app", - "portPrototype": "Port", - "interfacePath": "lifecycle_cpp_supervised_app", - "refProcessIndex": 0, - "permittedUid": 0 - }, - { - "instanceSpecifier": "rust_supervised_app", - "processShortName": "rust_supervised_app", - "portPrototype": "Port", - "interfacePath": "lifecycle_rust_supervised_app", - "refProcessIndex": 1, - "permittedUid": 0 - } - ], - "hmSupervisionCheckpoint": [ - { - "shortName": "checkpoint_cpp_supervised_app", - "checkpointId": 1, - "refInterfaceIndex": 0 - }, - { - "shortName": "checkpoint_rust_supervised_app", - "checkpointId": 1, - "refInterfaceIndex": 1 - } - ], - "hmAliveSupervision": [ - { - "ruleContextKey": "AliveSupervision_cpp_supervised_app", - "refCheckPointIndex": 0, - "aliveReferenceCycle": 200.0, - "minAliveIndications": 1, - "maxAliveIndications": 4, - "isMinCheckDisabled": false, - "isMaxCheckDisabled": false, - "failedSupervisionCyclesTolerance": 1, - "refProcessIndex": 0, - "refProcessGroupStates": [ - { - "identifier": "MainPG/Startup" - } - ] - }, - { - "ruleContextKey": "AliveSupervision_rust_supervised_app", - "refCheckPointIndex": 1, - "aliveReferenceCycle": 100.0, - "minAliveIndications": 1, - "maxAliveIndications": 3, - "isMinCheckDisabled": false, - "isMaxCheckDisabled": false, - "failedSupervisionCyclesTolerance": 1, - "refProcessIndex": 1, - "refProcessGroupStates": [ - { - "identifier": "MainPG/Startup" - } - ] - }, - ], - "hmDeadlineSupervision": [], - "hmLogicalSupervision": [], - "hmLocalSupervision": [ - { - "ruleContextKey": "LocalSupervision_cpp_supervised_app", - "infoRefInterfacePath": "cpp_supervised_app", - "hmRefAliveSupervision": [ - { - "refAliveSupervisionIdx": 0 - } - ], - "hmRefDeadlineSupervision": [], - "hmRefLogicalSupervision": [] - }, - { - "ruleContextKey": "LocalSupervision_rust_supervised_app", - "infoRefInterfacePath": "rust_supervised_app", - "hmRefAliveSupervision": [ - { - "refAliveSupervisionIdx": 1 - } - ], - "hmRefDeadlineSupervision": [], - "hmRefLogicalSupervision": [] - } - ], - "hmGlobalSupervision": [ - { - "ruleContextKey": "GlobalSupervision_MainPG", - "isSeverityCritical": false, - "localSupervision": [ - { - "refLocalSupervisionIndex": 0 - }, - { - "refLocalSupervisionIndex": 1 - } - ], - "refProcesses": [ - { - "index": 0 - }, - { - "index": 1 - } - ], - "refProcessGroupStates": [ - { - "identifier": "MainPG/Startup" - } - ] - } - ], - "hmRecoveryNotification": [ - { - "shortName": "RecoveryNotification_MainPG", - "recoveryNotificationTimeout": 4000.0, - "processGroupMetaModelIdentifier": "MainPG/Recovery", - "refGlobalSupervisionIndex": 0, - "instanceSpecifier": "", - "shouldFireWatchdog": false - } - ] -} diff --git a/showcases/simple_lifecycle/configs/launch_manager_config.json b/showcases/simple_lifecycle/configs/launch_manager_config.json new file mode 100644 index 00000000000..1f9e1b87539 --- /dev/null +++ b/showcases/simple_lifecycle/configs/launch_manager_config.json @@ -0,0 +1,120 @@ +{ + "schema_version": 1, + "defaults": { + "deployment_config": { + "bin_dir": "/showcases/bin/", + "ready_recovery_action": { + "restart": { + "number_of_attempts": 1, + "delay_before_restart": 0.5 + } + }, + "sandbox": { + "uid": 0, + "gid": 0, + "supplementary_group_ids": [], + "scheduling_policy": "SCHED_OTHER", + "scheduling_priority": 1 + } + }, + "component_properties": { + "application_profile": { + "application_type": "Reporting", + "is_self_terminating": false, + "alive_supervision": { + "reporting_cycle": 0.1, + "min_indications": 1, + "max_indications": 3, + "failed_cycles_tolerance": 1 + } + }, + "depends_on": [], + "process_arguments": [], + "ready_condition": { + "process_state": "Running" + } + }, + "run_target": { + "transition_timeout": 5, + "recovery_action": { + "switch_run_target": { + "run_target": "fallback_run_target" + } + } + }, + "alive_supervision" : { + "evaluation_cycle": 0.5 + } + }, + "components": { + "state_manager": { + "description": "State Manager application", + "component_properties": { + "binary_name": "control_daemon", + "application_profile": { + "application_type": "State_Manager", + "alive_supervision": { + "min_indications": 0 + } + }, + "depends_on": [] + } + }, + "cpp_supervised_app": { + "component_properties": { + "binary_name": "cpp_supervised_app", + "application_profile": { + "application_type": "Reporting_And_Supervised" + }, + "process_arguments": [ + "-d50" + ] + }, + "deployment_config": { + "environmental_variables": { + "PROCESSIDENTIFIER": "cpp_supervised_app", + "CONFIG_PATH": "/showcases/data/simple_lifecycle/etc/hmproc_cpp_supervised_app.bin", + "IDENTIFIER": "cpp_supervised_app" + } + } + }, + "rust_supervised_app": { + "component_properties": { + "binary_name": "rust_supervised_app", + "application_profile": { + "application_type": "Reporting_And_Supervised" + }, + "process_arguments": [ + "-d50" + ] + }, + "deployment_config": { + "environmental_variables": { + "PROCESSIDENTIFIER": "rust_supervised_app", + "CONFIG_PATH": "/showcases/data/simple_lifecycle/etc/hmproc_rust_supervised_app.bin", + "IDENTIFIER": "rust_supervised_app" + } + } + } + }, + "run_targets": { + "Startup": { + "description": "Minimal functionality of the system", + "depends_on": ["cpp_supervised_app", "rust_supervised_app", "state_manager"], + "recovery_action": { + "switch_run_target": { + "run_target": "fallback_run_target" + } + } + } + }, + "initial_run_target": "Startup", + "fallback_run_target": { + "description": "Switching off everything", + "depends_on": ["state_manager"], + "transition_timeout": 1.5 + }, + "alive_supervision" : { + "evaluation_cycle": 0.5 + } +} \ No newline at end of file diff --git a/showcases/simple_lifecycle/configs/lm_demo.json b/showcases/simple_lifecycle/configs/lm_demo.json deleted file mode 100644 index 7c79e876a83..00000000000 --- a/showcases/simple_lifecycle/configs/lm_demo.json +++ /dev/null @@ -1,167 +0,0 @@ -{ - "versionMajor": 7, - "versionMinor": 0, - "Process": [ - { - "identifier": "control_daemon", - "uid": 0, - "gid": 0, - "path": "/showcases/bin/control_daemon", - "functionClusterAffiliation": "STATE_MANAGEMENT", - "numberOfRestartAttempts": 0, - "executable_reportingBehavior": "ReportsExecutionState", - "sgids": [], - "startupConfig": [ - { - "executionError": "1", - "schedulingPolicy": "SCHED_OTHER", - "schedulingPriority": "1", - "identifier": "control_daemon_startup_config", - "enterTimeoutValue": 1000, - "exitTimeoutValue": 1000, - "terminationBehavior": "ProcessIsNotSelfTerminating", - "executionDependency": [], - "processGroupStateDependency": [ - { - "stateMachine_name": "MainPG", - "stateName": "MainPG/Startup" - }, - { - "stateMachine_name": "MainPG", - "stateName": "MainPG/Recovery" - } - ], - "environmentVariable": [ - { - "key": "LD_LIBRARY_PATH", - "value": "/opt/lib" - }, - { - "key": "PROCESSIDENTIFIER", - "value": "control_daemon" - } - ], - "processArgument": [] - } - ] - }, - { - "identifier": "cpp_supervised_app", - "uid": 0, - "gid": 0, - "path": "/showcases/bin/cpp_supervised_app", - "numberOfRestartAttempts": 0, - "executable_reportingBehavior": "ReportsExecutionState", - "sgids": [], - "startupConfig": [ - { - "executionError": "1", - "schedulingPolicy": "SCHED_OTHER", - "schedulingPriority": "1", - "identifier": "demo_app_startup_config_0", - "enterTimeoutValue": 1000, - "exitTimeoutValue": 1000, - "terminationBehavior": "ProcessIsNotSelfTerminating", - "executionDependency": [], - "processGroupStateDependency": [ - { - "stateMachine_name": "MainPG", - "stateName": "MainPG/Startup" - } - ], - "environmentVariable": [ - { - "key": "LD_LIBRARY_PATH", - "value": "/usr/lib/" - }, - { - "key": "PROCESSIDENTIFIER", - "value": "cpp_supervised_app" - }, - { - "key": "CONFIG_PATH", - "value": "/showcases/data/simple_lifecycle/etc/cpp_supervised_app_demo.bin" - }, - { - "key": "IDENTIFIER", - "value": "cpp_supervised_app" - } - ], - "processArgument": [ - { - "argument": "-scpp_supervised_app" - } - ] - } - ] - }, - { - "identifier": "rust_supervised_app", - "uid": 0, - "gid": 0, - "path": "/showcases/bin/rust_supervised_app", - "numberOfRestartAttempts": 0, - "executable_reportingBehavior": "ReportsExecutionState", - "sgids": [], - "startupConfig": [ - { - "executionError": "1", - "schedulingPolicy": "SCHED_OTHER", - "schedulingPriority": "1", - "identifier": "demo_app_startup_config_1", - "enterTimeoutValue": 1000, - "exitTimeoutValue": 1000, - "terminationBehavior": "ProcessIsNotSelfTerminating", - "executionDependency": [], - "processGroupStateDependency": [ - { - "stateMachine_name": "MainPG", - "stateName": "MainPG/Startup" - } - ], - "environmentVariable": [ - { - "key": "LD_LIBRARY_PATH", - "value": "/usr/lib" - }, - { - "key": "PROCESSIDENTIFIER", - "value": "rust_supervised_app" - }, - { - "key": "CONFIG_PATH", - "value": "/showcases/data/simple_lifecycle/etc/rust_supervised_app_demo.bin" - }, - { - "key": "IDENTIFIER", - "value": "rust_supervised_app" - } - ], - "processArgument": [ - { - "argument": "-d50" - } - ] - } - ] - } - ], - "ModeGroup": [ - { - "identifier": "MainPG", - "initialMode_name": "Off", - "recoveryMode_name": "MainPG/Recovery", - "modeDeclaration": [ - { - "identifier": "MainPG/Off" - }, - { - "identifier": "MainPG/Startup" - }, - { - "identifier": "MainPG/Recovery" - } - ] - } - ] -} diff --git a/showcases/simple_lifecycle/configs/rust_supervised_app_demo.json b/showcases/simple_lifecycle/configs/rust_supervised_app_demo.json deleted file mode 100644 index 75367c6fb28..00000000000 --- a/showcases/simple_lifecycle/configs/rust_supervised_app_demo.json +++ /dev/null @@ -1,15 +0,0 @@ - -{ - "versionMajor": 8, - "versionMinor": 0, - "process": [], - "hmMonitorInterface": [ - { - "instanceSpecifier": "rust_supervised_app", - "processShortName": "rust_supervised_app", - "portPrototype": "Port", - "interfacePath": "lifecycle_rust_supervised_app", - "refProcessIndex":0 - } - ] -}