-
Notifications
You must be signed in to change notification settings - Fork 51
Add (optional) VISSv2 interface #642
Add (optional) VISSv2 interface #642
Conversation
Isn't it already implemented through https://github.com/eclipse-kuksa/kuksa-viss ? |
Sure. But that requires running a separate service (written in python). Useful for demonstration purposes, but not very resource efficient or easy to make "production ready". With that said, I haven't really evaluated the need for a VISSv2 service, just wanted to check the feasibility of doing it and took it up as a fun weekend project :). Conclusion is that it seems very feasible. And apart from the lower footprint, it would IMHO also be a lot easier to make production ready thanks to the type safety / thread safety provided by Rust. EDIT: |
84437c6
to
7cedfec
Compare
Should we not add a short documentation somewhere. Like how to build it, how to test it. What limitations are there. Shall it for now be considered as "alpha" (see https://github.com/eclipse/kuksa.val/wiki/KUKSA.val-Component-Maturity), i.e. not suitable for production use? I.e. for now we will not test the interface as part of release testing? How much have been tested? Have we for instance tested with kuksa-client (python) using websocket towards the Databroker VISS interface? |
It has been tested with kuksa-client. Feel free to give it a go. Since kuksa-client isn't fully VISSv2 compliant (or compliant with any VISS version really?), a small change is needed in kuksa-client to support VISSv2 authorization (I have a local branch with that).
If anyone is up for that, sure. This was just a "weekend project" which I think would be a useful addition to the project. But it is not a priority at the moment. With that said, my impression is that it would - even in it's current state - be a better option for "supporting VISS" than the available alternatives.
And as the whole thing is gated behind a feature flag, one option would be to have it "hidden" for now, but easily enabled by I do think it would be useful to merge though, as that would prevent the code from rotting. EDIT: |
7cedfec
to
a458eeb
Compare
I support merging. One of the problem with VISSv2 is the lack of (commonly used) reference implementations. One which possibly could be considered as the "official one" exists at https://github.com/w3c/automotive-viss2, and if VISSv2 gets higher priority it could be an idea to verify that "their solution" and "our solution" interprets the VISSv2 standard in the same way. |
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.
Looks ok, as it is intended as an experimental/optional feature I think it can be merged without exhaustive testing.
I am still not sure, what the "correct" way is to move forward here (in terms of maintainability/usage), but letting this rot would also be sad. Moving this behind a feature flag for now is a good first step. I think to merge this, there are few other things we need to do and should not do
|
That's how it's implemented now (except for the warning). Even if the
The code is strictly following the standard (barring bugs). And I agree that it should continue to do so.
That is missing, but I can add it. |
708c258
to
e400b8d
Compare
|
- Add VISSv2 interface to databroker - Gated by feature flag `viss` (not built by default) - Supports "get", "set", "subscribe" & "unsubscribe" - Supports authorization (same jwt scope format as other interfaces) Not implemented: - Filters (except static-metadata) - TLS
e400b8d
to
4585ad4
Compare
@erikbosch Can you check this (again). Also I assume we want to merge it fast, but after "release"/tag? |
4585ad4
to
6670804
Compare
Before or after release tag shouldn't matter as it's not included in the release artifacts anyway. |
6670804
to
f0e686f
Compare
| Protocol | KUKSA.val server | KUKSA.val databroker | | ||
|---------------------------|:----------------:|:--------------------:| | ||
| VISS V1 | - | - | | ||
| VISS V2 | x/- | x/- | |
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.
Isn't it a bit confusing that we in kuksa-client code specifies the two subprotocols:
subprotocols = ["VISSv2", "VISSv1"]
but here we say that both server and databroker supports (parts of) VISSv2
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.
Would it be better to call them (in kuksa-client) something like "VISSv2-std" and "VISSv2-extended" or something similar.
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.
Yes, that is confusing.
When I added it, I assumed that the "not VISSv2" that kuksa-val-server and kuksa-client speaks was VISSv1. So if any server were to return VISSv1, kuksa-client could just use the that.
But reading the documentation here, it seems that it is actually a modified version of VISSv2 they use. Which is also confusing, because I don't think a VISSv2 client would work with kuksa-val-server, and kuksa-client will not work with a VISSv2 server (before this PR). And I guess neither will work with VISSv1 (so having VISSv1 in there doesn't make sense).
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.
Pushed an update which removed "VISSv1"
from the requested subprotocols.
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.
Would it be better to call them (in kuksa-client) something like "VISSv2-std" and "VISSv2-extended" or something similar.
The VISSv2 specification explicitly states that it SHALL be "VISSv2", so no.
The sub-protocol name SHALL be 'VISSv2' with the digit 2 being the version number.
And as kuksa-val-server doesn't support negotiating subprotocol in the first place, a prerequisite for using that to identify what protocol to use in kuksa-client would be to add support for that in kuksa-val-server.
| Feature | KUKSA.val server | KUKSA.val databroker | | ||
|-------------------------------|:-----------------:|:--------------------:| | ||
| Read | | | | ||
| - Authorized Read | x<sup>1,2</sup> | x | |
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.
Would it be an idea to duplicate the "Authorized Read" and "Authorized Update" lines so that we have lines for:
- Authorized Read of current value (supported by both)
- Authorized Read of target value (only supported by server)
- Authorized Update of current value (only supported by server)
- Authorized Update of target value (supported by both)
To make it more clear what we have in server WS protocol
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.
Well, this table - as I understand it - lists what features of VISSv2 are supported.
If we are going to add non-VISSv2 features as well, maybe we should just create a different table for that, which lists the functionality supported by the different protocols in this project. Furthermore, the VISSv2 features that are listed as "partially" supported by KUKSA.val server here, would not work when using any standards compliant VISSv2 client anyway, so maybe a pure VISSv2 feature support table mostly makes sense for databroker.
I.e.
- One table that lists what features of VISSv2 are supported (by databroker and maybe kuksa-val-server).
- One table that lists the features supported by the different protocols in this project.
req["action"] = "set" | ||
req["path"] = path | ||
req["attribute"] = attribute | ||
if self.subprotocol == "VISSv2": |
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.
Standard VISSv2 only supports setting target value and reading current value, so I suggest we give an error if someone use "setValue" and instead support "setTargetValue". Similar give an error if someone call "getTargetValue"
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.
Pushed an update to this effect.
cac8cd4
to
188ec6e
Compare
Add VISSv2 interface to databroker.
Gated by feature flag
viss
(not built by default).Supports:
get
,set
,subscribe
andunsubscribe
Not implemented: