-
Notifications
You must be signed in to change notification settings - Fork 31
Support deployment_config/working_dir value #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TimoSteuerwaldETAS
wants to merge
20
commits into
eclipse-score:main
Choose a base branch
from
etas-contrib:feature/honor-deployment-config-working-dir
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
393f902
Add stub for test sandbox options
TimoSteuerwaldETAS a254a36
First attempt with opencode
TimoSteuerwaldETAS 6f88fba
Patch the docker environment
TimoSteuerwaldETAS d78fca5
Update known_limitations.rst
TimoSteuerwaldETAS 36e549c
Finish support for setting the working dir
TimoSteuerwaldETAS 3ef7843
Stabilize utility function
TimoSteuerwaldETAS 875a710
Fix config mapping tests
TimoSteuerwaldETAS afe9c25
Add config mapping tests to the pipeline
TimoSteuerwaldETAS 84b46af
Add check for scheduling priority / policy
TimoSteuerwaldETAS 5af9455
Remove not needed debug files
TimoSteuerwaldETAS 5bed47f
Tiny modifications and comment
TimoSteuerwaldETAS e74176a
Remove double replacement if working_dir is not set
TimoSteuerwaldETAS 04fe95e
Fix formatting
TimoSteuerwaldETAS 71264de
Revert no longer needed patch for score_itf
TimoSteuerwaldETAS ba851bb
Test different variations of working_dir presence
TimoSteuerwaldETAS 48a1f65
Parameterize sandbox_options_process executable
TimoSteuerwaldETAS c48cf0b
Remove exports_files, which has been added by fault
TimoSteuerwaldETAS 0af6e77
kill with SIGKILL
TimoSteuerwaldETAS fc60ca6
Test more scheduling params
TimoSteuerwaldETAS f49fd5f
Introduce get_working_dir
TimoSteuerwaldETAS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,14 @@ | ||
| exports_files(["hedron_compile_commands_env_vars.patch"]) | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| exports_files(["score_bazel_tools.patch"]) | ||
|
|
||
| exports_files(["score_bazel_tools_python.patch"]) | ||
| exports_files(glob(["*.patch"])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ | |
| script_dir.parent.parent | ||
| / "score" | ||
| / "launch_manager" | ||
| / "src" | ||
| / "daemon" | ||
| / "src" | ||
| / "configuration" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,6 @@ | |
| "shutdown_timeout": 0.5, | ||
| "environmental_variables": {}, | ||
| "bin_dir": "/opt", | ||
| "working_dir": "/tmp", | ||
| "ready_recovery_action": { | ||
| "restart": { | ||
| "number_of_attempts": 0, | ||
|
|
@@ -108,6 +107,14 @@ def get_recovery_process_group_state(config): | |
| def sec_to_ms(sec: float) -> int: | ||
| return int(sec * 1000) | ||
|
|
||
| def get_working_dir(deployment_config): | ||
| """ | ||
| Get the working directory for a component. If not specified, default to the bin_dir. | ||
| """ | ||
| return deployment_config.get( | ||
| "working_dir", deployment_config["bin_dir"] | ||
| ) | ||
|
|
||
|
|
||
| def preprocess_defaults(global_defaults, config): | ||
| """ | ||
|
|
@@ -185,9 +192,13 @@ def dict_merge_recursive(dict_a, dict_b): | |
| merged_defaults["watchdog"], config.get("watchdog", {}) | ||
| ) | ||
|
|
||
| new_config["initial_run_target"] = config.get( | ||
| "initial_run_target", merged_defaults["initial_run_target"] | ||
| ) | ||
| # Only emit initial_run_target when it can be derived from the input config | ||
| # or the defaults. This keeps preprocess_defaults usable with minimal | ||
| # defaults that don't define run-target keys. | ||
| 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") | ||
| ) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) |
||
|
|
||
| if "fallback_run_target" in config: | ||
| fallback_defaults = { | ||
|
|
@@ -289,7 +300,9 @@ def gen_config(output_dir, config, input_filename, schema_version=None): | |
| "ready_timeout": depl_cfg["ready_timeout"], | ||
| "shutdown_timeout": depl_cfg["shutdown_timeout"], | ||
| "bin_dir": depl_cfg["bin_dir"], | ||
| "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": get_working_dir(depl_cfg), | ||
| "sandbox": sandbox_out, | ||
| } | ||
|
|
||
|
|
@@ -668,6 +681,7 @@ def get_terminating_behavior(component_config): | |
| process["number_of_restart_attempts"] = component_config["deployment_config"][ | ||
| "ready_recovery_action" | ||
| ]["restart"]["number_of_attempts"] | ||
| process["working_dir"] = get_working_dir(component_config["deployment_config"]) | ||
|
|
||
| match component_config["component_properties"]["application_profile"][ | ||
| "application_type" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
| load("@rules_cc//cc:defs.bzl", "cc_binary") | ||
| load("//tests/utils/bazel:integration.bzl", "integration_test") | ||
|
|
||
| cc_binary( | ||
| name = "control_daemon_mock", | ||
| srcs = ["control_daemon_mock.cpp"], | ||
| data = [], | ||
| deps = [ | ||
| "//score/launch_manager:control_cc", | ||
| "//score/launch_manager:lifecycle_cc", | ||
| "//tests/utils/test_helper", | ||
| "@googletest//:gtest_main", | ||
| ], | ||
| ) | ||
|
|
||
| # Two binaries are built from the same source. Each verifies the sandbox options passed to it on | ||
| # the command line (see sandbox_options.json), and derives its GTest XML result file name from its | ||
| # own executable name so the results do not collide. | ||
| cc_binary( | ||
| name = "sandbox_options_process_a", | ||
| srcs = ["sandbox_options_process.cpp"], | ||
| deps = [ | ||
| "//score/launch_manager:control_cc", | ||
| "//score/launch_manager:lifecycle_cc", | ||
| "//tests/utils/test_helper", | ||
| "@googletest//:gtest_main", | ||
| ], | ||
| ) | ||
|
|
||
| cc_binary( | ||
| name = "sandbox_options_process_b", | ||
| srcs = ["sandbox_options_process.cpp"], | ||
| deps = [ | ||
| "//score/launch_manager:control_cc", | ||
| "//score/launch_manager:lifecycle_cc", | ||
| "//tests/utils/test_helper", | ||
| "@googletest//:gtest_main", | ||
| ], | ||
| ) | ||
|
|
||
| integration_test( | ||
| name = "sandbox_options", | ||
| srcs = ["sandbox_options.py"], | ||
| binaries = [ | ||
| ":control_daemon_mock", | ||
| ":sandbox_options_process_a", | ||
| ":sandbox_options_process_b", | ||
| "//score/launch_manager", | ||
| ], | ||
| config = ":sandbox_options.json", | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is adding this to the old
lm_flatcfg.fbshowever we are converting to the new schema inscore/launch_manager/src/daemon/src/configuration/details/new_lm_flatcfg.fbsI think we can make this change just for the new config and not edit the old.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing for the loader code in
score/launch_manager/src/daemon/src/configuration/