Skip to content

Launch Manager loads the new configuration file#248

Open
paulquiring wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:feature/lm-use-new-configuration
Open

Launch Manager loads the new configuration file#248
paulquiring wants to merge 1 commit into
eclipse-score:mainfrom
etas-contrib:feature/lm-use-new-configuration

Conversation

@paulquiring

@paulquiring paulquiring commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
  • Map user-facing json config to the new flatbuffer config
  • Load new launch manager config
  • Introduce adapters to make the rest of the code work with the new configuration content
  • Changes are avaible using --//config:use_new_configuration=True

Closes: #209

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

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.6.0) and connecting to it...
INFO: Invocation ID: 2910de83-6173-41d1-8ead-28f84225e62c
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (36 packages loaded, 10 targets configured)

Analyzing: target //:license-check (129 packages loaded, 118 targets configured)

Analyzing: target //:license-check (152 packages loaded, 5481 targets configured)

Analyzing: target //:license-check (160 packages loaded, 6596 targets configured)

Analyzing: target //:license-check (163 packages loaded, 8263 targets configured)

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

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

Analyzing: target //:license-check (167 packages loaded, 10159 targets configured)

Analyzing: target //:license-check (168 packages loaded, 10283 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.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: 21.894s, Critical Path: 2.13s
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>]

Comment thread scripts/config_mapping/lifecycle_config.py
@paulquiring paulquiring marked this pull request as ready for review June 16, 2026 08:02
Comment thread score/launch_manager/daemon/src/configuration/configuration_adapter.cpp Outdated
Comment thread score/launch_manager/daemon/src/configuration/configuration_adapter.hpp Outdated
Comment thread score/launch_manager/daemon/src/main.cpp Outdated
@S-MOHAMD

Copy link
Copy Markdown
Contributor

Please lnk corresponding issue/bug.
see: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue

@paulquiring paulquiring force-pushed the feature/lm-use-new-configuration branch from f13cffe to eb807a1 Compare June 18, 2026 08:28
@github-actions

Copy link
Copy Markdown

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

@NicolasFussberger NicolasFussberger moved this from Backlog to In Progress in LCM - Lifecycle & Health FT Jun 18, 2026
@paulquiring paulquiring force-pushed the feature/lm-use-new-configuration branch from cd95b35 to c2e120c Compare June 18, 2026 11:42
bool is_sup = (props.application_profile.application_type == ApplicationType::ReportingAndSupervised ||
props.application_profile.application_type == ApplicationType::StateManager);
if (is_sup && env_index < static_cast<size_t>(score::lcm::internal::kMaxEnv)) {
std::string iface_path = "LCM_ALIVE_INTERFACE_PATH=" + score::lcm::internal::aliveInterfacePath(comp.name);

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.

we could also add a constant for the env name

? score::lcm::ProcessState::kRunning
: score::lcm::ProcessState::kTerminated;
}
}

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.

here is a possible error case. In case the configured dependency does not actually exist

pgm.number_of_restart_attempts = deploy.ready_recovery_action->number_of_attempts;
}

for (const auto& dep_name : props.depends_on) {

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.

depends_on might also contain a run_target and not only a component.
Special Case: This may be also the fallback_run_target

}
}
auto rt_it = run_target_by_name.find(dep_name);
if (rt_it != run_target_by_name.end()) {

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.

I think depends_on might also refer to fallback_run_target which is currently not in the run_target_by_name map

run_target_by_name[rt.name] = &rt;
}

std::map<std::string, const ComponentConfig*> component_by_name;

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.

component_by_name exists twice in this class

std::set<std::string>& visited) {
if (!visited.insert(dep_name).second) return;
auto comp_it = component_to_process_index.find(dep_name);
if (comp_it != component_to_process_index.end()) {

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.

There might be some possible error cases when component/runTarget names are not found because they have not been configured

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.

Maybe we keep the current validation in the python script and just put asserts in the code for these error cases

component_by_name[comp.name] = &comp;
}

std::function<void(const std::string&, std::vector<uint32_t>&, std::set<std::string>&)> resolve_depends;

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.

Maybe it could make sense to have a dedicated Visitor class for this

}

void ConfigurationAdapter::resolveDependencyIndexes(std::vector<OsProcess>& processes) {
for (auto& proc : processes) {

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.

Is this needed?

component_by_name[comp.name] = &comp;
}

std::map<std::string, uint32_t> component_to_process_index;

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.

should we build these maps once during initialize and store them as private member?

if (pg) {
if (index < pg->processes_.size()) {
return pg;
}

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.

does not make sense to validate the index here


static const uint32_t kDefaultProcessExecutionError;
static uint32_t kDefaultProcessorAffinityMask();
static const int32_t kDefaultSchedulingPolicy;

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.

These defaults seem obsolete now

- Load new launch manager config
- Introduce adapters to make the rest of the code work with the new configuration content
- Changes are avaible using --//config:use_new_configuration=True
Comment thread config/BUILD
bool_flag(
name = "use_new_configuration",
build_setting_default = False,
visibility = ["//visibility:public"],

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.

Should we make this visibility private?
I assume this is an internal flag for development

/// @return Pointer to the ConfigurationManager object.
ConfigurationManager* getConfigurationManager();
/// @brief Gets the configuration.
/// @return Pointer to the configuration object.

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.

I guess this belongs to ConfigurationType* getConfiguration(); from above

new_config["initial_run_target"] = config["initial_run_target"]

if "fallback_run_target" in config:
fallback_defaults = {

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.

what was the reason for not having this in the default dictionary at the top?

deployment = {
"ready_timeout": depl_cfg["ready_timeout"],
"shutdown_timeout": depl_cfg["shutdown_timeout"],
"bin_dir": depl_cfg.get("bin_dir", "/opt"),

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.

There are already defaults for bin_dir and working_dir.
I wonder if we should avoid repeating this here.

}

watchdog_config = config.get("watchdog", {})
if watchdog_config and "device_file_path" in watchdog_config:

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.

I wonder why checking specifically for device_file_path?
Ideally, device_file_path and max_timeout should be mandatory in the schema if a watchdog is defined at all. But currently, it is not.



def output_filename(input_filename):
return "launch_manager_config_gen.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.

Can we make this depending on the input filename?

schema = ctx.file.schema
script = ctx.executable.script
json_out_dir = ctx.attr.json_out_dir
use_new_format = ctx.attr.use_new_format

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.

Would it be possible to simplify the variant handling here to just always generate all the configs?
The naming should never conflict as we have fixed names for the old config.

Then we are able to have the test cases for the config generation valid for both old and new config until the old config is removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Migrate Launch Manager from the reading the old configuration file format to the new format

4 participants