Skip to content
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

chore: bumped to EDC 0.10.0 #8

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions gradle/libs.stable.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format.version = "1.1"

[versions]
edc = "0.9.1"
edc = "0.10.0"
postgres = "42.7.4"

# add here
Expand Down Expand Up @@ -31,6 +31,7 @@ edc-junit = { module = "org.eclipse.edc:junit", version.ref = "edc" }
edc-jersey-core = { module = "org.eclipse.edc:jersey-core", version.ref = "edc" }
edc-jetty-core = { module = "org.eclipse.edc:jetty-core", version.ref = "edc" }
edc-configuration-filesystem = { module = "org.eclipse.edc:configuration-filesystem", version.ref = "edc" }
edc-token-core = { module = "org.eclipse.edc:token-core", version.ref = "edc" }

# Control Plane-specific dependencies
edc-controlplane-core = { module = "org.eclipse.edc:control-plane-core", version.ref = "edc" }
Expand Down Expand Up @@ -105,10 +106,11 @@ controlplane = ["edc-configuration-filesystem", "edc-controlplane-core", "edc-au
"edc-api-management", "edc-api-management-config", "edc-api-management-edr", "edc-api-management-dataplaneselector",
"edc-api-observability", "edc-dsp", "edc-spi-jwt", "edc-http", "edc-controlplane-callback-dispatcher-event",
"edc-controlplane-callback-dispatcher-http", "edc-identity-core-did", "edc-iam-mock", "edc-identity-trust-transform",
"edc-api-control-configuration", "edc-lib-transform", "edc-identity-vc-ldp", "edc-did-web", "edc-lib-jws2020", "edc-core-edrstore", "edc-edr-storereceiver"]
"edc-api-control-configuration", "edc-lib-transform", "edc-identity-vc-ldp", "edc-did-web", "edc-lib-jws2020", "edc-core-edrstore",
"edc-edr-storereceiver", "edc-token-core"]

dataplane = ["edc-configuration-filesystem", "edc-jersey-core", "edc-jetty-core", "edc-dataplane-core", "edc-dataplane-api-control-config", "edc-dataplane-api-control-client", "edc-dataplane-selfregistration",
"edc-dataplane-http", "edc-dataplane-http-oauth2", "edc-dataplane-api-public", "edc-dataplane-api-signaling", "edc-dataplane-iam"]
"edc-dataplane-http", "edc-dataplane-http-oauth2", "edc-dataplane-api-public", "edc-dataplane-api-signaling", "edc-dataplane-iam", "edc-token-core"]

sql-controlplane = ["edc-sql-assetindex", "edc-sql-contractdef", "edc-sql-contractneg", "edc-sql-policydef",
"edc-sql-edrcache", "edc-sql-transferprocess", "edc-sql-dataplane-instancestore", "edc-sql-core", "edc-sql-lease", "edc-sql-policymonitor",
Expand Down
7 changes: 4 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format.version = "1.1"

[versions]
edc = "0.10.0-SNAPSHOT"
edc = "0.11.0-SNAPSHOT"
postgres = "42.7.4"
jakarta-json = "2.1.3"
jackson = "2.18.0"
Expand Down Expand Up @@ -33,6 +33,7 @@ edc-jsonld = { module = "org.eclipse.edc:json-ld", version.ref = "edc" }
edc-junit = { module = "org.eclipse.edc:junit", version.ref = "edc" }
edc-jersey-core = { module = "org.eclipse.edc:jersey-core", version.ref = "edc" }
edc-jetty-core = { module = "org.eclipse.edc:jetty-core", version.ref = "edc" }
edc-token-core = { module = "org.eclipse.edc:token-core", version.ref = "edc" }

# Control Plane-specific dependencies
edc-controlplane-core = { module = "org.eclipse.edc:control-plane-core", version.ref = "edc" }
Expand Down Expand Up @@ -111,14 +112,14 @@ testcontainers-postgres = { module = "org.testcontainers:postgresql", version.re
[bundles]
dpf = ["edc-dpf-selector-core", "edc-spi-dataplane-selector", "edc-dpf-selector-control-api", "edc-dpf-signaling-client", "edc-dpf-transfer-signaling"]

controlplane = ["edc-controlplane-core", "edc-auth-tokenbased", "edc-auth-configuration", "edc-policy-monitor-core",
controlplane = ["edc-token-core", "edc-controlplane-core", "edc-auth-tokenbased", "edc-auth-configuration", "edc-policy-monitor-core",
"edc-api-management", "edc-api-management-config", "edc-api-management-edr", "edc-api-management-dataplaneselector",
"edc-api-observability", "edc-dsp", "edc-spi-jwt", "edc-http", "edc-controlplane-callback-dispatcher-event",
"edc-controlplane-callback-dispatcher-http", "edc-identity-core-did", "edc-iam-mock", "edc-identity-trust-transform",
"edc-api-control-configuration", "edc-lib-transform", "edc-identity-vc-ldp", "edc-did-web", "edc-lib-jws2020", "edc-core-edrstore", "edc-edr-storereceiver"]

dataplane = ["edc-jersey-core", "edc-jetty-core", "edc-dataplane-core", "edc-dataplane-api-control-config", "edc-dataplane-api-control-client", "edc-dataplane-selfregistration",
"edc-dataplane-http", "edc-dataplane-http-oauth2", "edc-dataplane-api-public", "edc-dataplane-api-signaling", "edc-dataplane-iam"]
"edc-dataplane-http", "edc-dataplane-http-oauth2", "edc-dataplane-api-public", "edc-dataplane-api-signaling", "edc-dataplane-iam", "edc-token-core"]

sql-controlplane = ["edc-sql-assetindex", "edc-sql-contractdef", "edc-sql-contractneg", "edc-sql-policydef",
"edc-sql-edrcache", "edc-sql-transferprocess", "edc-sql-dataplane-instancestore", "edc-sql-core", "edc-sql-lease", "edc-sql-policymonitor",
Expand Down
10 changes: 5 additions & 5 deletions runtimes/snapshot/dataplane-snapshot/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ plugins {
}

dependencies {
runtimeOnly(stableLibs.edc.api.observability)
runtimeOnly(stableLibs.bundles.dataplane)
runtimeOnly(stableLibs.edc.jsonld) // needed by the DataPlaneSignalingApi
runtimeOnly(stableLibs.edc.dpf.selector.client) // for the selector service -> self registration
runtimeOnly(libs.edc.api.observability)
runtimeOnly(libs.bundles.dataplane)
runtimeOnly(libs.edc.jsonld) // needed by the DataPlaneSignalingApi
runtimeOnly(libs.edc.dpf.selector.client) // for the selector service -> self registration

// uncomment the following lines to compile with Hashicorp Vault and Postgres persistence
// runtimeOnly(stableLibs.edc.vault.hashicorp)
runtimeOnly(stableLibs.bundles.sql.dataplane)
runtimeOnly(libs.bundles.sql.dataplane)

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import static org.awaitility.Awaitility.await;
import static org.eclipse.edc.connector.controlplane.test.system.utils.PolicyFixtures.noConstraintPolicy;
import static org.eclipse.edc.connector.controlplane.transfer.spi.types.TransferProcessStates.STARTED;
import static org.eclipse.edc.connector.controlplane.transfer.spi.types.TransferProcessStates.SUSPENDED;
import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE;
import static org.eclipse.edc.sql.testfixtures.PostgresqlEndToEndInstance.createDatabase;
import static org.eclipse.edc.util.io.Ports.getFreePort;
Expand Down Expand Up @@ -128,7 +129,9 @@ void storeKeys() {

@ParameterizedTest
@ArgumentsSource(ParticipantsArgProvider.class)
void httpPullTransfer(BaseParticipant consumer, BaseParticipant provider) {
void httpPullTransfer(BaseParticipant consumer, BaseParticipant provider, String protocol) {
consumer.setProtocol(protocol);
provider.setProtocol(protocol);
provider.waitForDataPlane();
providerDataSource.when(HttpRequest.request()).respond(HttpResponse.response().withBody("data"));
var assetId = UUID.randomUUID().toString();
Expand Down Expand Up @@ -161,6 +164,47 @@ void httpPullTransfer(BaseParticipant consumer, BaseParticipant provider) {

}

@ParameterizedTest
@ArgumentsSource(ParticipantsArgProvider.class)
void suspendAndResume_httpPull_dataTransfer(BaseParticipant consumer, BaseParticipant provider, String protocol) {
consumer.setProtocol(protocol);
provider.setProtocol(protocol);
provider.waitForDataPlane();
providerDataSource.when(HttpRequest.request()).respond(HttpResponse.response().withBody("data"));
var assetId = UUID.randomUUID().toString();
createResourcesOnProvider(provider, assetId, PolicyFixtures.noConstraintPolicy(), httpSourceDataAddress());

var transferProcessId = consumer.requestAssetFrom(assetId, provider)
.withTransferType("HttpData-PULL")
.execute();

consumer.awaitTransferToBeInState(transferProcessId, STARTED);

var edr = await().atMost(consumer.getTimeout()).until(() -> consumer.getEdr(transferProcessId), Objects::nonNull);

var msg = UUID.randomUUID().toString();
await().atMost(consumer.getTimeout()).untilAsserted(() -> consumer.pullData(edr, Map.of("message", msg), body -> assertThat(body).isEqualTo("data")));

consumer.suspendTransfer(transferProcessId, "supension");

consumer.awaitTransferToBeInState(transferProcessId, SUSPENDED);

// checks that the EDR is gone once the transfer has been suspended
await().atMost(consumer.getTimeout()).untilAsserted(() -> assertThatThrownBy(() -> consumer.getEdr(transferProcessId)));
// checks that transfer fails
await().atMost(consumer.getTimeout()).untilAsserted(() -> assertThatThrownBy(() -> consumer.pullData(edr, Map.of("message", msg), body -> assertThat(body).isEqualTo("data"))));

consumer.resumeTransfer(transferProcessId);

// check that transfer is available again
consumer.awaitTransferToBeInState(transferProcessId, STARTED);
var secondEdr = await().atMost(consumer.getTimeout()).until(() -> consumer.getEdr(transferProcessId), Objects::nonNull);
var secondMessage = UUID.randomUUID().toString();
await().atMost(consumer.getTimeout()).untilAsserted(() -> consumer.pullData(secondEdr, Map.of("message", secondMessage), body -> assertThat(body).isEqualTo("data")));

providerDataSource.verify(HttpRequest.request("/source").withMethod("GET"));
}

protected void createResourcesOnProvider(BaseParticipant provider, String assetId, JsonObject contractPolicy, Map<String, Object> dataAddressProperties) {
provider.createAsset(assetId, Map.of("description", "description"), dataAddressProperties);
var contractPolicyId = provider.createPolicyDefinition(contractPolicy);
Expand All @@ -173,8 +217,10 @@ private static class ParticipantsArgProvider implements ArgumentsProvider {
@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext context) throws Exception {
return Stream.of(
Arguments.of(REMOTE_PARTICIPANT, LOCAL_PARTICIPANT),
Arguments.of(LOCAL_PARTICIPANT, REMOTE_PARTICIPANT)
Arguments.of(REMOTE_PARTICIPANT, LOCAL_PARTICIPANT, "dataspace-protocol-http"),
Arguments.of(LOCAL_PARTICIPANT, REMOTE_PARTICIPANT, "dataspace-protocol-http"),
Arguments.of(REMOTE_PARTICIPANT, LOCAL_PARTICIPANT, "dataspace-protocol-http:2024/1"),
Arguments.of(LOCAL_PARTICIPANT, REMOTE_PARTICIPANT, "dataspace-protocol-http:2024/1")
);
}
}
Expand Down