-
Notifications
You must be signed in to change notification settings - Fork 8
759 upgrade edc client to v3 #776
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
base: master
Are you sure you want to change the base?
Conversation
…olicy/contract definition and catalog request
…process to v3 of EDC API
b77be62 to
61b79cc
Compare
|
@bnouwt First comment on changes in the Knowledge Directory. We will not be able to avoid sending the EDC participant ID and protocol URL to other KERs through the Knowledge Directory as a KER needs this information to do a catalog request of another participant and it cannot get this information from anywhere else. So the changes in its API input are necessary I would say |
bnouwt
left a comment
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.
Hi @DaviddeBest-TNO, you did a nice job with this pull request.👍
As usual I have been extra picky for the review and this results in quite a few comments, but most are not really mandatory fixes. One thing I do think requires fixing is the fact that users have to manually build the testkd and testsc docker images for the example to run successfully. We either need to add this to the README.md or make sure the docker images are publicly available (which it should after we release the next version of the KE).
As mentioned before, I do not really like the additional KER properties being distributed via the knowledge-directory. I did try to find ways to not having to (see various comments), so I would like to discuss those with you. If we conclude those are not feasible/possible/desirable, then I will accept these additional fields.😢
So, let's discuss this PR further and get it merged!
Regards, Barry
| * Key to configure where a KER can reach the management API of its own control | ||
| * plane if using EDC. | ||
| */ | ||
| public static final String CONF_KEY_KE_EDC_MANAGEMENT_URL = "ke.edc.management.url"; |
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.
Both CONF_KEY_KE_EDC_PROTOCOL_URL and CONF_KEY_KE_EDC_MANAGEMENT_URL refer to this KER's control plane. Is the first one only necessary to send to other KERs, so they know how to reach this KER's control plane, or is this KER also using that URL?
| } | ||
|
|
||
| URI getEdcConnectorUrl() { | ||
| return this.myEdcConnectorUrl; |
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.
Nice to see that all this token code can be removed from the KER code. If I understand correctly, the KER does not need to know anything about the token, because the http-proxy-data-plane checks and strips the token and only sends the request to its KER if the token is valid. Correct?
| } | ||
| this.remoteKerUri = uri; | ||
| } | ||
| else if (kerConnectionDetails.getExposedUrl().getUserInfo() != null) { |
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.
If I understand this code addition correctly; based on the this.transferProcess check we determine to either use the getExposedUrl() or the counterPartyDataPlaneUrl(). Would it be possible to merge the ke.runtime.exposed.url and ke.edc.dataplane.public.url configuration properties for a KER? If so, we could only use the exposed url and configure it to point to the data plane public url if we use EDC and to the regular KER url if we do not use EDC. Or do we need both a remote KER's exposed and dataplane url when using EDC?
One additional thought: would this code be necessary if we would want to support mixed knowledge networks, where some KERs use EDC and some don't? I somehow do like the idea of supporting this, but we need to check very carefully how this influences the trust in the network.
| InMemoryTokenManager tokenManager, KnowledgeEngineRuntimeConnectionDetails kerConnectionDetails) { | ||
| this.myExposedUri = myExposedUri; | ||
| public RemoteKerConnection(MessageDispatcher dispatcher, KnowledgeEngineRuntimeConnectionDetails kerConnectionDetails, | ||
| TransferProcess transferProcess) { |
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.
Maybe add javadoc comments to the transferProcess that indicates that this is related to whether EDC is used or not. Currently, it is unclear from this class that and how EDC influences it.
| if (this.edcService != null) | ||
| requestBuilder = requestBuilder.setHeader("Authorization", authToken); | ||
| HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(new URI(this.remoteKerUri + "/runtimedetails")); | ||
| //.headers("Content-Type", "application/json"); |
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 would still be interested in knowing why this header is not allowed when using EDC. Also, since we have this transferProcess check, we might use the same check to add the Content-Type header or not. Also, if we decide the Content-Type is not relevant (although I think it is more elegant to state the content of the request), we should probably just remove this comment altogether.
| Execute the following steps to run the example: | ||
| 1. In this project, execute a `mvn clean install`. | ||
| 2. In the `knowledge-directory` directory in this project, execute `docker build . -t testkd:1.4.0`. | ||
| 3. In the `smart-connector-rest-dist` directory in this project, execute `docker build . -t testsc:1.4.0`. |
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.
When I tried this example, I still needed to build this testsc image.
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.
Apparently, both the yaml and yml extension are fine, but I do read that docker-compose is no longer preferred. Maybe rename to compose instead?
|
|
||
| knowledge-directory: | ||
| container_name: knowledge-directory | ||
| image: testkd:1.3.3-SNAPSHOT |
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.
Preferably, we use a docker image from the github docker image repository here. Of course, until we actually release a new version of the KE with the necessary code from this pull request, it will not work, but once we release it and the docker image becomes available this example does not require manually building these images.
So, if we do not wait too long with releasing a new KE version, maybe just rename this to ghcr.io/tno/knowledge-engine/knowledge-directory:1.4.0 (a not working EDC compliant docker image) and update it to the next version (1.4.1) as is already part of the KE release steps.
|
|
||
| alice-ker: | ||
| container_name: alice-ker | ||
| image: docker.io/library/testsc:1.3.3-SNAPSHOT |
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.
Preferably, we use a docker image from the github docker image repository here. Of course, until we actually release a new version of the KE with the necessary code from this pull request, it will not work, but once we release it and the docker image becomes available this example does not require manually building these images.
So, if we do not wait too long with releasing a new KE version, maybe just rename this to ghcr.io/tno/knowledge-engine/smart-connector:1.4.0 (a not working EDC compliant docker image) and update it to the next version (1.4.1) as is already part of the KE release steps.
| KE_EDC_PROTOCOL_URL: "http://host-alice:9183/api/dsp" | ||
| KE_EDC_MANAGEMENT_URL: "http://alice-control-plane:9082/api/management" | ||
| KE_EDC_DATAPLANE_PUBLIC_URL: "http://host-alice:8194/api/v1/public" | ||
| depends_on: # Necessary? |
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.
Ideally, we use the more elaborate depends_on syntax and use the service_healthy condition, but this is only a nice to have I think.
No description provided.