New configuration schema for Launch Manager#88
New configuration schema for Launch Manager#88SimonKozik wants to merge 13 commits intoeclipse-score:mainfrom
Conversation
Make initial_run_target mandatory, to force users to explicitly specify system startup behavior. Remove recovery_action requirement from run_target type, as meaningful defaults are difficult to define and enforcement should occur outside the schema.
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
| "type": "object", | ||
| "description": "Defines the configuration parameters used for alive monitoring of the component.", | ||
| "properties": { | ||
| "reporting_cycle": { |
There was a problem hiding this comment.
i would encode unit in key like _ms or sth. But this will come from API so shall not be here really or ?
There was a problem hiding this comment.
I would prefer to avoid having measurement units as part of the name.
In my experience this doesn't works well long term.
As part of configuration documentation, which will follow in another PR, we will explain that all time periods are defined in seconds. If somebody needs to have something smaller, they can use decimal point.
Just to illustrate:
- Delay of 1h
- "delay": 3600
- Delay of 2 milliseconds
- "delay": 0.002
- Delay of 5 microseconds
- "delay": 0.000005
This should scale well and age well IMHO
There was a problem hiding this comment.
Still for me 3600 looks like 3.6 sec and 0.002 as broken config (for me, timeouts always default to ms, not s, and decimal points, additionally, is 0.00000004 valid or not ? ;) ) ;] Having to read documentation for everything makse things just sad
There was a problem hiding this comment.
From the schema point of view it would be strange to hard code units in the name. Let's us imagine that we all agree that millisecond will be the way to go. Let's also assume that few years from now, somebody concludes that this is not precise enough and we should use nanoseconds. After all even POSIX is using nanoseconds (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html).
At this point in time you will need to change name. If you specify time in seconds (as the SI system does: https://en.wikipedia.org/wiki/International_System_of_Units) then it is user decision on how precise they would like to be. If implementation (and hardware) can handle this, then there is no problem. Otherwise some rounding will need to happen.
Additionally you will need to have a specific naming convention to denote units in time, otherwise this will diverge over the time. Please consider following:
- delay_ms
- delayMilliseconds
- delay_milliseconds
Governing this over time will become harder as configuration will grow.
However the point about the need to read documentation is valid. Unfortunately there is no perfect solution for this... JSON schema doesn't allow you to specify units of measurements out of the box. You can do this through JSON Schema Symbols, but we would need to assume that tooling used for validation, supports extension vocabulary. And I'm not sure we can make this assumption.
However we can update description to clearly state that configuration is in seconds. For example
"description": "Specifies the length of the time window (in seconds) used to assess incoming alive supervision reports."
We can also apply this for other measurement units we have.
There was a problem hiding this comment.
I know, as said to me not that obvious but i am fine with explanation ;]
There was a problem hiding this comment.
can we then at least add the unit to the description string
There was a problem hiding this comment.
As promised above, description units are documented in this commit: 6218342
...nager_daemon/config/future_config_schema/draft_schema/types/component_properties.schema.json
Outdated
Show resolved
Hide resolved
...nager_daemon/config/future_config_schema/draft_schema/types/component_properties.schema.json
Outdated
Show resolved
Hide resolved
| "type": "object", | ||
| "description": "Defines the configuration parameters used for alive monitoring of the component.", | ||
| "properties": { | ||
| "reporting_cycle": { |
There was a problem hiding this comment.
can we then at least add the unit to the description string
...nager_daemon/config/future_config_schema/draft_schema/types/component_properties.schema.json
Outdated
Show resolved
Hide resolved
| "deployment_config": { | ||
| "bin_dir" : "/opt/apps/dlt-daemon" | ||
| } |
There was a problem hiding this comment.
How do we deal with different deployment configs e.g. for linux and qnx?
There was a problem hiding this comment.
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.
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.
| @@ -0,0 +1,223 @@ | |||
| #!/usr/bin/env python3 | |||
There was a problem hiding this comment.
I really would like to see some bazel rules for bundling the final schema instead of checking in the "published_schema".
There was a problem hiding this comment.
I just confirmed with my colleagues, that bazel integration is already half way done and will be part of another PR.
This PR will introduce automatic way to create flat buffer configuration files. This automation will include step to validate configuration against LM schema.
Please note that the next PR will also bring API changes, so you could use Run Targets from the user side.
| This project uses a **two-folder approach** for schema management: | ||
|
|
||
| - ``draft_schema/`` - Multi-file schema structure for active development | ||
| - ``published_schema/`` - Single-file schema for end-user consumption |
There was a problem hiding this comment.
as mentioned above. We shouldn't check in generated artifacts unless absolutely needed.
There was a problem hiding this comment.
It is a difficult question IMHO.
On one hand the size and the degree of the complexity of this schema, just lend itself to a multi-file setup. I started with a single-file schema, but in the middle of development, after applying review comments, I just moved to multi-file setup. It is much easier to handle changes this way, especially if changes are significant.
On the other hand, consuming a multi-file schema is more complicated on the user side. I had comments form my colleagues saying that single-file is much easier for them to handle.
It is difficult to have a perfect solution, so I'm proposing this compromise. But as pretty much every compromise, it has some downsides. I think we have three possibilities here:
- We stay with current solution (i.e. we develop with multi-file setup and publish a single file).
- We develop and publish multi-file schema.
- We develop and publish single-file schema.
Which way we should go?
There was a problem hiding this comment.
Fine if we stay with the current solution. I simply wouldn't check-in the generated file. We can create it during the build. If we have something like a binary release/SDK release in the future the published file we be part of it.
Co-authored-by: ramceb <89037993+ramceb@users.noreply.github.com> Signed-off-by: SimonKozik <244535158+SimonKozik@users.noreply.github.com>
Co-authored-by: ramceb <89037993+ramceb@users.noreply.github.com> Signed-off-by: SimonKozik <244535158+SimonKozik@users.noreply.github.com>
Co-authored-by: ramceb <89037993+ramceb@users.noreply.github.com> Signed-off-by: SimonKozik <244535158+SimonKozik@users.noreply.github.com>
976e8c9 to
28cc1fc
Compare
|
Additional comment as discussed in the meeting today. Please avoid folder names like draft_schema or future_config_schema. This is really confusing. |
This is first version of JSON schema intended for Launch Manager configuration.
This PR builds on information gathered in #54, so there should not be too many surprises there.