Skip to content

Support deployment_config/working_dir value#356

Open
TimoSteuerwaldETAS wants to merge 19 commits into
eclipse-score:mainfrom
etas-contrib:feature/honor-deployment-config-working-dir
Open

Support deployment_config/working_dir value#356
TimoSteuerwaldETAS wants to merge 19 commits into
eclipse-score:mainfrom
etas-contrib:feature/honor-deployment-config-working-dir

Conversation

@TimoSteuerwaldETAS

@TimoSteuerwaldETAS TimoSteuerwaldETAS commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

This fixes #343 .
Furthermore the config mapping tests have been fixed and are executed on the pipeline.
A feature integration test has been also added which is testing various options, not only working dir.

@github-actions

github-actions Bot commented Jul 23, 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: c7a50f44-4a2f-463c-8b52-050802b3a4c6
Computing main repo mapping: 
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: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

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

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

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

Analyzing: target //:license-check (143 packages loaded, 2352 targets configured)

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

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

Analyzing: target //:license-check (161 packages loaded, 5547 targets configured)

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

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

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

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

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

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[7 / 15] Creating runfiles tree bazel-out/k8-fastbuild/bin/license.check.license_check.runfiles; 0s local ... (2 actions, 1 running)
[13 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
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: 29.313s, Critical Path: 2.79s
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

Comment thread patches/score_itf_docker_cap_add.patch Outdated
environment=_docker_configuration["environment"],
volumes=_docker_configuration["volumes"],
shm_size=_docker_configuration["shm_size"],
+ privileged=_docker_configuration.get("privileged", False),

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.

Any plan to bring these changes to ITF repo?

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.

Something similar is already there. Because today the itf_score version has been increased to 0.5.0, I reverted the patch.

if "initial_run_target" in config or "initial_run_target" in merged_defaults:
new_config["initial_run_target"] = config.get(
"initial_run_target", merged_defaults.get("initial_run_target")
)

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 this change it redundant. There is a validation that ensures that initial_run_target must always be defined (to Startup state)

"working_dir": depl_cfg["working_dir"],
# Default the working directory to bin_dir (the directory the
# executable lives in) when not set explicitly.
"working_dir": depl_cfg.get("working_dir", depl_cfg["bin_dir"]),

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.

This decision to use bin_dir as default exists in two different places, can this be moved to a single function (e.g. get_working_dir)?

],
"security_policy_details": "policy_name",
"number_of_restart_attempts": 1,
"working_dir": "/tmp",

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.

Could you adapt one of the configs so that we have all cases covered?

  1. Taking the default working dir (as bin dir)
  2. Setting the working_dir in the defaults section
  3. Setting the working dir explicitly on the component (overwriting the default)

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.

Done.

@@ -35,6 +36,8 @@ def run_until_file_deployed(
:param file_path: path of the file to wait for on the target.
:param timeout_s: maximum seconds to wait for the file (default: 30).
:param poll_interval_s: seconds between file-existence checks (default: 0.5).

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 update the documentation that poll_interval_s is also used to poll process state

time.sleep(poll_interval_s)

assert not proc.is_running(), (
f"LCM still running {stop_timeout_s}s after SIGTERM"

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 happens to other tests when the Process does not shutdown on receiving SIGTERM?
Is the process then killed with -9 to force termination so the next tests are not affected by this?

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.

I have added a kill -9 to not influence other tests.

Comment thread tests/integration/sandbox_options/BUILD Outdated
load("//tests/utils/bazel:integration.bzl", "integration_test")

exports_files(
["lm_demo.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.

I don't understand where is this file and why is it visible for examples folder?

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.

Me neither. Removed.

case SCHED_FIFO:
return "SCHED_FIFO";
case SCHED_RR:
return "SCHED_RR";

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 SCHED_RR was not tested.


const uid_t expected_uid = 666;
const gid_t expected_gid = 666;
const std::array<gid_t, 3> expected_supp_groups = {123, 321, 456};

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 we cover at least the cases:

  • No supplementary group ids configured
  • Some supplementary group ids configured

const uid_t expected_uid = 666;
const gid_t expected_gid = 666;
const std::array<gid_t, 3> expected_supp_groups = {123, 321, 456};
const std::string expected_cwd = "/tmp";

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 we should at least cover the cases:

  • A specific working_dir configured
  • The default working_dir is used

{
bool all_pass = true;

const uid_t expected_uid = 666;

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 this be a reusable process, where you pass the expected values via CLI flags?

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.

Sure. Fixed.

TEST_STEP("Activate RunTarget Startup")
{
score::cpp::stop_token stop_token;
auto result = client.ActivateRunTarget("Startup").Get(stop_token);

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.

Launch Manager goes to Startup by default. I think this is redundant.
Looks like we can remove the whole control_daemon_mock from this test

"gid": 666,
"supplementary_group_ids": [123, 321, 456],
"scheduling_policy": "SCHED_FIFO",
"scheduling_priority": 10

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 we should also assert some default priority if not configured

Copied smoke test and renamed accordingly.
Allow execution of sched_setscheduler call by adding SYS_NICE capability to the docker environment
With new version 0.5.0 this is no longer needed.
@TimoSteuerwaldETAS
TimoSteuerwaldETAS force-pushed the feature/honor-deployment-config-working-dir branch from dad60c7 to 71264de Compare July 24, 2026 09:45
Two test modifications:
- If no working_dir is defined, bin directory is used.
- A working dir defined on deployment config level can be overridden on component level
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.

[launch_manager] Honor deployment_config.working_dir as the spawned process cwd

2 participants