Skip to content

Launch Manager supports the new configuration format#110

Merged
NicolasFussberger merged 91 commits intoeclipse-score:mainfrom
etas-contrib:feature/support_new_launch_manager_config
Mar 23, 2026
Merged

Launch Manager supports the new configuration format#110
NicolasFussberger merged 91 commits intoeclipse-score:mainfrom
etas-contrib:feature/support_new_launch_manager_config

Conversation

@NicolasFussberger
Copy link
Copy Markdown
Contributor

Summary

This PR introduces a mapping of the new configuration schema to the existing configuration format. Therefore, allowing users to configure the launch_manager using the simpler configuration format. This approach is depicted here.

The configuration interface is a bazel function that validates the json configuration, maps the new configuration content to the existing configuration files that are in use by the C++ implementation. Note: This PR is not yet adapting the C++ code to load the new configuration directly, but instead it maps the new configuration to the old configuration format so the existing code keeps working as-is.

Usage Example from the reference_integration perspective:

load("@score_lifecycle_health//:defs.bzl", "launch_manager_config")
launch_manager_config(
    name ="lifecycle_configs",
    config="//showcases/simple_lifecycle/configs:launch_manager_config.json"
)

Details

  • Introduces bazel function launch_manager_config, allowing users to easily make use of the new configuration
  • Introduces an internal mapping script in python lifecycle_config.py, taking as input the new configuration file and generating as output the same content in the existing configuration format (i.e. mapping of RunTarget -> ProcessGroup States). See the Readme at scripts/config_mapping/Readme.md for details
  • Adapt the ControlClient API to change RunTarget instead of ProcessGroup States (internal mapping to ProcessGroup States)
  • Adapt existing examples and smoketest to use the new configuration format

Closes: #38

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 10, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.4.2) and connecting to it...
INFO: Invocation ID: b949cf98-1998-4493-8d65-12ff4ae48af5
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (54 packages loaded, 9 targets configured)

Analyzing: target //:license-check (89 packages loaded, 9 targets configured)

Analyzing: target //:license-check (145 packages loaded, 2642 targets configured)

Analyzing: target //:license-check (153 packages loaded, 6208 targets configured)

Analyzing: target //:license-check (156 packages loaded, 7855 targets configured)

Analyzing: target //:license-check (164 packages loaded, 7895 targets configured)

Analyzing: target //:license-check (165 packages loaded, 7901 targets configured)

Analyzing: target //:license-check (165 packages loaded, 7901 targets configured)

Analyzing: target //:license-check (166 packages loaded, 7901 targets configured)

Analyzing: target //:license-check (169 packages loaded, 9913 targets configured)

INFO: Analyzed target //:license-check (170 packages loaded, 10039 targets configured).
[11 / 16] Creating runfiles tree bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/score_tooling+/dash/tool/formatters/dash_format_converter.runfiles [for tool]; 0s local
[13 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox
[15 / 16] [Prepa] Building license.check.license_check.jar ()
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 26.364s, Critical Path: 2.51s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

FScholPer
FScholPer previously approved these changes Mar 13, 2026
Copy link
Copy Markdown
Contributor

@pawelrutkaq pawelrutkaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSON files as test files are a bit bloat, maintaining them may be harsh. Maybe it would be better to have that in code and copose configs from well defined pieces.

nothing worrying, but next time it would be good to keep PR smaller.

#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
exports_files(["s-core_launch_manager.schema.json"])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove s-core from name. makse no sens imho. and it even wors with - and _ mixup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we move the renaming to the other open PR regarding configuration schema then it can directly be changed consistently everywhere


ControlClient::ControlClient(std::function<void(const score::lcm::ExecutionErrorEvent&)> undefinedStateCallback) noexcept {
ControlClient::ControlClient() noexcept {
static std::function<void(const score::lcm::ExecutionErrorEvent&)> undefinedStateCallback = [](const score::lcm::ExecutionErrorEvent& event) {};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why static fn and not simply lambda ?

Copy link
Copy Markdown
Contributor Author

@NicolasFussberger NicolasFussberger Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess lambda is equally fine. I can change it to lambda if you prefer that.
The idea here was merely to hardcode this callback to an empty callback for now to align the interface with the existing documentation.
After further discussion on how the API should look like, we can then either delete this or refactor.

#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
def _impl_run_examples(ctx):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we just dont use sh_ or genrule ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got rid of bzl file and replaced it with sh_binary

FScholPer
FScholPer previously approved these changes Mar 19, 2026
@NicolasFussberger
Copy link
Copy Markdown
Contributor Author

The JSON files as test files are a bit bloat, maintaining them may be harsh. Maybe it would be better to have that in code and copose configs from well defined pieces.

nothing worrying, but next time it would be good to keep PR smaller.

Regarding the JSON files. I agree it will not scale well. Currently, there are only few basic tests, because this configuration mapping is only temporary and the next step will be to read in the new config directly from the C++ code. I would expect we do some fine tuning of the new configuration and once we are happy we change the C++ code and the python script and its tests will all be obsolete.

@pawelrutkaq
Copy link
Copy Markdown
Contributor

@eelcoem branch need to be up to date

@eelcoem
Copy link
Copy Markdown
Contributor

eelcoem commented Mar 20, 2026

@eelcoem branch need to be up to date

Done

@eelcoem eelcoem temporarily deployed to workflow-approval March 20, 2026 12:54 — with GitHub Actions Inactive
@eelcoem eelcoem had a problem deploying to workflow-approval March 23, 2026 06:27 — with GitHub Actions Failure
@NicolasFussberger
Copy link
Copy Markdown
Contributor Author

QNX x86 build fails due to download timeout, however the qnx arm build was successful.

Error in download_and_extract: java.io.IOException: Error downloading [https://www.qnx.com/download/download/79858/installation.tgz] to /home/runner/.bazel/external/score_bazel_cpp_toolchains++gcc+score_qcc_x86_64_toolchain_pkg/temp12311846832469847643/installation.tgz: Connect timed out
ERROR: no such package '@@score_bazel_cpp_toolchains++gcc+score_qcc_x86_64_toolchain_pkg//': java.io.IOException: Error downloading [https://www.qnx.com/download/download/79858/installation.tgz] to /home/runner/.bazel/external/score_bazel_cpp_toolchains++gcc+score_qcc_x86_64_toolchain_pkg/temp12311846832469847643/installation.tgz: Connect timed out

@NicolasFussberger NicolasFussberger merged commit 757d17d into eclipse-score:main Mar 23, 2026
18 of 22 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in LCM - Lifecycle & Health FT Mar 23, 2026
SimonKozik added a commit to etas-contrib/score_lifecycle that referenced this pull request Mar 24, 2026
* Basic python setup for mapping script

* Add latest example configuration

* Merging of default values

* Basic smoketest for defaults preprocessing

* Start to map PHM configuration

* Separate unit and integration tests

* Document mapping decisions and initial known limitations

* Copy dict only internally when merging defaults

* Initial mapping of hm configuration

* Treat StateManager supervision same as other supervisions

* Fix time unit and some flatbuffer schema violations

* basic Integration test for health configuration

* Better nameing of env vars in unit test

* Configs for health integration test

* Start work

* Almost done

* Add validation and update sample configs

* Add health test for empty config

* Update Readme file with validation info

* Continue config mapping script

* Cleanup

* Fix error in mapping script

* Minor fixes

* Cleanup

* Prevent cyclic dependencies

* First changes

* Cleanup

* Undo some changes

* Undo some changes

* Bazel command for lifecylce config gen

* Undo more changes, fix out of range

* Config generation working without pip dependency

* More cleanup

* Export jsonschema python dependency

* Fix python formatting

* Adapt expected output to file renaming

* Make shortName required

* Update Readme file with bazel interface

* Move script to tests folder

* Initial version of the new API

* Remove flatbuffer script

* Address reviewer comments

* Adapt ControlClient implementation to new API

* Update health config integration test

* Fix merge error in MODULE.bazel

* Adapt examples to use the bazel config generation

* Start demo via bazel target

* Merge different pip environments

* Add some custom validation rules

* Migrate smoketest to new configuration

* More integration tests

* Revert debugging changes

* Fix example scenario configuration

* Correct smoketest configuration

* Revert more debugging changes

* Fix crash

* Remove temporary schema file

* Update readme file

* Clarify that certain attributes will be ignored

* Use lowercase name for watchdog

* Run config tests via bazel

* Define central lifecycle bazel rules

* Add progress message to bazel function

* Make pip environment a proper dependency

This environment is used in the public bazel function for config
generation

* Improve error message

* Remove obsolete config scripts

* Fix formatting

* Fix copyright headers

* Tidy MODULE.bazel file

* Improve schema validation error message

* Fix formatting

* Use defined default values in configuration mapping

* Simplify bazel example runner

---------

Co-authored-by: Empting Eelco (ETAS-ECM/XPC-Fe2) <Eelco.Empting2@etas.com>
Co-authored-by: Eelco Empting <158553993+eelcoem@users.noreply.github.com>
Co-authored-by: SimonKozik <244535158+SimonKozik@users.noreply.github.com>
Co-authored-by: Paul Quiring <paul.quiring@etas.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Configuration concept

7 participants