Skip to content

Commit d43f918

Browse files
committed
avoid data plane registration
1 parent 8f322a8 commit d43f918

File tree

25 files changed

+11
-220
lines changed

25 files changed

+11
-220
lines changed

advanced/advanced-01-open-telemetry/README.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,6 @@ docker compose -f advanced/advanced-01-open-telemetry/docker-compose.yaml up --a
3131

3232
Open a new terminal.
3333

34-
Register data planes for provider and consumer:
35-
36-
```bash
37-
curl -H 'Content-Type: application/json' \
38-
-H "X-Api-Key: password" \
39-
-d @transfer/transfer-00-prerequisites/resources/dataplane/register-data-plane-provider.json \
40-
-X POST "http://localhost:19193/management/v2/dataplanes" \
41-
-s | jq
42-
```
43-
44-
```bash
45-
curl -H 'Content-Type: application/json' \
46-
-H "X-Api-Key: password" \
47-
-d @transfer/transfer-00-prerequisites/resources/dataplane/register-data-plane-consumer.json \
48-
-X POST "http://localhost:29193/management/v2/dataplanes" \
49-
-s | jq
50-
```
51-
5234
Create an asset:
5335

5436
```bash

advanced/advanced-01-open-telemetry/open-telemetry-runtime/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ dependencies {
4040
implementation(libs.edc.data.plane.selector.api)
4141
implementation(libs.edc.data.plane.selector.core)
4242

43+
implementation(libs.edc.data.plane.self.registration)
4344
implementation(libs.edc.data.plane.control.api)
4445
implementation(libs.edc.data.plane.public.api)
4546
implementation(libs.edc.data.plane.core)

advanced/advanced-01-open-telemetry/resources/negotiate-contract.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
44
},
55
"@type": "ContractRequest",
6-
"counterPartyAddress": "http://provider:19194/protocol",
6+
"counterPartyAddress": "http://localhost:19194/protocol",
77
"protocol": "dataspace-protocol-http",
88
"policy": {
99
"@context": "http://www.w3.org/ns/odrl.jsonld",
1010
"@id": "{{contract-offer-id}}",
1111
"@type": "Offer",
12-
"permission": [],
13-
"prohibition": [],
14-
"obligation": [],
1512
"assigner": "provider",
1613
"target": "assetId"
1714
}

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ edc-data-plane-http = { module = "org.eclipse.edc:data-plane-http", version.ref
3838
edc-data-plane-kafka = { module = "org.eclipse.edc:data-plane-kafka", version.ref = "edc" }
3939
edc-data-plane-selector-api = { module = "org.eclipse.edc:data-plane-selector-api", version.ref = "edc" }
4040
edc-data-plane-selector-core = { module = "org.eclipse.edc:data-plane-selector-core", version.ref = "edc" }
41+
edc-data-plane-self-registration = { module = "org.eclipse.edc:data-plane-self-registration", version.ref = "edc" }
4142
edc-data-plane-spi = { module = "org.eclipse.edc:data-plane-spi", version.ref = "edc" }
4243
edc-data-plane-util = { module = "org.eclipse.edc:data-plane-util", version.ref = "edc" }
4344
edc-dsp = { module = "org.eclipse.edc:dsp", version.ref = "edc" }

system-tests/src/test/java/org/eclipse/edc/samples/advanced/Advanced01openTelemetryTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import org.apache.http.HttpStatus;
1919
import org.eclipse.edc.junit.annotations.EndToEndTest;
20+
import org.eclipse.edc.samples.common.NegotiationCommon;
2021
import org.junit.jupiter.api.BeforeAll;
2122
import org.junit.jupiter.api.Test;
2223
import org.testcontainers.containers.ComposeContainer;
@@ -39,7 +40,6 @@
3940
import static org.eclipse.edc.samples.common.NegotiationCommon.fetchDatasetFromCatalog;
4041
import static org.eclipse.edc.samples.common.NegotiationCommon.getContractAgreementId;
4142
import static org.eclipse.edc.samples.common.NegotiationCommon.negotiateContract;
42-
import static org.eclipse.edc.samples.common.PrerequisitesCommon.runPrerequisites;
4343
import static org.eclipse.edc.samples.util.TransferUtil.checkTransferStatus;
4444
import static org.eclipse.edc.samples.util.TransferUtil.startTransfer;
4545

@@ -67,14 +67,14 @@ static void setUp() {
6767

6868
@Test
6969
void runSampleSteps() {
70-
runPrerequisites();
7170
createAsset();
7271
createPolicy();
7372
createContractDefinition();
7473
var catalogDatasetId = fetchDatasetFromCatalog(FETCH_DATASET_FROM_CATALOG_FILE_PATH);
7574
var contractNegotiationId = negotiateContract(NEGOTIATE_CONTRACT_FILE_PATH, catalogDatasetId);
7675
var contractAgreementId = getContractAgreementId(contractNegotiationId);
77-
var transferProcessId = startTransfer(getFileContentFromRelativePath(START_TRANSFER_FILE_PATH), contractAgreementId);
76+
var transferRequest = getFileContentFromRelativePath(START_TRANSFER_FILE_PATH);
77+
var transferProcessId = startTransfer(transferRequest, contractAgreementId);
7878
checkTransferStatus(transferProcessId, STARTED);
7979
assertJaegerState();
8080
}

system-tests/src/test/java/org/eclipse/edc/samples/common/PrerequisitesCommon.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,17 @@
1414

1515
package org.eclipse.edc.samples.common;
1616

17-
import io.restassured.http.ContentType;
18-
import org.apache.http.HttpStatus;
1917
import org.eclipse.edc.junit.extensions.EdcRuntimeExtension;
2018

2119
import java.util.Map;
2220

23-
import static io.restassured.RestAssured.given;
2421
import static org.eclipse.edc.samples.common.FileTransferCommon.getFileFromRelativePath;
2522

2623
public class PrerequisitesCommon {
2724
public static final String API_KEY_HEADER_KEY = "X-Api-Key";
2825
public static final String API_KEY_HEADER_VALUE = "password";
2926
public static final String PROVIDER_MANAGEMENT_URL = "http://localhost:19193/management";
3027
public static final String CONSUMER_MANAGEMENT_URL = "http://localhost:29193/management";
31-
public static final String CONSUMER_PUBLIC_URL = "http://localhost:29291/public";
3228

3329
private static final String CONNECTOR_MODULE_PATH = ":transfer:transfer-00-prerequisites:connector";
3430
private static final String PROVIDER = "provider";
@@ -41,11 +37,9 @@ public class PrerequisitesCommon {
4137
private static final String KEYSTORE_PASSWORD = "123456";
4238
private static final String PROVIDER_CONFIG_PROPERTIES_FILE_PATH = "transfer/transfer-00-prerequisites/resources/configuration/provider-configuration.properties";
4339
private static final String CONSUMER_CONFIG_PROPERTIES_FILE_PATH = "transfer/transfer-00-prerequisites/resources/configuration/consumer-configuration.properties";
44-
private static final String REGISTER_DATA_PLANE_PROVIDER_JSON = "transfer/transfer-00-prerequisites/resources/dataplane/register-data-plane-provider.json";
4540

4641
public static EdcRuntimeExtension getProvider() {
4742
return getConnector(CONNECTOR_MODULE_PATH, PROVIDER, PROVIDER_CONFIG_PROPERTIES_FILE_PATH);
48-
4943
}
5044

5145
public static EdcRuntimeExtension getConsumer() {
@@ -56,14 +50,6 @@ public static EdcRuntimeExtension getConsumer(String modulePath) {
5650
return getConnector(modulePath, CONSUMER, CONSUMER_CONFIG_PROPERTIES_FILE_PATH);
5751
}
5852

59-
public static void registerDataPlaneProvider() {
60-
registerDataPlane(PROVIDER_MANAGEMENT_URL, REGISTER_DATA_PLANE_PROVIDER_JSON);
61-
}
62-
63-
public static void runPrerequisites() {
64-
registerDataPlaneProvider();
65-
}
66-
6753
private static EdcRuntimeExtension getConnector(
6854
String modulePath,
6955
String moduleName,
@@ -79,19 +65,4 @@ EDC_FS_CONFIG, getFileFromRelativePath(configPropertiesFilePath).getAbsolutePath
7965
)
8066
);
8167
}
82-
83-
private static void registerDataPlane(String host, String payloadPath) {
84-
var requestBody = getFileFromRelativePath(payloadPath);
85-
86-
given()
87-
.headers(API_KEY_HEADER_KEY, API_KEY_HEADER_VALUE)
88-
.contentType(ContentType.JSON)
89-
.body(requestBody)
90-
.when()
91-
.post(host + "/v2/dataplanes")
92-
.then()
93-
.log()
94-
.ifError()
95-
.statusCode(HttpStatus.SC_OK);
96-
}
9768
}

system-tests/src/test/java/org/eclipse/edc/samples/transfer/Transfer00prerequisitesTest.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

system-tests/src/test/java/org/eclipse/edc/samples/transfer/Transfer01negotiationTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import static org.eclipse.edc.samples.common.NegotiationCommon.negotiateContract;
3030
import static org.eclipse.edc.samples.common.PrerequisitesCommon.getConsumer;
3131
import static org.eclipse.edc.samples.common.PrerequisitesCommon.getProvider;
32-
import static org.eclipse.edc.samples.common.PrerequisitesCommon.runPrerequisites;
3332

3433
@EndToEndTest
3534
public class Transfer01negotiationTest {
@@ -45,7 +44,6 @@ public class Transfer01negotiationTest {
4544

4645
@Test
4746
void runSampleSteps() {
48-
runPrerequisites();
4947
createAsset();
5048
createPolicy();
5149
createContractDefinition();

system-tests/src/test/java/org/eclipse/edc/samples/transfer/Transfer02consumerPullTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import static org.eclipse.edc.samples.common.PrerequisitesCommon.CONSUMER_MANAGEMENT_URL;
3737
import static org.eclipse.edc.samples.common.PrerequisitesCommon.getConsumer;
3838
import static org.eclipse.edc.samples.common.PrerequisitesCommon.getProvider;
39-
import static org.eclipse.edc.samples.common.PrerequisitesCommon.runPrerequisites;
4039
import static org.eclipse.edc.samples.util.TransferUtil.checkTransferStatus;
4140
import static org.eclipse.edc.samples.util.TransferUtil.startTransfer;
4241
import static org.hamcrest.Matchers.emptyString;
@@ -56,7 +55,6 @@ public class Transfer02consumerPullTest {
5655

5756
@Test
5857
void runSampleSteps() {
59-
runPrerequisites();
6058
var requestBody = getFileContentFromRelativePath(START_TRANSFER_FILE_PATH);
6159
var contractAgreementId = runNegotiation();
6260
var transferProcessId = startTransfer(requestBody, contractAgreementId);

system-tests/src/test/java/org/eclipse/edc/samples/transfer/Transfer03providerPushTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import static org.eclipse.edc.samples.common.NegotiationCommon.runNegotiation;
3232
import static org.eclipse.edc.samples.common.PrerequisitesCommon.getConsumer;
3333
import static org.eclipse.edc.samples.common.PrerequisitesCommon.getProvider;
34-
import static org.eclipse.edc.samples.common.PrerequisitesCommon.runPrerequisites;
3534
import static org.eclipse.edc.samples.util.TransferUtil.checkTransferStatus;
3635
import static org.eclipse.edc.samples.util.TransferUtil.startTransfer;
3736

@@ -58,7 +57,6 @@ static void setUp() {
5857

5958
@Test
6059
void runSampleSteps() {
61-
runPrerequisites();
6260
var contractAgreementId = runNegotiation();
6361
var requestBody = getFileContentFromRelativePath(START_TRANSFER_FILE_PATH);
6462
var transferProcessId = startTransfer(requestBody, contractAgreementId);

system-tests/src/test/java/org/eclipse/edc/samples/transfer/Transfer04eventConsumerTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import static org.eclipse.edc.samples.common.NegotiationCommon.runNegotiation;
3333
import static org.eclipse.edc.samples.common.PrerequisitesCommon.getConsumer;
3434
import static org.eclipse.edc.samples.common.PrerequisitesCommon.getProvider;
35-
import static org.eclipse.edc.samples.common.PrerequisitesCommon.runPrerequisites;
3635
import static org.eclipse.edc.samples.util.TransferUtil.checkTransferStatus;
3736
import static org.eclipse.edc.samples.util.TransferUtil.startTransfer;
3837

@@ -59,7 +58,6 @@ static void setUp() {
5958
void runSampleSteps() {
6059
var standardOutputStream = new ByteArrayOutputStream();
6160
System.setOut(new PrintStream(standardOutputStream));
62-
runPrerequisites();
6361
var requestBody = getFileContentFromRelativePath(START_TRANSFER_FILE_PATH);
6462
var contractAgreementId = runNegotiation();
6563
var transferProcessId = startTransfer(requestBody, contractAgreementId);

system-tests/src/test/java/org/eclipse/edc/samples/transfer/streaming/Streaming01httpToHttpTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.nio.file.Files;
2929
import java.nio.file.Path;
3030
import java.time.Duration;
31-
import java.util.List;
3231
import java.util.Map;
3332
import java.util.UUID;
3433

@@ -90,7 +89,6 @@ void setUp() throws IOException {
9089
@Test
9190
void streamData() throws IOException {
9291
var source = Files.createTempDirectory("source");
93-
PROVIDER.registerDataPlane(List.of("HttpStreaming"), List.of("HttpData"), List.of("HttpData-PUSH"));
9492

9593
PROVIDER.createAsset(getFileContentFromRelativePath(SAMPLE_FOLDER + "/asset.json")
9694
.replace("{{sourceFolder}}", source.toString()));

system-tests/src/test/java/org/eclipse/edc/samples/transfer/streaming/Streaming02KafkaToHttpTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import java.io.IOException;
3636
import java.net.URI;
3737
import java.time.Duration;
38-
import java.util.List;
3938
import java.util.Map;
4039
import java.util.Properties;
4140
import java.util.concurrent.Executors;
@@ -108,9 +107,6 @@ void setUp() throws IOException {
108107

109108
@Test
110109
void streamData() {
111-
112-
PROVIDER.registerDataPlane(List.of("Kafka"), List.of("HttpData"), List.of("HttpData-PUSH"));
113-
114110
PROVIDER.createAsset(getFileContentFromRelativePath(SAMPLE_FOLDER + "/1-asset.json")
115111
.replace("{{bootstrap.servers}}", kafkaContainer.getBootstrapServers())
116112
.replace("{{max.duration}}", MAX_DURATION)

system-tests/src/test/java/org/eclipse/edc/samples/transfer/streaming/StreamingParticipant.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,10 @@
1414

1515
package org.eclipse.edc.samples.transfer.streaming;
1616

17-
import jakarta.json.Json;
1817
import org.eclipse.edc.connector.controlplane.test.system.utils.Participant;
1918

20-
import java.util.List;
21-
import java.util.UUID;
22-
2319
import static io.restassured.http.ContentType.JSON;
24-
import static jakarta.json.Json.createArrayBuilder;
25-
import static jakarta.json.Json.createObjectBuilder;
26-
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.CONTEXT;
2720
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.ID;
28-
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE;
29-
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_PREFIX;
3021

3122
/**
3223
* Essentially a wrapper around the management API enabling to test interactions with other participants, eg. catalog, transfer...
@@ -42,25 +33,6 @@ public String getName() {
4233
return name;
4334
}
4435

45-
public void registerDataPlane(List<String> sourceTypes, List<String> destinationTypes, List<Object> transferTypes) {
46-
var jsonObject = Json.createObjectBuilder()
47-
.add(CONTEXT, createObjectBuilder().add(EDC_PREFIX, EDC_NAMESPACE))
48-
.add(ID, UUID.randomUUID().toString())
49-
.add(EDC_NAMESPACE + "url", controlEndpoint.getUrl() + "/transfer")
50-
.add(EDC_NAMESPACE + "allowedSourceTypes", createArrayBuilder(sourceTypes))
51-
.add(EDC_NAMESPACE + "allowedDestTypes", createArrayBuilder(destinationTypes))
52-
.add(EDC_NAMESPACE + "allowedTransferTypes", createArrayBuilder(transferTypes))
53-
.build();
54-
55-
managementEndpoint.baseRequest()
56-
.contentType(JSON)
57-
.body(jsonObject.toString())
58-
.when()
59-
.post("/v2/dataplanes")
60-
.then()
61-
.statusCode(200);
62-
}
63-
6436
public String createAsset(String requestBody) {
6537
return managementEndpoint.baseRequest()
6638
.contentType(JSON)

transfer/streaming/streaming-01-http-to-http/README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ export EDC_FS_CONFIG=transfer/streaming/streaming-01-http-to-http/streaming-01-r
2626
java -jar transfer/streaming/streaming-01-http-to-http/streaming-01-runtime/build/libs/connector.jar
2727
```
2828

29-
#### Register Data Plane on provider
30-
The provider connector needs to be aware of the streaming capabilities of the embedded dataplane, which can be registered with
31-
this call:
32-
```shell
33-
curl -H 'Content-Type: application/json' -d @transfer/streaming/streaming-01-http-to-http/dataplane.json -X POST "http://localhost:18181/management/v2/dataplanes"
34-
```
35-
36-
If you look at the `dataplane.json` you'll notice that the supported source is `HttpStreaming` and the supported sink is `HttpData`.
37-
3829
#### Register Asset, Policy Definition and Contract Definition on provider
3930
A "source" folder must first be created where the data plane will get the messages to be sent to the consumers.
4031
To do this, create a temp folder:

transfer/streaming/streaming-01-http-to-http/dataplane.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

transfer/streaming/streaming-01-http-to-http/streaming-01-runtime/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies {
3333
implementation(libs.edc.transfer.data.plane.signaling)
3434
implementation(libs.edc.data.plane.spi)
3535
implementation(libs.edc.data.plane.core)
36+
implementation(libs.edc.data.plane.self.registration)
3637
implementation(libs.edc.data.plane.http)
3738
}
3839

transfer/streaming/streaming-02-kafka-to-http/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ export EDC_FS_CONFIG=transfer/streaming/streaming-02-kafka-to-http/streaming-02-
2727
java -jar transfer/streaming/streaming-02-kafka-to-http/streaming-02-runtime/build/libs/connector.jar
2828
```
2929

30-
### Register Data Plane on provider
31-
32-
The provider connector needs to be aware of the kafka streaming capabilities of the embedded dataplane, which can be registered with
33-
this call:
34-
```shell
35-
curl -H 'Content-Type: application/json' -d @transfer/streaming/streaming-02-kafka-to-http/0-dataplane.json -X POST "http://localhost:18181/management/v2/dataplanes" -s | jq
36-
```
37-
38-
If you look at the `0-dataplane.json` you'll notice that the supported source is `Kafka` and the supported sink is `HttpData`.
39-
4030
### Register Asset, Policy Definition and Contract Definition on provider
4131

4232
A "source" kafka topic must first be created where the data plane will get the event records to be sent to the consumers.

0 commit comments

Comments
 (0)