From 7f5bc56a8b6d2ae2b28c4f58a33bef148185e234 Mon Sep 17 00:00:00 2001 From: "Dr. Christoph \"Schorsch\" Jung" Date: Mon, 18 Dec 2023 15:54:55 +0100 Subject: [PATCH] feat: simplify negotiation and transfer handling by switching to the edr API. --- .github/workflows/build.yml | 4 +- agent-plane/README.md | 4 +- agent-plane/agent-plane-protocol/README.md | 2 +- agent-plane/agent-plane-protocol/pom.xml | 2 +- .../resources/dataplane.properties | 3 - .../tractusx/agents/edc/AgentConfig.java | 9 - .../tractusx/agents/edc/AgentExtension.java | 3 - .../agents/edc/AgreementController.java | 182 +++------------ .../tractusx/agents/edc/jsonld/JsonLd.java | 13 +- .../agents/edc/model/ContractAgreement.java | 24 +- .../agents/edc/model/ContractNegotiation.java | 30 ++- .../agents/edc/service/DataManagement.java | 207 ++---------------- .../service/TestDataspaceSynchronizer.java | 4 +- agent-plane/agentplane-azure-vault/README.md | 2 +- agent-plane/agentplane-azure-vault/pom.xml | 2 +- .../resources/dataplane.properties | 3 - .../src/main/docker/Dockerfile | 4 +- agent-plane/agentplane-hashicorp/README.md | 4 +- agent-plane/agentplane-hashicorp/pom.xml | 2 +- .../resources/dataplane.properties | 3 - .../src/main/docker/Dockerfile | 4 +- agent-plane/pom.xml | 2 +- charts/agent-connector-azure-vault/Chart.yaml | 4 +- charts/agent-connector-azure-vault/README.md | 4 +- .../templates/deployment-dataplane.yaml | 6 - .../agent-connector-azure-vault/values.yaml | 3 - charts/agent-connector-memory/Chart.yaml | 4 +- charts/agent-connector-memory/README.md | 4 +- .../templates/deployment-dataplane.yaml | 6 - charts/agent-connector-memory/values.yaml | 3 - charts/agent-connector/Chart.yaml | 4 +- charts/agent-connector/README.md | 4 +- .../templates/deployment-dataplane.yaml | 6 - charts/agent-connector/values.yaml | 3 - common/README.md | 2 +- common/auth-jwt/README.md | 2 +- common/auth-jwt/pom.xml | 2 +- docs/README.md | 6 +- pom.xml | 2 +- upgrade_version.sh | 2 +- 40 files changed, 144 insertions(+), 436 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d34652..093e569 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -137,7 +137,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}} type=semver,pattern={{major}}.{{minor}} - type=raw,value=1.10.15-SNAPSHOT,enable=${{ github.event.inputs.deploy_docker == 'true' || github.ref == format('refs/heads/{0}', 'main') }} + type=raw,value=1.11.16-SNAPSHOT,enable=${{ github.event.inputs.deploy_docker == 'true' || github.ref == format('refs/heads/{0}', 'main') }} type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - name: Agent Plane Hashicorp Container Build and push @@ -175,7 +175,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}} type=semver,pattern={{major}}.{{minor}} - type=raw,value=1.10.15-SNAPSHOT,enable=${{ github.event.inputs.deploy_docker == 'true' || github.ref == format('refs/heads/{0}', 'main') }} + type=raw,value=1.11.16-SNAPSHOT,enable=${{ github.event.inputs.deploy_docker == 'true' || github.ref == format('refs/heads/{0}', 'main') }} type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} - name: Agent Plane Azure Vault Container Build and push diff --git a/agent-plane/README.md b/agent-plane/README.md index 6b3fed7..ead45ce 100644 --- a/agent-plane/README.md +++ b/agent-plane/README.md @@ -66,10 +66,10 @@ mvn package -Pwith-docker-image Alternatively, after a successful build, you can invoke docker yourself ```console -docker build -t tractusx/agentplane-azure-vault:1.10.15-SNAPSHOT -f agentplane-azure-vault/src/main/docker/Dockerfile . +docker build -t tractusx/agentplane-azure-vault:1.11.16-SNAPSHOT -f agentplane-azure-vault/src/main/docker/Dockerfile . ``` ```console -docker build -t tractusx/agentplane-hashicorp:1.10.15-SNAPSHOT -f agentplane-hashicorp/src/main/docker/Dockerfile . +docker build -t tractusx/agentplane-hashicorp:1.11.16-SNAPSHOT -f agentplane-hashicorp/src/main/docker/Dockerfile . ``` diff --git a/agent-plane/agent-plane-protocol/README.md b/agent-plane/agent-plane-protocol/README.md index cb8d5ed..a15690e 100644 --- a/agent-plane/agent-plane-protocol/README.md +++ b/agent-plane/agent-plane-protocol/README.md @@ -63,7 +63,7 @@ Add the following dependency to your data-plane artifact pom: org.eclipse.tractusx.agents.edc agent-plane-protocol - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT ``` diff --git a/agent-plane/agent-plane-protocol/pom.xml b/agent-plane/agent-plane-protocol/pom.xml index 251f810..d08d8f6 100644 --- a/agent-plane/agent-plane-protocol/pom.xml +++ b/agent-plane/agent-plane-protocol/pom.xml @@ -25,7 +25,7 @@ org.eclipse.tractusx.agents.edc agent-plane - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT ../pom.xml diff --git a/agent-plane/agent-plane-protocol/resources/dataplane.properties b/agent-plane/agent-plane-protocol/resources/dataplane.properties index 8912391..83f8af4 100644 --- a/agent-plane/agent-plane-protocol/resources/dataplane.properties +++ b/agent-plane/agent-plane-protocol/resources/dataplane.properties @@ -31,8 +31,6 @@ web.http.default.port=8082 web.http.default.path=/api web.http.public.port=8185 web.http.public.path=/api/v1/public -web.http.callback.port=8187 -web.http.callback.path=/callback web.http.control.port=9999 web.http.control.path=/api/dataplane/control edc.web.rest.cors.enabled=true @@ -63,7 +61,6 @@ edc.dataplane.token.validation.endpoints.consumer=http://consuming-control-plane cx.agent.controlplane.protocol=http://consuming-control-plane:8282 cx.agent.controlplane.management=http://consuming-control-plane:8181/management cx.agent.controlplane.management.provider=http://providing-control-plane:8181/management -cx.agent.callback=http://agent-plane:8187/callback/endpoint-data-reference cx.agent.skill.contract.default=Contract?partner=Skill cx.agent.edc.version=0.5.1 diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgentConfig.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgentConfig.java index aa3eaf8..68e34cd 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgentConfig.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgentConfig.java @@ -72,8 +72,6 @@ public class AgentConfig { public static String READ_TIMEOUT_PROPERTY = "cx.agent.read.timeout"; public static int DEFAULT_READ_TIMEOUT=1080000; - public static String CALLBACK_ENDPOINT="cx.agent.callback"; - public static String DEFAULT_SKILL_CONTRACT_PROPERTY = "cx.agent.skill.contract.default"; public static String SERVICE_ALLOW_PROPERTY = "cx.agent.service.allow"; @@ -118,13 +116,6 @@ public AgentConfig(Monitor monitor, Config config) { serviceAssetDenyPattern=Pattern.compile(config.getString(SERVICE_DENY_ASSET_PROPERTY,DEFAULT_SERVICE_DENY_ASSET_PATTERN)); } - /** - * @return callback endpoint - */ - public String getCallbackEndpoint() { - return config.getString(CALLBACK_ENDPOINT); - } - /** * @return the name of the default asset/graph */ diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgentExtension.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgentExtension.java index 7814e31..01e4a91 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgentExtension.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgentExtension.java @@ -62,7 +62,6 @@ public class AgentExtension implements ServiceExtension { * static constants */ protected static final String DEFAULT_CONTEXT_ALIAS = "default"; - protected static final String CALLBACK_CONTEXT_ALIAS = "callback"; public static Pattern GRAPH_PATTERN=Pattern.compile("((?[^#]+)#)?(?.*Graph(Asset)?.*)"); public static Pattern SKILL_PATTERN=Pattern.compile("((?[^#]+)#)?(?.*Skill(Asset)?.*)"); @@ -126,8 +125,6 @@ public void initialize(ServiceExtensionContext context) { DataManagement catalogService=new DataManagement(monitor,typeManager,httpClient,config); AgreementController agreementController=new AgreementController(monitor,config,catalogService); - monitor.debug(String.format("Registering agreement controller %s",agreementController)); - webService.registerResource(CALLBACK_CONTEXT_ALIAS, agreementController); RDFStore rdfStore=new RDFStore(config,monitor); diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgreementController.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgreementController.java index eb4915e..691e99f 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgreementController.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/AgreementController.java @@ -19,11 +19,8 @@ import com.nimbusds.jose.JWSObject; import jakarta.json.JsonValue; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import org.eclipse.edc.spi.monitor.Monitor; -import org.eclipse.edc.spi.types.domain.DataAddress; -import org.eclipse.edc.spi.types.domain.callback.CallbackAddress; import org.eclipse.edc.spi.types.domain.edr.EndpointDataReference; import org.eclipse.tractusx.agents.edc.jsonld.JsonLd; import org.eclipse.tractusx.agents.edc.model.*; @@ -37,8 +34,6 @@ /** * An endpoint/service that receives information from the control plane */ -@Consumes({MediaType.APPLICATION_JSON}) -@Path("/endpoint-data-reference") public class AgreementController implements IAgreementController { /** @@ -61,13 +56,7 @@ public class AgreementController implements IAgreementController { // hosts all pending processes protected final Set activeAssets = new HashSet<>(); // any contract agreements indexed by asset - protected final Map agreementStore = new HashMap<>(); - // any transfer processes indexed by asset, the current process should - // always adhere to the above agreement - protected final Map processStore = new HashMap<>(); - // at the end of provisioning and endpoint reference will be set - // that fits to the current transfer process - protected final Map endpointStore = new HashMap<>(); + protected final Map agreementStore = new HashMap<>(); /** * creates an agreement controller @@ -90,29 +79,6 @@ public String toString() { return super.toString() + "/endpoint-data-reference"; } - /** - * this is called by the control plane when an agreement has been made - * - * @param dataReference contains the actual call token - */ - @POST - public void receiveEdcCallback(EndpointDataReference dataReference) { - var agreementId = dataReference.getId(); - monitor.debug(String.format("An endpoint data reference for agreement %s has been posted.", agreementId)); - synchronized (agreementStore) { - for (Map.Entry process : processStore.entrySet()) { - if (process.getValue().getId().equals(agreementId)) { - synchronized (endpointStore) { - monitor.debug(String.format("Agreement %s belongs to asset %s.", agreementId, process.getKey())); - endpointStore.put(process.getKey(), dataReference); - return; - } - } - } - } - monitor.debug(String.format("Agreement %s has no active asset. Guess that came for another plane. Ignoring.", agreementId)); - } - /** * accesses an active endpoint for the given asset * @@ -126,8 +92,8 @@ public EndpointDataReference get(String assetId) { monitor.debug(String.format("Asset %s is not active", assetId)); return null; } - synchronized (endpointStore) { - EndpointDataReference result = endpointStore.get(assetId); + synchronized (agreementStore) { + EndpointDataReference result = agreementStore.get(assetId); if (result != null) { String token = result.getAuthCode(); if (token != null) { @@ -136,27 +102,18 @@ public EndpointDataReference get(String assetId) { Object expiryObject=jwt.getPayload().toJSONObject().get("exp"); if(expiryObject instanceof Long) { // token times are in seconds - if(!new Date((Long) expiryObject*1000).before(new Date(System.currentTimeMillis() + 30 * 1000))) { + if (!new Date((Long) expiryObject*1000).before(new Date(System.currentTimeMillis() + 30 * 1000))) { return result; } } - } catch(ParseException | NumberFormatException e) { + } catch (ParseException | NumberFormatException e) { monitor.debug(String.format("Active asset %s has invalid agreement token.", assetId)); } } - endpointStore.remove(assetId); + agreementStore.remove(assetId); } monitor.debug(String.format("Active asset %s has timed out or was not installed.", assetId)); - synchronized (processStore) { - processStore.remove(assetId); - synchronized (agreementStore) { - ContractAgreement agreement = agreementStore.get(assetId); - if (agreement != null && agreement.getContractSigningDate()+600000L <= System.currentTimeMillis()) { - agreementStore.remove(assetId); - } - activeAssets.remove(assetId); - } - } + activeAssets.remove(assetId); } } return null; @@ -186,30 +143,27 @@ protected void deactivate(String asset) { synchronized (agreementStore) { agreementStore.remove(asset); } - synchronized (processStore) { - processStore.remove(asset); - } } /** * register an agreement + * * @param asset name * @param agreement object */ - protected void registerAgreement(String asset, ContractAgreement agreement) { + protected EndpointDataReference registerAgreement(String asset, ContractAgreement agreement, Map assetProperties) { synchronized (agreementStore) { - agreementStore.put(asset, agreement); - } - } - - /** - * register a process - * @param asset name - * @param process object - */ - protected void registerProcess(String asset, TransferProcess process) { - synchronized (processStore) { - processStore.put(asset, process); + var edrBuilder = EndpointDataReference.Builder.newInstance(); + edrBuilder.authCode(agreement.getAuthCode()); + edrBuilder.authKey(agreement.getAuthKey()); + edrBuilder.endpoint(agreement.getEndpoint()); + edrBuilder.id(agreement.getCId()); + var edr = edrBuilder.build(); + for (Map.Entry prop : assetProperties.entrySet()) { + edr.getProperties().put(prop.getKey(), JsonLd.asString(prop.getValue())); + } + agreementStore.put(asset, edr); + return edr; } } @@ -282,10 +236,10 @@ public EndpointDataReference createAgreement(String remoteUrl, String asset) thr try { while ((System.currentTimeMillis() - startTime < config.getNegotiationTimeout()) && (negotiation == null || - (!negotiation.getState().equals("FINALIZED") && !negotiation.getState().equals("TERMINATED")))) { + (!negotiation.getState().equals("NEGOTIATED") && !negotiation.getState().equals("TERMINATED")))) { Thread.sleep(config.getNegotiationPollInterval()); negotiation = dataManagement.getNegotiation( - negotiationId + asset ); } } catch (InterruptedException e) { @@ -294,7 +248,7 @@ public EndpointDataReference createAgreement(String remoteUrl, String asset) thr monitor.warning(String.format("Negotiation thread for asset %s negotiation %s run into problem. Giving up.", asset, negotiationId),e); } - if (negotiation == null || !negotiation.getState().equals("FINALIZED")) { + if (negotiation == null || !negotiation.getState().equals("NEGOTIATED")) { deactivate(asset); if(negotiation!=null) { String errorDetail=negotiation.getErrorDetail(); @@ -305,105 +259,23 @@ public EndpointDataReference createAgreement(String remoteUrl, String asset) thr throw new InternalServerErrorException(String.format("Contract Negotiation %s for asset %s was not successful.", negotiationId, asset)); } - monitor.debug(String.format("About to check agreement %s for contract offer %s (for asset %s at connector %s)",negotiation.getContractAgreementId(),offerId,asset,remoteUrl)); + monitor.debug(String.format("About to check edr %s for contract offer %s (for asset %s at connector %s)",negotiation.getContractAgreementId(),offerId,asset,remoteUrl)); ContractAgreement agreement; try { - agreement=dataManagement.getAgreement(negotiation.getContractAgreementId()); + agreement=dataManagement.getEdr(negotiation.getTransferProcessId()); } catch(IOException ioe) { deactivate(asset); throw new InternalServerErrorException(String.format("Error when retrieving agreement %s for negotiation %s.",negotiation.getContractAgreementId(),negotiationId),ioe); } - if (agreement == null || !agreement.getAssetId().endsWith(asset)) { + if (agreement == null) { deactivate(asset); throw new InternalServerErrorException(String.format("Agreement %s does not refer to asset %s.", negotiation.getContractAgreementId(), asset)); } - registerAgreement(asset,agreement); - - DataAddress dataDestination = DataAddress.Builder.newInstance() - .type(TRANSFER_TYPE) - .build(); - - CallbackAddress address= - CallbackAddress.Builder.newInstance().uri(config.getCallbackEndpoint()).build(); - - TransferRequest transferRequest = TransferRequest.Builder.newInstance() - .assetId(asset) - .contractId(agreement.getId()) - .connectorId(config.getBusinessPartnerNumber()) - .connectorAddress(String.format(DataManagement.DSP_PATH, remoteUrl)) - .protocol("dataspace-protocol-http") - .dataDestination(dataDestination) - .managedResources(false) - .callbackAddresses(List.of(address)) - .build(); - - monitor.debug(String.format("About to initiate transfer for agreement %s (for asset %s at connector %s)",negotiation.getContractAgreementId(),asset,remoteUrl)); - - String transferId; - - try { - transferId=dataManagement.initiateHttpProxyTransferProcess(transferRequest); - } catch(IOException ioe) { - deactivate(asset); - throw new InternalServerErrorException(String.format("HttpProxy transfer for agreement %s could not be initiated.", agreement.getId()),ioe); - } - - monitor.debug(String.format("About to check transfer %s (for asset %s at connector %s)",transferId,asset,remoteUrl)); - - // Check negotiation state - TransferProcess process = null; - - startTime = System.currentTimeMillis(); - - // EDC 0.5.1 has a problem with the checker configuration and wont process to COMPLETED - String expectedTransferState = config.isPrerelease() ? "COMPLETED" : "STARTED"; - - try { - while ((System.currentTimeMillis() - startTime < config.getNegotiationTimeout()) && (process == null || !process.getState().equals(expectedTransferState))) { - Thread.sleep(config.getNegotiationPollInterval()); - process = dataManagement.getTransfer( - transferId - ); - registerProcess(asset, process); - } - } catch (InterruptedException e) { - monitor.info(String.format("Process thread for asset %s transfer %s has been interrupted. Giving up.", asset, transferId),e); - } catch(IOException e) { - monitor.warning(String.format("Process thread for asset %s transfer %s run into problem. Giving up.", asset, transferId),e); - } - - if (process == null || !process.getState().equals(expectedTransferState)) { - deactivate(asset); - throw new InternalServerErrorException(String.format("Transfer process %s for agreement %s and asset %s could not be provisioned.", transferId, agreement.getId(), asset)); - } - - // finally wait a bit for the endpoint data reference in case - // that the process was signalled earlier than the callbacks - startTime = System.currentTimeMillis(); - - EndpointDataReference reference=null; - - try { - while ((System.currentTimeMillis() - startTime < config.getNegotiationTimeout()) && (reference == null)) { - Thread.sleep(config.getNegotiationPollInterval()); - synchronized(endpointStore) { - reference=endpointStore.get(asset); - } - } - } catch (InterruptedException e) { - monitor.info(String.format("Wait thread for reference to asset %s has been interrupted. Giving up.", asset),e); - } - - // mark the type in the endpoint - if(reference!=null) { - for(Map.Entry prop : assetProperties.entrySet()) { - reference.getProperties().put(prop.getKey(), JsonLd.asString(prop.getValue())); - } - } + registerAgreement(asset,agreement, assetProperties); // now delegate to the original getter return get(asset); diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/jsonld/JsonLd.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/jsonld/JsonLd.java index 297c9b1..80abc7e 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/jsonld/JsonLd.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/jsonld/JsonLd.java @@ -46,8 +46,17 @@ public static IdResponse processIdResponse(JsonObject response) { return new IdResponse(processJsonLd(response,null)); } - public static ContractNegotiation processContractNegotiation(String response) { - return processContractNegotiation(Json.createReader(new StringReader(response)).readObject()); + public static ContractNegotiation processContractNegotiations(String response) { + JsonValue negotiations = Json.createReader(new StringReader(response)).readValue(); + if (negotiations.getValueType() == JsonValue.ValueType.ARRAY) { + JsonArray negotiationArray = negotiations.asJsonArray(); + if(negotiationArray.size() > 0) { + negotiations = negotiationArray.get(0); + } else { + return null; + } + } + return processContractNegotiation(negotiations.asJsonObject()); } public static ContractNegotiation processContractNegotiation(JsonObject response) { diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/model/ContractAgreement.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/model/ContractAgreement.java index f146e87..f6f693b 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/model/ContractAgreement.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/model/ContractAgreement.java @@ -25,11 +25,27 @@ public ContractAgreement(JsonObject node) { super(node); } - public String getAssetId() { - return object.getString("https://w3id.org/edc/v0.0.1/ns/assetId"); + public String getAuthCode() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/authCode", null); } - public long getContractSigningDate() { - return object.getInt("https://w3id.org/edc/v0.0.1/ns/contractSigningDate"); + public String getAuthKey() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/authKey", null); + } + + public String getEndpoint() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/endpoint", null); + } + + public String getTransferProcessId() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/id", null); + } + + public String getCId() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/cid", null); + } + + public String getType() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/type", null); } } \ No newline at end of file diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/model/ContractNegotiation.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/model/ContractNegotiation.java index a55bc22..97e9ac0 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/model/ContractNegotiation.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/model/ContractNegotiation.java @@ -29,14 +29,38 @@ public ContractNegotiation(JsonObject node) { } public String getContractAgreementId() { - return object.getString("https://w3id.org/edc/v0.0.1/ns/contractAgreementId",null); + return getAgreementId(); } public String getState() { - return object.getString("https://w3id.org/edc/v0.0.1/ns/state"); + return getEdrState(); + } + + public String getAgreementId() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/agreementId", "UNKNOWN"); + } + + public String getTransferProcessId() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/transferProcessId", "UNKNOWN"); + } + + public String getAssetId() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/assetId", "UNKNOWN"); + } + + public String getProviderId() { + return object.getString("https://w3id.org/edc/v0.0.1/ns/providerId", "UNKNOWN"); + } + + public String getEdrState() { + return object.getString("https://w3id.org/tractusx/v0.0.1/ns/edrState", "UNKNOWN"); + } + + public long getExpirationDate() { + return object.getJsonNumber("https://w3id.org/tractusx/v0.0.1/ns/expirationDate").longValue(); } public String getErrorDetail() { - return object.getString("https://w3id.org/edc/v0.0.1/ns/errorDetail",null); + return object.getString("https://w3id.org/edc/v0.0.1/ns/errorDetail", null); } } diff --git a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/service/DataManagement.java b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/service/DataManagement.java index ea178f7..a2d9409 100644 --- a/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/service/DataManagement.java +++ b/agent-plane/agent-plane-protocol/src/main/java/org/eclipse/tractusx/agents/edc/service/DataManagement.java @@ -18,11 +18,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; -import jakarta.json.JsonArray; -import jakarta.json.JsonNumber; -import jakarta.json.JsonObject; -import jakarta.json.JsonString; -import jakarta.json.JsonValue; import okhttp3.*; import org.eclipse.tractusx.agents.edc.AgentConfig; import jakarta.ws.rs.InternalServerErrorException; @@ -32,16 +27,11 @@ import org.eclipse.edc.spi.types.TypeManager; import org.eclipse.tractusx.agents.edc.jsonld.JsonLd; import org.eclipse.tractusx.agents.edc.model.*; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.io.IOException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.util.Collection; import java.util.List; -import java.util.Map; -import java.util.Set; import static java.lang.String.format; @@ -63,50 +53,8 @@ public class DataManagement { "\"counterPartyAddress\": \"%s\", " + "\"querySpec\": %s }"; // catalog request 0.5.0 - public static final String CATALOG_REQUEST_BODY_PRERELEASE = "{" + - "\"@context\": {}," + - "\"protocol\": \"dataspace-protocol-http\"," + - "\"providerUrl\": \"%s\", " + - "\"querySpec\": %s }"; public static final String ASSET_CREATE_CALL = "%s%s/assets"; - public static final String ASSET_CREATE_BODY="{\n" + - " \"@context\": {\n" + - " \"rdf\": \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n" + - " \"rdfs\": \"http://www.w3.org/2000/01/rdf-schema#\",\n" + - " \"cx-common\": \"https://w3id.org/catenax/ontology/common#\",\n" + - " \"sh\": \"http://www.w3.org/ns/shacl#\"\n" + - " },\n" + - " \"asset\": {\n" + - " \"@type\": \"Asset\",\n" + - " \"@id\": \"%1$s\", \n" + - " \"properties\": {\n" + - " \"name\": \"%2$s\",\n" + - " \"description\": \"%3$s\",\n" + - " \"version\": \"%4$s\",\n" + - " \"contenttype\": \"application/json, application/xml\",\n" + - "%5$s" + - " \"rdf:type\": \"cx-common:SkillAsset\",\n" + - " \"rdfs:isDefinedBy\": \"%6$s\",\n" + - " \"cx-common:implementsProtocol\": \"cx-common:Protocol?w3c:http:SKILL\",\n" + - " \"cx-common:distributionMode\": \"%7$s\",\n" + - " \"cx-common:isFederated\": \"%8$b^^xsd:boolean\"\n" + - " },\n" + - " \"privateProperties\": {\n" + - " \"cx-common:query\":%9$s\n" + - " }\n" + - " },\n" + - " \"dataAddress\": {\n" + - " \"id\":\"%1$s\",\n" + - " \"@type\": \"DataAddress\",\n" + - " \"type\": \"cx-common:Protocol?w3c:http:SKILL\",\n" + - " \"baseUrl\":\"https://w3id.org/catenax\",\n" + - " \"proxyPath\": \"false\",\n" + - " \"proxyMethod\": \"true\",\n" + - " \"proxyQueryParams\": \"true\",\n" + - " \"proxyBody\": \"true\"\n" + - " }\n" + - "}\n"; public static final String SKILL_ASSET_CREATE_BODY_V3 = "{\n" + " \"@context\": {\n" + @@ -146,22 +94,7 @@ public class DataManagement { public static final String ASSET_CALL = "%s%s/assets/request"; // negotiation request 0.5.>=1 - public static final String NEGOTIATION_REQUEST_BODY="{\n" + - "\"@context\": { \"odrl\": \"http://www.w3.org/ns/odrl/2/\"},\n" + - "\"@type\": \"NegotiationInitiateRequestDto\",\n" + - "\"connectorAddress\": \"%1$s\",\n" + - "\"protocol\": \"dataspace-protocol-http\",\n" + - "\"providerId\": \"%3$s\",\n" + - "\"connectorId\": \"%2$s\",\n" + - "\"offer\": {\n" + - " \"offerId\": \"%4$s\",\n" + - " \"assetId\": \"%5$s\",\n" + - " \"policy\": %6$s\n" + - "}\n" + - "}"; - - // negotiation request 0.5.0 - roles of provider and connector are wrong - public static final String NEGOTIATION_REQUEST_BODY_PRERELEASE="{\n" + + public static final String NEGOTIATION_REQUEST_BODY = "{\n" + "\"@context\": { \"odrl\": \"http://www.w3.org/ns/odrl/2/\"},\n" + "\"@type\": \"NegotiationInitiateRequestDto\",\n" + "\"connectorAddress\": \"%1$s\",\n" + @@ -175,33 +108,9 @@ public class DataManagement { "}\n" + "}"; - public static final String NEGOTIATION_INITIATE_CALL = "%s/v2/contractnegotiations"; - public static final String NEGOTIATION_CHECK_CALL = "%s/v2/contractnegotiations/%s"; - public static final String TRANSFER_INITIATE_CALL = "%s/v2/transferprocesses"; - - public static final String TRANSFER_REQUEST_BODY="{\n" + - " \"@context\": {\n" + - " \"odrl\": \"http://www.w3.org/ns/odrl/2/\"\n" + - " },\n" + - " \"assetId\": \"%1$s\",\n" + - " \"connectorAddress\": \"%2$s\",\n" + - " \"connectorId\": \"%5$s\",\n" + - " \"contractId\": \"%3$s\",\n" + - " \"dataDestination\": {\n" + - " \"type\": \"HttpProxy\"\n" + - " },\n" + - " \"managedResources\": false,\n" + - " \"privateProperties\": {\n" + - " \"receiverHttpEndpoint\": \"%4$s\"\n" + - " },\n" + - " \"protocol\": \"dataspace-protocol-http\",\n" + - " \"transferType\": {\n" + - " \"contentType\": \"application/octet-stream\",\n" + - " \"isFinite\": true\n" + - " }\n" + - "}"; - public static final String TRANSFER_CHECK_CALL = "%s/v2/transferprocesses/%s"; - public static final String AGREEMENT_CHECK_CALL = "%s/v2/contractagreements/%s"; + public static final String EDR_INITIATE_CALL = "%s/edrs"; + public static final String EDR_CHECK_CALL = "%s/edrs?assetId=%s"; + public static final String EDR_ACCESS_CALL = "%s/edrs/%s"; /** * references to EDC services @@ -252,7 +161,7 @@ public DcatCatalog getCatalog(String remoteControlPlaneIdsUrl, QuerySpec spec) t var url = String.format(CATALOG_CALL,config.getControlPlaneManagementUrl(),"/v2"); // use a version specific call - String template = config.isPrerelease() ? CATALOG_REQUEST_BODY_PRERELEASE : CATALOG_REQUEST_BODY; + String template = CATALOG_REQUEST_BODY; var catalogSpec =String.format(template, String.format(DSP_PATH, remoteControlPlaneIdsUrl), objectMapper.writeValueAsString(spec)); @@ -282,8 +191,7 @@ public DcatCatalog getCatalog(String remoteControlPlaneIdsUrl, QuerySpec spec) t */ public List listAssets(QuerySpec spec) throws IOException { - String version = config.isPrerelease() ? "/v2" : "/v3"; - var url = String.format(ASSET_CALL, config.getControlPlaneManagementProviderUrl(), version); + var url = String.format(ASSET_CALL, config.getControlPlaneManagementProviderUrl(), "/v3"); var assetObject=(ObjectNode) objectMapper.readTree(objectMapper.writeValueAsString(spec)); assetObject.put("@context",objectMapper.createObjectNode()); var assetSpec = objectMapper.writeValueAsString(assetObject); @@ -321,14 +229,13 @@ public List listAssets(QuerySpec spec) throws IOException { */ public IdResponse createOrUpdateSkill(String assetId, String name, String description, String version, String contract, String ontologies, String distributionMode, boolean isFederated, String query) throws IOException { - String apiVersion = config.isPrerelease() ? "/v2" : "/v3"; - var url = String.format(ASSET_CREATE_CALL, config.getControlPlaneManagementProviderUrl(), apiVersion); + var url = String.format(ASSET_CREATE_CALL, config.getControlPlaneManagementProviderUrl(), "/v3"); if(contract!=null) { contract=String.format(" \"cx-common:publishedUnderContract\": \"%1$s\",\n",contract); } else { contract=""; } - String spec = config.isPrerelease() ? ASSET_CREATE_BODY : SKILL_ASSET_CREATE_BODY_V3; + String spec = SKILL_ASSET_CREATE_BODY_V3; var assetSpec = String.format(spec, assetId, name, description, version, contract, ontologies, distributionMode, isFederated, query); @@ -364,16 +271,16 @@ public IdResponse createOrUpdateSkill(String assetId, String name, String descri /** - * initiates negotation + * initiates negotation (and starts transfer) * @param negotiationRequest outgoing request * @return negotiation id - * @throws IOException in case something went wronf + * @throws IOException in case something went wrong */ public String initiateNegotiation(ContractNegotiationRequest negotiationRequest) throws IOException { - var url = String.format(NEGOTIATION_INITIATE_CALL,config.getControlPlaneManagementUrl()); + var url = String.format(EDR_INITIATE_CALL,config.getControlPlaneManagementUrl()); // use a version specific call - String template = config.isPrerelease() ? NEGOTIATION_REQUEST_BODY_PRERELEASE : NEGOTIATION_REQUEST_BODY; + String template = NEGOTIATION_REQUEST_BODY; var negotiateSpec =String.format(template, negotiationRequest.getConnectorAddress(), @@ -411,12 +318,12 @@ public String initiateNegotiation(ContractNegotiationRequest negotiationRequest) /** * return state of contract negotiation - * @param negotiationId id of the negotation to inbestigate + * @param assetId of the negotation to investigate * @return status of the negotiation * @throws IOException in case something went wrong */ - public ContractNegotiation getNegotiation(String negotiationId) throws IOException { - var url = String.format(NEGOTIATION_CHECK_CALL,config.getControlPlaneManagementUrl(),negotiationId); + public ContractNegotiation getNegotiation(String assetId) throws IOException { + var url = String.format(EDR_CHECK_CALL,config.getControlPlaneManagementUrl(),URLEncoder.encode(assetId,StandardCharsets.UTF_8)); var request = new Request.Builder() .url(url); config.getControlPlaneManagementHeaders().forEach(request::addHeader); @@ -428,8 +335,8 @@ public ContractNegotiation getNegotiation(String negotiationId) throws IOExcepti throw new InternalServerErrorException(format("Control plane responded with: %s %s", response.code(), body != null ? body.string() : "")); } - var negotiation = JsonLd.processContractNegotiation(body.string()); - monitor.debug(format("Negotiation %s is in state '%s' (agreementId: %s)", negotiationId, negotiation.getState(), negotiation.getContractAgreementId())); + var negotiation = JsonLd.processContractNegotiations(body.string()); + monitor.debug(format("Negotiation for asset %s is %s", assetId, negotiation)); return negotiation; } catch (Exception e) { @@ -439,12 +346,12 @@ public ContractNegotiation getNegotiation(String negotiationId) throws IOExcepti } /** - * @param agreementId id of the agreement + * @param transferProcessId id of the transfer process * @return contract agreement * @throws IOException something wild happens */ - public ContractAgreement getAgreement(String agreementId) throws IOException { - var url = String.format(AGREEMENT_CHECK_CALL,config.getControlPlaneManagementUrl(), URLEncoder.encode(agreementId, StandardCharsets.UTF_8)); + public ContractAgreement getEdr(String transferProcessId) throws IOException { + var url = String.format(EDR_ACCESS_CALL,config.getControlPlaneManagementUrl(), transferProcessId); var request = new Request.Builder() .url(url); config.getControlPlaneManagementHeaders().forEach(request::addHeader); @@ -457,7 +364,7 @@ public ContractAgreement getAgreement(String agreementId) throws IOException { } var agreement = JsonLd.processContractAgreement(body.string()); - monitor.debug(format("Agreement %s found for asset %s", agreementId, agreement.getAssetId())); + monitor.debug(format("Edr found for transfer process %s", transferProcessId)); return agreement; } catch (Exception e) { @@ -466,76 +373,4 @@ public ContractAgreement getAgreement(String agreementId) throws IOException { } } - /** - * Initiates a transfer - * @param transferRequest request - * @return transfer id - * @throws IOException in case something went wrong - */ - public String initiateHttpProxyTransferProcess(TransferRequest transferRequest) throws IOException { - var url = String.format(TRANSFER_INITIATE_CALL,config.getControlPlaneManagementUrl()); - - var transferSpec =String.format(TRANSFER_REQUEST_BODY, - transferRequest.getAssetId(), - transferRequest.getConnectorAddress(), - transferRequest.getContractId(), - transferRequest.getCallbackAddresses().get(0).getUri(), - transferRequest.getConnectorAddress()); - - var requestBody = RequestBody.create(transferSpec,MediaType.parse("application/json")); - - var request = new Request.Builder() - .url(url) - .post(requestBody); - config.getControlPlaneManagementHeaders().forEach(request::addHeader); - - try (var response = httpClient.newCall(request.build()).execute()) { - var body = response.body(); - - if (!response.isSuccessful() || body == null) { - throw new InternalServerErrorException(format("Control plane responded with: %s %s", response.code(), body != null ? body.string() : "")); - } - - // For debugging purposes: - // var transferProcessId = TransferId.Builder.newInstance().id(body.string()).build(); - var transferProcessId = JsonLd.processIdResponse(body.string()).getId(); - - monitor.debug(format("Transfer process (%s) initiated", transferProcessId)); - - return transferProcessId; - } catch (Exception e) { - monitor.severe(format("Error in calling the control plane at %s", url), e); - throw e; - } - } - - /** - * return state of transfer process - * @param transferProcessId id of the transfer process - * @return state of the transfer process - * @throws IOException in case something went wrong - */ - public TransferProcess getTransfer(String transferProcessId) throws IOException { - var url = String.format(TRANSFER_CHECK_CALL,config.getControlPlaneManagementUrl(),transferProcessId); - var request = new Request.Builder() - .url(url); - config.getControlPlaneManagementHeaders().forEach(request::addHeader); - - try (var response = httpClient.newCall(request.build()).execute()) { - var body = response.body(); - - if (!response.isSuccessful() || body == null) { - throw new InternalServerErrorException(format("Control plane responded with: %s %s", response.code(), body != null ? body.string() : "")); - } - - var process = JsonLd.processTransferProcess(body.string()); - monitor.info(format("Transfer %s is in state '%s'", transferProcessId, process.getState())); - - return process; - } catch (Exception e) { - monitor.severe(format("Error in calling the Control plane at %s", url), e); - throw e; - } - } - } \ No newline at end of file diff --git a/agent-plane/agent-plane-protocol/src/test/java/org/eclipse/tractusx/agents/edc/service/TestDataspaceSynchronizer.java b/agent-plane/agent-plane-protocol/src/test/java/org/eclipse/tractusx/agents/edc/service/TestDataspaceSynchronizer.java index 10e123a..dcdaa07 100644 --- a/agent-plane/agent-plane-protocol/src/test/java/org/eclipse/tractusx/agents/edc/service/TestDataspaceSynchronizer.java +++ b/agent-plane/agent-plane-protocol/src/test/java/org/eclipse/tractusx/agents/edc/service/TestDataspaceSynchronizer.java @@ -88,7 +88,7 @@ public void testQuadRepresentation() { .add("@id", "4bf62562-9026-4dcf-93b5-42ea0de25490") .add("https://w3id.org/edc/v0.0.1/ns/id", "https://w3id.org/catenax/ontology/common#GraphAsset?test:ExampleAsset") .add("https://w3id.org/edc/v0.0.1/ns/contenttype", "application/json, application/xml") - .add("https://w3id.org/edc/v0.0.1/ns/version", "1.10.15-SNAPSHOT") + .add("https://w3id.org/edc/v0.0.1/ns/version", "1.11.16-SNAPSHOT") .add("https://w3id.org/edc/v0.0.1/ns/name", "Test Asset") .add("https://w3id.org/edc/v0.0.1/ns/description", "Test Asset for RDF Representation") .add("https://w3id.org/catenax/ontology/common#publishedUnderContract", "") @@ -178,7 +178,7 @@ public void testCatalogDeserialization() { " },\n" + " \"dcat:accessService\": \"ddd4b79e-f785-4e71-9fe5-4a177b3ccf54\"\n" + " },\n" + - " \"edc:version\": \"1.10.15-SNAPSHOT\",\n" + + " \"edc:version\": \"1.11.16-SNAPSHOT\",\n" + " \"http://www.w3.org/2000/01/rdf-schema#isDefinedBy\": \"\",\n" + " \"edc:name\": \"Diagnostic Trouble Code Catalogue Version 2022\",\n" + " \"http://www.w3.org/ns/shacl#shapeGraph\": \"@prefix cx-common: . \\n@prefix : .\\n@prefix cx-diag: .\\n@prefix owl: .\\n@prefix rdf: .\\n@prefix xsd: .\\n@prefix sh: .\\n\\n:OemDTC rdf:type sh:NodeShape ;\\n sh:targetClass cx-diag:DTC ;\\n sh:property [\\n sh:path cx-diag:provisionedBy ;\\n sh:hasValue ;\\n ] ;\\n sh:property [\\n sh:path cx-diag:version ;\\n sh:hasValue 0^^xsd:long ;\\n ] ;\\n sh:property [\\n sh:path cx-diag:affects ;\\n sh:class :OemDiagnosedParts ;\\n ] ;\\n\\n:OemDiagnosedParts rdf:type sh:NodeShape ;\\n sh:targetClass cx-diag:DiagnosedPart ;\\n sh:property [\\n sh:path cx-diag:provisionedBy ;\\n sh:hasValue ;\\n ] ;\\n\",\n" + diff --git a/agent-plane/agentplane-azure-vault/README.md b/agent-plane/agentplane-azure-vault/README.md index ad712ca..c997993 100644 --- a/agent-plane/agentplane-azure-vault/README.md +++ b/agent-plane/agentplane-azure-vault/README.md @@ -54,7 +54,7 @@ mvn -s ../../../settings.xml install -Pwith-docker-image Alternatively, after a sucessful [build](#building) the docker image of the Agent Plane is created using ```console -docker build -t tractusx//agentplane-azure-vault:1.10.15-SNAPSHOT -f src/main/docker/Dockerfile . +docker build -t tractusx//agentplane-azure-vault:1.11.16-SNAPSHOT -f src/main/docker/Dockerfile . ``` To run the docker image, you could invoke this command diff --git a/agent-plane/agentplane-azure-vault/pom.xml b/agent-plane/agentplane-azure-vault/pom.xml index 05e8919..ef45794 100644 --- a/agent-plane/agentplane-azure-vault/pom.xml +++ b/agent-plane/agentplane-azure-vault/pom.xml @@ -25,7 +25,7 @@ org.eclipse.tractusx.agents.edc agent-plane - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT ../pom.xml diff --git a/agent-plane/agentplane-azure-vault/resources/dataplane.properties b/agent-plane/agentplane-azure-vault/resources/dataplane.properties index d939784..76704f7 100644 --- a/agent-plane/agentplane-azure-vault/resources/dataplane.properties +++ b/agent-plane/agentplane-azure-vault/resources/dataplane.properties @@ -31,8 +31,6 @@ web.http.default.port=8082 web.http.default.path=/api web.http.public.port=8185 web.http.public.path=/api/v1/public -web.http.callback.port=8187 -web.http.callback.path=/callback web.http.control.port=9999 web.http.control.path=/api/dataplane/control edc.web.rest.cors.enabled=true @@ -67,7 +65,6 @@ edc.dataplane.token.validation.endpoints.consumer=http://consuming-control-plane cx.agent.controlplane.protocol=http://consuming-control-plane:8282 cx.agent.controlplane.management=http://consuming-control-plane:8181/management/v2 cx.agent.controlplane.management.provider=http://providing-control-plane:8181/management/v2 -cx.agent.callback=http://agent-plane:8187/callback/endpoint-data-reference cx.agent.skill.contract.default=Contract?partner=Skill cx.agent.service.allow=(edcs?://.*)|(https://query\\.wikidata\\.org/sparql)|(http://[^\\.]+:\\d+.*) diff --git a/agent-plane/agentplane-azure-vault/src/main/docker/Dockerfile b/agent-plane/agentplane-azure-vault/src/main/docker/Dockerfile index e58f62e..420a3c0 100644 --- a/agent-plane/agentplane-azure-vault/src/main/docker/Dockerfile +++ b/agent-plane/agentplane-azure-vault/src/main/docker/Dockerfile @@ -16,13 +16,13 @@ # SPDX-License-Identifier: Apache-2.0 -FROM alpine:3.18.2 AS otel +FROM alpine:3 AS otel ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar" HEALTHCHECK NONE -RUN apk update && apk add curl=8.4.0-r0 --no-cache +RUN apk update && apk add curl --no-cache RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar FROM eclipse-temurin:17-jre-alpine diff --git a/agent-plane/agentplane-hashicorp/README.md b/agent-plane/agentplane-hashicorp/README.md index dd12abb..0f67899 100644 --- a/agent-plane/agentplane-hashicorp/README.md +++ b/agent-plane/agentplane-hashicorp/README.md @@ -54,7 +54,7 @@ mvn -s ../../../settings.xml install -Pwith-docker-image Alternatively, after a sucessful [build](#building) the docker image of the Agent Plane is created using ```console -docker build -t tractusx/agentplane-hashicorp:1.10.15-SNAPSHOT -f src/main/docker/Dockerfile . +docker build -t tractusx/agentplane-hashicorp:1.11.16-SNAPSHOT -f src/main/docker/Dockerfile . ``` To run the docker image, you could invoke this command @@ -66,7 +66,7 @@ docker run -p 8082:8082 \ -v $(pwd)/resources/dataplane.properties:/app/configuration.properties \ -v $(pwd)/resources/opentelemetry.properties:/app/opentelemetry.properties \ -v $(pwd)/resources/logging.properties:/app/logging.properties \ - tractusx/agentplane-hashicorp:1.10.15-SNAPSHOT + tractusx/agentplane-hashicorp:1.11.16-SNAPSHOT ```` Afterwards, you should be able to access the [local SparQL endpoint](http://localhost:8082/api/agent) via diff --git a/agent-plane/agentplane-hashicorp/pom.xml b/agent-plane/agentplane-hashicorp/pom.xml index ef7c23d..9e7f64b 100644 --- a/agent-plane/agentplane-hashicorp/pom.xml +++ b/agent-plane/agentplane-hashicorp/pom.xml @@ -25,7 +25,7 @@ org.eclipse.tractusx.agents.edc agent-plane - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT ../pom.xml diff --git a/agent-plane/agentplane-hashicorp/resources/dataplane.properties b/agent-plane/agentplane-hashicorp/resources/dataplane.properties index f47d2ab..f4eee3c 100644 --- a/agent-plane/agentplane-hashicorp/resources/dataplane.properties +++ b/agent-plane/agentplane-hashicorp/resources/dataplane.properties @@ -31,8 +31,6 @@ web.http.default.port=8082 web.http.default.path=/api web.http.public.port=8185 web.http.public.path=/api/v1/public -web.http.callback.port=8187 -web.http.callback.path=/callback web.http.control.port=9999 web.http.control.path=/api/dataplane/control edc.web.rest.cors.enabled=true @@ -69,7 +67,6 @@ edc.dataplane.token.validation.endpoints.consumer=http://consuming-control-plane cx.agent.controlplane.protocol=http://consuming-control-plane:8282 cx.agent.controlplane.management=http://consuming-control-plane:8181/management/v2 cx.agent.controlplane.management.provider=http://providing-control-plane:8181/management/v2 -cx.agent.callback=http://agent-plane:8187/callback/endpoint-data-reference cx.agent.skill.contract.default=Contract?partner=Skill cx.agent.service.allow=(edcs?://.*)|(https://query\\.wikidata\\.org/sparql)|(http://[^\\.]+:\\d+.*) diff --git a/agent-plane/agentplane-hashicorp/src/main/docker/Dockerfile b/agent-plane/agentplane-hashicorp/src/main/docker/Dockerfile index 54f0b76..61d784e 100644 --- a/agent-plane/agentplane-hashicorp/src/main/docker/Dockerfile +++ b/agent-plane/agentplane-hashicorp/src/main/docker/Dockerfile @@ -15,13 +15,13 @@ # # SPDX-License-Identifier: Apache-2.0 -FROM alpine:3.18.2 AS otel +FROM alpine:3 AS otel ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.12.1/opentelemetry-javaagent.jar" HEALTHCHECK NONE -RUN apk update && apk add curl=8.4.0-r0 --no-cache +RUN apk update && apk add curl --no-cache RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar FROM eclipse-temurin:17-jre-alpine diff --git a/agent-plane/pom.xml b/agent-plane/pom.xml index 7416a7e..f5635c1 100644 --- a/agent-plane/pom.xml +++ b/agent-plane/pom.xml @@ -28,7 +28,7 @@ org.eclipse.tractusx.agents edc - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT ../pom.xml Tractus-X EDC Agent Plane diff --git a/charts/agent-connector-azure-vault/Chart.yaml b/charts/agent-connector-azure-vault/Chart.yaml index 44899eb..b03f20f 100644 --- a/charts/agent-connector-azure-vault/Chart.yaml +++ b/charts/agent-connector-azure-vault/Chart.yaml @@ -42,12 +42,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.10.15-SNAPSHOT +version: 1.11.16-SNAPSHOT # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.10.15-SNAPSHOT" +appVersion: "1.11.16-SNAPSHOT" home: https://github.com/eclipse-tractusx/knowledge-agents-edc/ sources: - https://github.com/eclipse-tractusx/knowledge-agents-edc/tree/main/charts/agent-connector diff --git a/charts/agent-connector-azure-vault/README.md b/charts/agent-connector-azure-vault/README.md index 0239f5f..f75fc61 100644 --- a/charts/agent-connector-azure-vault/README.md +++ b/charts/agent-connector-azure-vault/README.md @@ -20,7 +20,7 @@ # agent-connector-azure-vault -![Version: 1.10.15-SNAPSHOT](https://img.shields.io/badge/Version-1.9.8--SNAPSHOT-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.10.15-SNAPSHOT](https://img.shields.io/badge/AppVersion-1.9.5--SNAPSHOT-informational?style=flat-square) +![Version: 1.11.16-SNAPSHOT](https://img.shields.io/badge/Version-1.9.8--SNAPSHOT-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.11.16-SNAPSHOT](https://img.shields.io/badge/AppVersion-1.9.5--SNAPSHOT-informational?style=flat-square) A Helm chart for an Agent-Enabled Tractus-X Eclipse Data Space Connector configured against Azure Vault. This is a variant of [the Tractus-X Azure Vault Connector Helm Chart](https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector-azure-vault) which allows to deal with several data (and agent) planes. The connector deployment consists of at least two runtime consists of a @@ -112,7 +112,7 @@ Combined, run this shell command to start the in-memory Tractus-X EDC runtime: ```shell helm repo add eclipse-tractusx https://eclipse-tractusx.github.io/charts/dev -helm install my-release eclipse-tractusx/agent-connector-azure-vault --version 1.10.15-SNAPSHOT\ +helm install my-release eclipse-tractusx/agent-connector-azure-vault --version 1.11.16-SNAPSHOT\ -f /tractusx-connector-azure-vault-test.yaml \ --set vault.azure.name=$AZURE_VAULT_NAME \ --set vault.azure.client=$AZURE_CLIENT_ID \ diff --git a/charts/agent-connector-azure-vault/templates/deployment-dataplane.yaml b/charts/agent-connector-azure-vault/templates/deployment-dataplane.yaml index d6524e8..4b4663b 100644 --- a/charts/agent-connector-azure-vault/templates/deployment-dataplane.yaml +++ b/charts/agent-connector-azure-vault/templates/deployment-dataplane.yaml @@ -170,12 +170,6 @@ spec: ################### # AGENT CALLBACK # ################### - - name: "WEB_HTTP_CALLBACK_PORT" - value: {{ $dataplane.endpoints.callback.port | quote }} - - name: "WEB_HTTP_CALLBACK_PATH" - value: {{ $dataplane.endpoints.callback.path | quote }} - - name: "CX_AGENT_CALLBACK" - value: {{ printf "http://%s-%s:%v%s/endpoint-data-reference" ( include "txdc.fullname" $root ) $dataplane.name $dataplane.endpoints.callback.port $dataplane.endpoints.callback.path | quote }} - name: "EDC_API_AUTH_KEY" value: {{ $root.Values.controlplane.endpoints.management.authKey | required ".Values.controlplane.endpoints.mangement.authKey is required" | quote }} - name: "EDC_PARTICIPANT_ID" diff --git a/charts/agent-connector-azure-vault/values.yaml b/charts/agent-connector-azure-vault/values.yaml index 911c2a7..7e413bc 100644 --- a/charts/agent-connector-azure-vault/values.yaml +++ b/charts/agent-connector-azure-vault/values.yaml @@ -361,9 +361,6 @@ dataplanes: proxy: port: 8186 path: /proxy - callback: - port: 8087 - path: /callback metrics: port: 9090 path: /metrics diff --git a/charts/agent-connector-memory/Chart.yaml b/charts/agent-connector-memory/Chart.yaml index cad3d68..f09e329 100644 --- a/charts/agent-connector-memory/Chart.yaml +++ b/charts/agent-connector-memory/Chart.yaml @@ -42,12 +42,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.10.15-SNAPSHOT +version: 1.11.16-SNAPSHOT # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.10.15-SNAPSHOT" +appVersion: "1.11.16-SNAPSHOT" home: https://github.com/eclipse-tractusx/knowledge-agents-edc/ sources: - https://github.com/eclipse-tractusx/knowledge-agents-edc/tree/main/charts/agent-connector diff --git a/charts/agent-connector-memory/README.md b/charts/agent-connector-memory/README.md index 00fdc5a..76fc001 100644 --- a/charts/agent-connector-memory/README.md +++ b/charts/agent-connector-memory/README.md @@ -20,7 +20,7 @@ # agent-connector-memory -![Version: 1.10.15-SNAPSHOT](https://img.shields.io/badge/Version-1.9.8--SNAPSHOT-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.10.15-SNAPSHOT](https://img.shields.io/badge/AppVersion-1.9.5--SNAPSHOT-informational?style=flat-square) +![Version: 1.11.16-SNAPSHOT](https://img.shields.io/badge/Version-1.9.8--SNAPSHOT-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.11.16-SNAPSHOT](https://img.shields.io/badge/AppVersion-1.9.5--SNAPSHOT-informational?style=flat-square) A Helm chart for an Agent-Enabled Tractus-X Eclipse Data Space Connector using In-Memory Persistence. This is a variant of [the Tractus-X In-Memory Connector Helm Chart](https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector-memory) which allows to deal with several data (and agent) planes. The connector deployment consists of at least two runtime consists of a @@ -108,7 +108,7 @@ Combined, run this shell command to start the in-memory Tractus-X EDC runtime: ```shell helm repo add eclipse-tractusx https://eclipse-tractusx.github.io/charts/dev -helm install my-release eclipse-tractusx/agent-connector --version 1.10.15-SNAPSHOT +helm install my-release eclipse-tractusx/agent-connector --version 1.11.16-SNAPSHOT ``` ## Maintainers diff --git a/charts/agent-connector-memory/templates/deployment-dataplane.yaml b/charts/agent-connector-memory/templates/deployment-dataplane.yaml index 1005492..7891126 100644 --- a/charts/agent-connector-memory/templates/deployment-dataplane.yaml +++ b/charts/agent-connector-memory/templates/deployment-dataplane.yaml @@ -170,12 +170,6 @@ spec: ################### # AGENT CALLBACK # ################### - - name: "WEB_HTTP_CALLBACK_PORT" - value: {{ $dataplane.endpoints.callback.port | quote }} - - name: "WEB_HTTP_CALLBACK_PATH" - value: {{ $dataplane.endpoints.callback.path | quote }} - - name: "CX_AGENT_CALLBACK" - value: {{ printf "http://%s-%s:%v%s/endpoint-data-reference" ( include "txdc.fullname" $root ) $dataplane.name $dataplane.endpoints.callback.port $dataplane.endpoints.callback.path | quote }} - name: "EDC_API_AUTH_KEY" value: {{ $root.Values.controlplane.endpoints.management.authKey | required ".Values.controlplane.endpoints.mangement.authKey is required" | quote }} - name: "EDC_PARTICIPANT_ID" diff --git a/charts/agent-connector-memory/values.yaml b/charts/agent-connector-memory/values.yaml index 0c28b0f..c188211 100644 --- a/charts/agent-connector-memory/values.yaml +++ b/charts/agent-connector-memory/values.yaml @@ -357,9 +357,6 @@ dataplanes: proxy: port: 8186 path: /proxy - callback: - port: 8087 - path: /callback metrics: port: 9090 path: /metrics diff --git a/charts/agent-connector/Chart.yaml b/charts/agent-connector/Chart.yaml index 66ad41b..16063ba 100644 --- a/charts/agent-connector/Chart.yaml +++ b/charts/agent-connector/Chart.yaml @@ -41,12 +41,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.10.15-SNAPSHOT +version: 1.11.16-SNAPSHOT # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.10.15-SNAPSHOT" +appVersion: "1.11.16-SNAPSHOT" home: https://github.com/eclipse-tractusx/knowledge-agents-edc/ sources: - https://github.com/eclipse-tractusx/knowledge-agents-edc/tree/main/charts/agent-connector diff --git a/charts/agent-connector/README.md b/charts/agent-connector/README.md index 74cf4cf..b14a8bb 100644 --- a/charts/agent-connector/README.md +++ b/charts/agent-connector/README.md @@ -20,7 +20,7 @@ # agent-connector -![Version: 1.10.15-SNAPSHOT](https://img.shields.io/badge/Version-1.9.8--SNAPSHOT-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.10.15-SNAPSHOT](https://img.shields.io/badge/AppVersion-1.9.5--SNAPSHOT-informational?style=flat-square) +![Version: 1.11.16-SNAPSHOT](https://img.shields.io/badge/Version-1.9.8--SNAPSHOT-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.11.16-SNAPSHOT](https://img.shields.io/badge/AppVersion-1.9.5--SNAPSHOT-informational?style=flat-square) A Helm chart for an Agent-Enabled Tractus-X Eclipse Data Space Connector. This is a variant of [the Tractus-X Connector Helm Chart](https://github.com/eclipse-tractusx/tractusx-edc/tree/main/charts/tractusx-connector) which allows to deal with several data (and agent) planes. The connector deployment consists of at least two runtime consists of a @@ -108,7 +108,7 @@ Combined, run this shell command to start the in-memory Tractus-X EDC runtime: ```shell helm repo add eclipse-tractusx https://eclipse-tractusx.github.io/charts/dev -helm install my-release eclipse-tractusx/agent-connector --version 1.10.15-SNAPSHOT +helm install my-release eclipse-tractusx/agent-connector --version 1.11.16-SNAPSHOT ``` ## Maintainers diff --git a/charts/agent-connector/templates/deployment-dataplane.yaml b/charts/agent-connector/templates/deployment-dataplane.yaml index b487be0..d35283c 100644 --- a/charts/agent-connector/templates/deployment-dataplane.yaml +++ b/charts/agent-connector/templates/deployment-dataplane.yaml @@ -170,12 +170,6 @@ spec: ################### # AGENT CALLBACK # ################### - - name: "WEB_HTTP_CALLBACK_PORT" - value: {{ $dataplane.endpoints.callback.port | quote }} - - name: "WEB_HTTP_CALLBACK_PATH" - value: {{ $dataplane.endpoints.callback.path | quote }} - - name: "CX_AGENT_CALLBACK" - value: {{ printf "http://%s-%s:%v%s/endpoint-data-reference" ( include "txdc.fullname" $root ) $dataplane.name $dataplane.endpoints.callback.port $dataplane.endpoints.callback.path | quote }} - name: "EDC_API_AUTH_KEY" value: {{ $root.Values.controlplane.endpoints.management.authKey | required ".Values.controlplane.endpoints.mangement.authKey is required" | quote }} - name: "EDC_PARTICIPANT_ID" diff --git a/charts/agent-connector/values.yaml b/charts/agent-connector/values.yaml index a151bf8..945a480 100644 --- a/charts/agent-connector/values.yaml +++ b/charts/agent-connector/values.yaml @@ -358,9 +358,6 @@ dataplanes: proxy: port: 8186 path: /proxy - callback: - port: 8087 - path: /callback metrics: port: 9090 path: /metrics diff --git a/common/README.md b/common/README.md index 8d9e34b..4471a90 100644 --- a/common/README.md +++ b/common/README.md @@ -57,7 +57,7 @@ add the following dependency to your maven dependencies (gradle should work anal org.eclipse.tractusx.edc auth-jwt - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT diff --git a/common/auth-jwt/README.md b/common/auth-jwt/README.md index f06e4e2..ad5dc24 100644 --- a/common/auth-jwt/README.md +++ b/common/auth-jwt/README.md @@ -37,7 +37,7 @@ Add the following dependency to your EDC artifact pom: org.eclipse.tractusx.agents.edc auth-jwt - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT ``` diff --git a/common/auth-jwt/pom.xml b/common/auth-jwt/pom.xml index dd466d6..624ecd2 100644 --- a/common/auth-jwt/pom.xml +++ b/common/auth-jwt/pom.xml @@ -27,7 +27,7 @@ org.eclipse.tractusx.agents edc - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT ../../pom.xml diff --git a/docs/README.md b/docs/README.md index 49fad16..d29a066 100644 --- a/docs/README.md +++ b/docs/README.md @@ -76,7 +76,7 @@ dependencies: - name: agent-connector-memory repository: https://eclipse-tractusx.github.io/charts/dev - version: 1.10.15-SNAPSHOT + version: 1.11.16-SNAPSHOT alias: my-connector ``` @@ -87,7 +87,7 @@ dependencies: - name: agent-connector-azure-vault repository: https://eclipse-tractusx.github.io/charts/dev - version: 1.10.15-SNAPSHOT + version: 1.11.16-SNAPSHOT alias: my-connector ``` @@ -98,7 +98,7 @@ dependencies: - name: agent-connector repository: https://eclipse-tractusx.github.io/charts/dev - version: 1.10.15-SNAPSHOT + version: 1.11.16-SNAPSHOT alias: my-connector ``` diff --git a/pom.xml b/pom.xml index 1e0c735..c09e4e9 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 4.0.0 org.eclipse.tractusx.agents edc - 1.10.15-SNAPSHOT + 1.11.16-SNAPSHOT pom Tractus-X Knowledge Agents EDC Extensions EDC-Related Artifacts for Federated Procedure Calls diff --git a/upgrade_version.sh b/upgrade_version.sh index 806b2e8..e9de2ff 100755 --- a/upgrade_version.sh +++ b/upgrade_version.sh @@ -16,7 +16,7 @@ # # SPDX-License-Identifier: Apache-2.0 -OLD_VERSION=1.10.15-SNAPSHOT +OLD_VERSION=1.11.16-SNAPSHOT echo Upgrading from $OLD_VERSION to $1 PATTERN=s/$OLD_VERSION/$1/g LC_ALL=C