Skip to content
Open
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
2 changes: 1 addition & 1 deletion bazel_common/score_modules_target_sw.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)

Expand Down
2 changes: 1 addition & 1 deletion known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 18 additions & 0 deletions showcases/simple_lifecycle/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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 = [
Expand All @@ -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"],
)
1 change: 1 addition & 0 deletions showcases/simple_lifecycle/configs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
exports_files([
"launch_manager_config.json",
"logging.json",
"mw_com_config.json",
])
12 changes: 6 additions & 6 deletions showcases/simple_lifecycle/configs/launch_manager_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"ready_recovery_action": {
"restart": {
"number_of_attempts": 1,
"delay_before_restart": 0.5
"delay_before_restart_ms": 500
}
},
"sandbox": {
Expand All @@ -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
Expand All @@ -35,15 +35,15 @@
}
},
"run_target": {
"transition_timeout": 5,
"transition_timeout_ms": 5000,
"recovery_action": {
"switch_run_target": {
"run_target": "fallback_run_target"
}
}
},
"alive_supervision" : {
"evaluation_cycle": 0.5
"evaluation_cycle_ms": 500
}
},
"components": {
Expand Down Expand Up @@ -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
}
}
100 changes: 100 additions & 0 deletions showcases/simple_lifecycle/configs/mw_com_config.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
Loading