-
Notifications
You must be signed in to change notification settings - Fork 15
New configuration schema for Launch Manager #88
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
SimonKozik
wants to merge
17
commits into
eclipse-score:main
Choose a base branch
from
etas-contrib:feature/new_configuration_schema
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
17 commits
Select commit
Hold shift + click to select a range
5ad60d0
New configuration schema for Launch Manager
SimonKozik 415be1f
Adding first version of documentation for json schema
SimonKozik 1989e86
This schema is not yet in use, new folder name reflects this better
SimonKozik 63e45bd
New name should better reflect what is inside this folder
SimonKozik 596a732
Improve development setup documentation
SimonKozik 7ecce43
Changing mandatory configuration requirements
SimonKozik 346b7b5
Adaptations to reflect changes in previous commit
SimonKozik 75d558c
Fixing copyright headers
SimonKozik 31bb735
Changes introduced by 'bazel run //:format.fix'
SimonKozik 6a82242
Addressing review comment
SimonKozik 57ef0eb
Addressing review comments
SimonKozik 28cc1fc
Applying review suggestion
SimonKozik 6218342
Adding measurements units to the description strings
SimonKozik 7e332a9
Changing folder name as suggested in review comment
SimonKozik 1ed9d08
Removing multi-file version of the schema
SimonKozik 650a517
Moving schema file to the correct location
SimonKozik 0d32e09
Adapting remaining files to the latest's changes
SimonKozik 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| .. | ||
| # ******************************************************************************* | ||
| # 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 | ||
| # ******************************************************************************* | ||
|
|
||
|
|
||
| Launch Manager Configuration Schema | ||
| ################################### | ||
|
|
||
| This folder contains the Launch Manager configuration JSON Schema. The schema defines and validates the structure of Launch Manager configuration files. | ||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| This project manages the Launch Manager configuration schema as a single, self-contained file. When you need to modify or extend the schema, you should directly edit `s-core_launch_manager.schema.json`. | ||
|
|
||
| **Project Structure:** | ||
|
|
||
| :: | ||
|
|
||
| +-- s-core_launch_manager.schema.json # The Launch Manager schema. | ||
| +-- examples/ # Illustrative example configuration files for the schema. | ||
| +-- scripts/ # Utility scripts, including a validation tool. | ||
|
|
||
| Quick Start | ||
| *********** | ||
|
|
||
| For Users & Developers | ||
| ====================== | ||
|
|
||
| Whether you're validating a Launch Manager configuration against the schema, or actively developing and modifying the schema itself, here's how to interact with this project: | ||
|
|
||
| 1. **Locate the Schema:** The complete schema definition resides in ``s-core_launch_manager.schema.json``. | ||
| 2. **Explore Examples:** The ``examples/`` folder provides various sample Launch Manager configuration files. These are invaluable for understanding how the schema applies in practice and how to structure your own configurations. | ||
| 3. **Validate Your Configuration:** Use the provided validation script to check if your configuration file conforms to the schema: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| scripts/validate.py --schema s-core_launch_manager.schema.json --instance your_config.json | ||
|
|
||
| Examples | ||
| ******** | ||
|
|
||
| The ``examples`` folder contains a set of sample Launch Manager configuration files. Each example demonstrates valid configurations according to the ``s-core_launch_manager.schema.json``. | ||
|
|
||
| **Recommendation:** If you are new to Launch Manager configurations, **start by reviewing these examples**. They offer practical insight into the expected structure, available properties, and common use cases defined by the schema. | ||
|
|
||
| Scripts | ||
| ******* | ||
|
|
||
| The ``scripts`` folder houses utility scripts designed to assist with schema development. | ||
|
|
||
| validate.py | ||
| =========== | ||
|
|
||
| The ``validate.py`` script is a crucial tool for verifying that any given Launch Manager configuration instance adheres to the rules defined in `s-core_launch_manager.schema.json`. | ||
|
|
||
| **Usage:** | ||
|
|
||
| To validate a configuration file (e.g., `example_conf.json` from the `examples` folder) against the schema: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| scripts/validate.py --schema s-core_launch_manager.schema.json --instance examples/example_conf.json | ||
| Success --> examples/example_conf.json: valid | ||
|
|
||
| **When to use:** | ||
| * **During Development:** Run this script frequently whenever you're creating or modifying a Launch Manager configuration file. It provides immediate feedback on whether your changes are valid according to the schema. | ||
| * **Schema Development:** If you are making changes to `s-core_launch_manager.schema.json` itself, always run `validate.py` against the examples to ensure your schema changes haven't inadvertently broken existing, valid configurations. | ||
|
|
||
| Typical Workflow | ||
| **************** | ||
|
|
||
| For schema developers or those creating new configurations: | ||
|
|
||
| 1. **Modify** the ``s-core_launch_manager.schema.json`` file (if you're updating the schema definition) or your Launch Manager configuration file. | ||
| 2. **Validate** your changes using the `scripts/validate.py` script against relevant example files or your new configuration. This iterative process helps ensure compliance and catch errors early. |
170 changes: 170 additions & 0 deletions
170
src/launch_manager_daemon/config/config_schema/examples/example_conf.json
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,170 @@ | ||
| { | ||
| "schema_version": 1, | ||
| "defaults": { | ||
| "deployment_config": { | ||
| "ready_timeout": 0.5, | ||
| "shutdown_timeout": 0.5, | ||
| "environmental_variables": { | ||
| "LD_LIBRARY_PATH": "/opt/lib" | ||
| }, | ||
| "bin_dir": "/opt", | ||
| "working_dir": "/tmp", | ||
| "ready_recovery_action": { | ||
| "restart": { | ||
| "number_of_attempts": 0, | ||
| "delay_before_restart": 0 | ||
| } | ||
| }, | ||
| "recovery_action": { | ||
| "switch_run_target": { | ||
| "run_target": "Off" | ||
| } | ||
| }, | ||
| "sandbox": { | ||
| "uid": 1000, | ||
| "gid": 1000, | ||
| "supplementary_group_ids": [], | ||
| "scheduling_policy": "SCHED_OTHER", | ||
| "scheduling_priority": 0 | ||
| } | ||
| }, | ||
| "component_properties": { | ||
| "application_profile": { | ||
| "application_type": "Reporting_And_Supervised", | ||
| "is_self_terminating": false, | ||
| "alive_supervision": { | ||
| "reporting_cycle": 0.5, | ||
| "failed_cycles_tolerance": 2, | ||
| "min_indications": 1, | ||
| "max_indications": 3 | ||
| } | ||
| }, | ||
| "depends_on": [], | ||
| "process_arguments": [], | ||
| "ready_condition": { | ||
| "process_state": "Running" | ||
| } | ||
| }, | ||
| "run_target": { | ||
| "depends_on": [], | ||
| "transition_timeout": 5 | ||
| }, | ||
| "alive_supervision" : { | ||
| "evaluation_cycle": 0.5 | ||
| }, | ||
| "watchdog": { | ||
| "device_file_path": "/dev/watchdog", | ||
| "max_timeout": 2.0, | ||
| "deactivate_on_shutdown": true, | ||
| "require_magic_close": false | ||
| } | ||
| }, | ||
| "components": { | ||
| "setup_filesystem_sh": { | ||
| "description": "Script to mount partitions at the right directories", | ||
| "component_properties": { | ||
| "binary_name": "bin/setup_filesystem.sh", | ||
| "application_profile": { | ||
| "application_type": "Native", | ||
| "is_self_terminating": true | ||
| }, | ||
| "process_arguments": ["-a", "-b"], | ||
| "ready_condition": { | ||
| "process_state": "Terminated" | ||
| } | ||
| }, | ||
| "deployment_config": { | ||
| "bin_dir": "/opt/scripts" | ||
| } | ||
| }, | ||
| "dlt-daemon": { | ||
| "description": "Logging application", | ||
| "component_properties": { | ||
| "binary_name": "dltd", | ||
| "application_profile": { | ||
| "application_type": "Native" | ||
| }, | ||
| "depends_on": ["setup_filesystem_sh"] | ||
| }, | ||
| "deployment_config": { | ||
| "bin_dir" : "/opt/apps/dlt-daemon" | ||
| } | ||
| }, | ||
| "someip-daemon": { | ||
| "description": "SOME/IP application", | ||
| "component_properties": { | ||
| "binary_name": "someipd" | ||
| }, | ||
| "deployment_config": { | ||
| "bin_dir" : "/opt/apps/someip" | ||
| } | ||
| }, | ||
| "test_app1": { | ||
| "description": "Simple test application", | ||
| "component_properties": { | ||
| "binary_name": "test_app1", | ||
| "depends_on": ["dlt-daemon", "someip-daemon"] | ||
| }, | ||
| "deployment_config": { | ||
| "bin_dir" : "/opt/apps/test_app1" | ||
| } | ||
| }, | ||
| "state_manager": { | ||
| "description": "Application that manages life cycle of the ECU", | ||
| "component_properties": { | ||
| "binary_name": "sm", | ||
| "application_profile": { | ||
| "application_type": "State_Manager" | ||
| }, | ||
| "depends_on": ["setup_filesystem_sh"] | ||
| }, | ||
| "deployment_config": { | ||
| "bin_dir" : "/opt/apps/state_manager" | ||
| } | ||
| } | ||
| }, | ||
| "run_targets": { | ||
| "Minimal": { | ||
| "description": "Minimal functionality of the system", | ||
| "depends_on": ["state_manager"], | ||
| "recovery_action": { | ||
| "switch_run_target": { | ||
| "run_target": "Off" | ||
| } | ||
| } | ||
| }, | ||
| "Full": { | ||
| "description": "Everything running", | ||
| "depends_on": ["test_app1", "Minimal"], | ||
| "transition_timeout": 5, | ||
| "recovery_action": { | ||
| "switch_run_target": { | ||
| "run_target": "Minimal" | ||
| } | ||
| } | ||
| }, | ||
| "Off": { | ||
| "description": "Nothing is running", | ||
| "recovery_action": { | ||
| "switch_run_target": { | ||
| "run_target": "Off" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "alive_supervision" : { | ||
| "evaluation_cycle": 0.5 | ||
| }, | ||
| "fallback_run_target": { | ||
| "description": "Switching off everything", | ||
| "depends_on": [], | ||
| "transition_timeout": 1.5 | ||
| }, | ||
| "initial_run_target": "Minimal", | ||
| "watchdog": { | ||
| "device_file_path": "/dev/watchdog", | ||
| "max_timeout": 2, | ||
| "deactivate_on_shutdown": true, | ||
| "require_magic_close": false | ||
| } | ||
| } | ||
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.
How do we deal with different deployment configs e.g. for linux and qnx?
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.
I know that we were talking about this in the last review, but this is a bit harder to handle in the schema than it looks at first glance.
With current schema we should be able to create Linux specific configuration file and also QNX specific configuration file. If we accept this version as the alpha version of schema, we could proceed with API adaptation and we could have Run Target based LM soon.
As a next step we can have another story to work on differences between Linux and QNX configuration and see what adaptations to the schema we need.
Current version of the schema is already complicated and it would be beneficial to add additional functionality in stages.
Finger cross this is OK.
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.
Fine with me for the first version as long as we have it on the radar for the next version :-) For the next version it's a must then as we will have deployments for different OSes.