Skip to content

Commit

Permalink
use BOMs, remove unneeded extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Oct 15, 2024
1 parent 9819f11 commit 60b0e71
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 248 deletions.
2 changes: 1 addition & 1 deletion mxd-runtimes/e2e-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies {
testImplementation(libs.edc.junit)
testImplementation(libs.edc.spi.catalog)
testImplementation(libs.edc.lib.transform)
testImplementation(catalogLibs.fc.core)
testImplementation(catalogLibs.core.fc)
testImplementation(libs.edc.lib.jsonld)
testImplementation(libs.edc.controlplane.transform)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
import org.eclipse.edc.transform.spi.TypeTransformerRegistry;
import org.eclipse.edc.transform.transformer.edc.to.JsonValueToGenericTypeTransformer;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.time.Duration;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;

import static io.restassured.RestAssured.given;
Expand Down Expand Up @@ -73,7 +73,7 @@ public class TransferEndToEndTest {
private final JsonLd jsonLd = new TitaniumJsonLd(new ConsoleMonitor());

private static RequestSpecification baseRequest() {
RestAssured.port= 80;
RestAssured.port = 80;
return given()
.header("x-api-key", "password")
.contentType("application/json")
Expand Down Expand Up @@ -123,18 +123,20 @@ void transferData_hasPermission_shouldTransferData() {

var offerIdsFiltered = jo.stream().map(jv -> {

var expanded = jsonLd.expand(jv.asJsonObject()).orElseThrow(f -> new AssertionError(f.getFailureDetail()));
var cat = transformerRegistry.transform(expanded, Catalog.class).orElseThrow(f -> new AssertionError(f.getFailureDetail()));
return cat.getDatasets().stream().filter(ds -> ds instanceof Catalog) // filter for CatalogAssets
.map(ds -> (Catalog) ds)
.filter(sc -> sc.getDataServices().stream().anyMatch(dataService -> dataService.getEndpointUrl().contains("alice"))) // filter for assets from Alice
.flatMap(c -> c.getDatasets().stream())
.filter(dataset -> dataset.getId().equals("asset-1")) // filter for the asset we're allowed to negotiate
.map(Dataset::getOffers)
.map(offers -> offers.keySet().iterator().next())
.findFirst()
.orElse(null);
}).toList();
var expanded = jsonLd.expand(jv.asJsonObject()).orElseThrow(f -> new AssertionError(f.getFailureDetail()));
var cat = transformerRegistry.transform(expanded, Catalog.class).orElseThrow(f -> new AssertionError(f.getFailureDetail()));
return cat.getDatasets().stream().filter(ds -> ds instanceof Catalog) // filter for CatalogAssets
.map(ds -> (Catalog) ds)
.filter(sc -> sc.getDataServices().stream().anyMatch(dataService -> dataService.getEndpointUrl().contains("alice"))) // filter for assets from Alice
.flatMap(c -> c.getDatasets().stream())
.filter(dataset -> dataset.getId().equals("asset-1")) // filter for the asset we're allowed to negotiate
.map(Dataset::getOffers)
.map(offers -> offers.keySet().iterator().next())
.findFirst()
.orElse(null);
})
.filter(Objects::nonNull)
.toList();
assertThat(offerIdsFiltered).hasSize(1).doesNotContainNull();
var oid = offerIdsFiltered.get(0);
assertThat(oid).isNotNull();
Expand Down Expand Up @@ -262,18 +264,20 @@ void transferData_requestsForbiddenAsset_shouldFail() {

var offerIdsFiltered = jo.stream().map(jv -> {

var expanded = jsonLd.expand(jv.asJsonObject()).orElseThrow(f -> new AssertionError(f.getFailureDetail()));
var cat = transformerRegistry.transform(expanded, Catalog.class).orElseThrow(f -> new AssertionError(f.getFailureDetail()));
return cat.getDatasets().stream().filter(ds -> ds instanceof Catalog) // filter for CatalogAssets
.map(ds -> (Catalog) ds)
.filter(sc -> sc.getDataServices().stream().anyMatch(dataService -> dataService.getEndpointUrl().contains("alice"))) // filter for assets from Alice
.flatMap(c -> c.getDatasets().stream())
.filter(dataset -> dataset.getId().equals("asset-3")) // filter for the asset we're allowed to negotiate
.map(Dataset::getOffers)
.map(offers -> offers.keySet().iterator().next())
.findFirst()
.orElse(null);
}).toList();
var expanded = jsonLd.expand(jv.asJsonObject()).orElseThrow(f -> new AssertionError(f.getFailureDetail()));
var cat = transformerRegistry.transform(expanded, Catalog.class).orElseThrow(f -> new AssertionError(f.getFailureDetail()));
return cat.getDatasets().stream().filter(ds -> ds instanceof Catalog) // filter for CatalogAssets
.map(ds -> (Catalog) ds)
.filter(sc -> sc.getDataServices().stream().anyMatch(dataService -> dataService.getEndpointUrl().contains("alice"))) // filter for assets from Alice
.flatMap(c -> c.getDatasets().stream())
.filter(dataset -> dataset.getId().equals("asset-3")) // filter for the asset we're allowed to negotiate
.map(Dataset::getOffers)
.map(offers -> offers.keySet().iterator().next())
.findFirst()
.orElse(null);
})
.filter(Objects::nonNull)
.toList();
assertThat(offerIdsFiltered).hasSize(1).doesNotContainNull();
var oid = offerIdsFiltered.get(0);
assertThat(oid).isNotNull();
Expand Down
39 changes: 6 additions & 33 deletions mxd-runtimes/gradle/catalogserver.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,24 @@ format.version = "1.1"

[versions]
edc = "0.10.0-SNAPSHOT"
tractusx = "0.8.0-rc3"
tractusx = "0.8.0-rc4"
postgres = "42.7.3"

[libraries]
api-dsp-config = { module = "org.eclipse.edc:dsp-http-api-configuration", version.ref = "edc" }
api-management = { module = "org.eclipse.edc:management-api", version.ref = "edc" }
api-management-config = { module = "org.eclipse.edc:management-api-configuration", version.ref = "edc" }
api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" }
boot = { module = "org.eclipse.edc:boot", version.ref = "edc" }
controlplane-core = { module = "org.eclipse.edc:control-plane-core", version.ref = "edc" }
controlplane-services = { module = "org.eclipse.edc:control-plane-aggregate-services", version.ref = "edc" }
core-connector = { module = "org.eclipse.edc:connector-core", version.ref = "edc" }
core-dcp = { module = "org.eclipse.edc:identity-trust-core", version.ref = "edc" }
dsp = { module = "org.eclipse.edc:dsp", version.ref = "edc" }
dcp = { module = "org.eclipse.edc:identity-trust-service", version.ref = "edc" }
http = { module = "org.eclipse.edc:http", version.ref = "edc" }
jsonld = { module = "org.eclipse.edc:json-ld", version.ref = "edc" }
oauth2-client = { module = "org.eclipse.edc:oauth2-client", version.ref = "edc" }
sts-remote-client = { module = "org.eclipse.edc:identity-trust-sts-remote-client", version.ref = "edc" }
config-trustedissuers = { module = "org.eclipse.edc:identity-trust-issuers-configuration", version.ref = "edc" }
fc-core = {module="org.eclipse.edc:federated-catalog-core", version.ref="edc"}
core-fc = { module = "org.eclipse.edc:federated-catalog-core", version.ref = "edc" }

# SQL modules
edc-sql-assetindex = { module = "org.eclipse.edc:asset-index-sql", version.ref = "edc" }
edc-sql-edrcache = { module = "org.eclipse.edc:edr-index-sql", version.ref = "edc" }
edc-sql-contractdef = { module = "org.eclipse.edc:contract-definition-store-sql", version.ref = "edc" }
edc-sql-contractneg = { module = "org.eclipse.edc:contract-negotiation-store-sql", version.ref = "edc" }
edc-sql-policydef = { module = "org.eclipse.edc:policy-definition-store-sql", version.ref = "edc" }
edc-sql-transferprocess = { module = "org.eclipse.edc:transfer-process-store-sql", version.ref = "edc" }
edc-sql-core = { module = "org.eclipse.edc:sql-core", version.ref = "edc" }
edc-sql-lease = { module = "org.eclipse.edc:sql-lease", version.ref = "edc" }
edc-sql-pool = { module = "org.eclipse.edc:sql-pool-apache-commons", version.ref = "edc" }
edc-sql-transactionlocal = { module = "org.eclipse.edc:transaction-local", version.ref = "edc" }
# BOM modules
bom-catalog = { module = "org.eclipse.edc:federatedcatalog-dcp-bom", version.ref = "edc" }
bom-catalog-sql = { module = "org.eclipse.edc:federatedcatalog-feature-sql-bom", version.ref = "edc" }

# tx modules
tx-bdrs-client = { module = "org.eclipse.tractusx.edc:bdrs-client", version.ref = "tractusx" }
tx-dcp = { module = "org.eclipse.tractusx.edc:tx-dcp", version.ref = "tractusx" }
tx-fc = { module = "org.eclipse.tractusx.edc:federated-catalog", version.ref = "tractusx" }
tx-core-jsonld = { module = "org.eclipse.tractusx.edc:json-ld-core", version.ref = "tractusx" }

# third party modules
postgres = { module = "org.postgresql:postgresql", version.ref = "postgres" }


[bundles]
sql = ["edc-sql-assetindex", "edc-sql-contractdef", "edc-sql-contractneg", "edc-sql-policydef", "edc-sql-edrcache",
"edc-sql-transferprocess", "edc-sql-core", "edc-sql-lease", "edc-sql-pool", "edc-sql-transactionlocal", "postgres"]

[plugins]
54 changes: 9 additions & 45 deletions mxd-runtimes/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ format.version = "1.1"
awaitility = "4.2.2"
assertj = "3.25.3"
edc = "0.10.0-SNAPSHOT"
tractusx = "0.8.0-rc3"
tractusx = "0.8.0-rc4"
commons = "2.11.0"
opentelemetry = "1.32.0"
postgres = "42.7.3"
Expand Down Expand Up @@ -37,11 +37,12 @@ edc-core-jersey = { module = "org.eclipse.edc:jersey-core", version.ref = "edc"
edc-ext-jsonld = { module = "org.eclipse.edc:json-ld", version.ref = "edc" }
edc-configuration-filesystem = { module = "org.eclipse.edc:configuration-filesystem", version.ref = "edc" }
edc-http = { module = "org.eclipse.edc:http", version.ref = "edc" }
edc-spi-did = {module= "org.eclipse.edc:did-spi", version.ref="edc"}
edc-spi-catalog = {module= "org.eclipse.edc:catalog-spi", version.ref="edc"}
edc-spi-did = { module = "org.eclipse.edc:did-spi", version.ref = "edc" }
edc-spi-catalog = { module = "org.eclipse.edc:catalog-spi", version.ref = "edc" }
edc-spi-crawler = { module = "org.eclipse.edc:crawler-spi", version.ref = "edc" }
edc-spi-identitytrust = { module = "org.eclipse.edc:identity-trust-spi", version.ref = "edc" }
edc-controlplane-transform = { module = "org.eclipse.edc:control-plane-transform", version.ref = "edc" }
edc-api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" }

# EDC lib dependencies
edc-http-lib = { module = "org.eclipse.edc:http-lib", version.ref = "edc" }
Expand All @@ -51,43 +52,12 @@ edc-lib-transform = { module = "org.eclipse.edc:transform-lib", version.ref = "e
edc-lib-jsonld = { module = "org.eclipse.edc:json-ld-lib", version.ref = "edc" }

# identith-hub SPI modules
edc-ih-spi-did = { module = "org.eclipse.edc:did-spi", version.ref = "edc" }
edc-ih-spi-store = { module = "org.eclipse.edc:identity-hub-store-spi", version.ref = "edc" }
edc-ih-spi-participant = { module = "org.eclipse.edc:participant-context-spi", version.ref = "edc" }

# identity-hub sql modules
edc-api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" }
edc-sql-ih-credstore-sql = { module = "org.eclipse.edc:identity-hub-credentials-store-sql", version.ref = "edc" }
edc-sql-ih-didstore-sql = { module = "org.eclipse.edc:identity-hub-did-store-sql", version.ref = "edc" }
edc-sql-ih-keypairstore-sql = { module = "org.eclipse.edc:identity-hub-keypair-store-sql", version.ref = "edc" }
edc-sql-ih-pcstore-sql = { module = "org.eclipse.edc:identity-hub-participantcontext-store-sql", version.ref = "edc" }
edc-sql-sts-clientstore = { module = "org.eclipse.edc:sts-client-store-sql", version.ref = "edc" }

# identity-hub core modules
edc-ih-core = { module = "org.eclipse.edc:identity-hub-core", version.ref = "edc" }
edc-ih-keypairs = { module = "org.eclipse.edc:identity-hub-keypairs", version.ref = "edc" }
edc-ih-did = { module = "org.eclipse.edc:identity-hub-did", version.ref = "edc" }
edc-ih-participants = { module = "org.eclipse.edc:identity-hub-participants", version.ref = "edc" }
edc-ih-did-localpub = { module = "org.eclipse.edc:local-did-publisher", version.ref = "edc" }
edc-ih-lib-credentialquery = { module = "org.eclipse.edc:credential-query-lib", version.ref = "edc" }

# identithub api modules
edc-ih-api-presentation = { module = "org.eclipse.edc:presentation-api", version.ref = "edc" }
edc-ih-mgmt-config = { module = "org.eclipse.edc:api-configuration", version.ref = "edc" }
edc-ih-mgmt-authentication = { module = "org.eclipse.edc:identityhub-api-authentication", version.ref = "edc" }
edc-ih-mgmt-authorization = { module = "org.eclipse.edc:identityhub-api-authorization", version.ref = "edc" }
edc-ih-mgmt-participantcontext = { module = "org.eclipse.edc:participant-context-api", version.ref = "edc" }
edc-ih-mgmt-verifiablecredential = { module = "org.eclipse.edc:verifiable-credentials-api", version.ref = "edc" }
edc-ih-mgmt-did = { module = "org.eclipse.edc:did-api", version.ref = "edc" }
edc-ih-mgmt-keypairs = { module = "org.eclipse.edc:keypair-api", version.ref = "edc" }
edc-ih-spi = { module = "org.eclipse.edc:identity-hub-spi", version.ref = "edc" }

# EDC STS dependencies
edc-sts-spi = { module = "org.eclipse.edc:identity-trust-sts-spi", version.ref = "edc" }
edc-sts-core = { module = "org.eclipse.edc:identity-trust-sts-core", version.ref = "edc" }
edc-sts = { module = "org.eclipse.edc:identity-trust-sts-embedded", version.ref = "edc" }
edc-sts-api = { module = "org.eclipse.edc:identity-trust-sts-api", version.ref = "edc" }
edc-sts-accountprovisioner = { module = "org.eclipse.edc:sts-account-provisioner", version.ref = "edc" }
edc-sts-accountservice-local = { module = "org.eclipse.edc:sts-account-service-local", version.ref = "edc" }
# identity hub BOM modules
bom-ih-withsts = { module = "org.eclipse.edc:identityhub-with-sts-bom", version.ref = "edc" }
bom-ih-sql = { module = "org.eclipse.edc:identityhub-feature-sql-bom", version.ref = "edc" }
bom-ih-sql-sts = { module = "org.eclipse.edc:identityhub-feature-sql-sts-bom", version.ref = "edc" }

# Tractus-X Runtime BOMs
edc-tx-controlplane = { module = "org.eclipse.tractusx.edc:edc-controlplane-postgresql-hashicorp-vault", version.ref = "tractusx" }
Expand All @@ -105,12 +75,6 @@ restAssured = { module = "io.rest-assured:rest-assured", version.ref = "restAssu
testcontainers-postgres = { module = "org.testcontainers:postgresql", version.ref = "testcontainers" }

[bundles]
sql-ih = ["edc-sql-ih-credstore-sql", "edc-sql-ih-didstore-sql", "edc-sql-ih-keypairstore-sql", "edc-sql-ih-pcstore-sql", "edc-sql-sts-clientstore",
"edc-sql-core", "edc-sql-pool", "edc-sql-transactionlocal", "postgres"]
identityhub = ["edc-ih-core", "edc-ih-api-presentation", "edc-ih-participants", "edc-ih-keypairs"]
identity-api = ["edc-ih-mgmt-config", "edc-ih-mgmt-did", "edc-ih-mgmt-participantcontext", "edc-ih-mgmt-verifiablecredential",
"edc-ih-mgmt-keypairs", "edc-ih-mgmt-authentication", "edc-ih-mgmt-authorization"]
did = ["edc-did-web", "edc-did-core", "edc-ih-did", "edc-ih-did-localpub"]
connector = ["edc-boot", "edc-core-connector", "edc-ext-http", "edc-api-observability", "edc-ext-jsonld"]


Expand Down
33 changes: 11 additions & 22 deletions mxd-runtimes/tx-catalog-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,33 @@ configurations.all {
force("org.eclipse.edc:core-spi:0.10.0-SNAPSHOT")
// ContractDefinitionResolver is not present in the older version of EDC used by tractus-Xs
force("org.eclipse.edc:catalog-spi:0.10.0-SNAPSHOT")
// DSP Remote Message Dispatcher Registry now requires a String argument
force("org.eclipse.edc:dsp:0.10.0-SNAPSHOT")
}
}

dependencies {

runtimeOnly(libs.bundles.connector) // base runtime
// management API - is not included in the FederatedCatalog BOM
runtimeOnly(catalogLibs.api.management)
runtimeOnly(catalogLibs.api.management.config)
runtimeOnly(catalogLibs.controlplane.core) //default store impls, etc.
runtimeOnly(catalogLibs.controlplane.services) // aggregate services
runtimeOnly(catalogLibs.dsp) // protocol webhook
runtimeOnly(catalogLibs.dcp) // DCP protocol impl
runtimeOnly(catalogLibs.core.dcp) // DCP protocol impl
runtimeOnly(catalogLibs.api.dsp.config) // json-ld expansion
runtimeOnly(catalogLibs.tx.core.jsonld) // locally cached context files

runtimeOnly(libs.edc.vault.hashicorp)
runtimeOnly(catalogLibs.bundles.sql)
runtimeOnly(catalogLibs.sts.remote.client)
runtimeOnly(catalogLibs.config.trustedissuers) // to configure the trusted issuers via config

// official FC BOMs
runtimeOnly(catalogLibs.bom.catalog)
runtimeOnly(catalogLibs.bom.catalog.sql){
exclude("org.eclipse.edc", "target-node-directory-sql") //not needed, nodes are populated from a file
}

// libs from tx
runtimeOnly(catalogLibs.tx.bdrs.client) // audience mapper
runtimeOnly(catalogLibs.tx.core.jsonld) // locally cached context files
runtimeOnly(catalogLibs.tx.dcp) // the default scope mapper
runtimeOnly(catalogLibs.tx.fc) // file-based node directory

constraints {
implementation("org.eclipse.edc:boot-spi:0.10.0-SNAPSHOT") {
because("Console Monitor needs the default log level")
}
implementation("org.eclipse.edc:dsp:0.10.0-SNAPSHOT") {
because("DSP Remote Message Dispatcher Registry now requires a String argument")
}
}

runtimeOnly(libs.edc.did.core) // DidResolverRegistry, DidPublicKeyResolver
runtimeOnly(libs.edc.did.web) // for registering the WebDidResolver
runtimeOnly(catalogLibs.oauth2.client)
runtimeOnly(libs.edc.did.web) // for registering the WebDidResolverl
}

application {
Expand Down
7 changes: 3 additions & 4 deletions mxd-runtimes/tx-catalog-server/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:22.0.1_8-jre-alpine
FROM eclipse-temurin:23_37-jre-alpine
ARG JAR
ARG OTEL_JAR
ARG ADDITIONAL_FILES
Expand All @@ -24,12 +24,11 @@ COPY ${JAR} catalog-server.jar
COPY ${OTEL_JAR} opentelemetry-javaagent.jar
COPY ${ADDITIONAL_FILES} ./

# health check is handled by K8S
HEALTHCHECK NONE

CMD ["java", \
ENTRYPOINT ["java", \
"-javaagent:/app/opentelemetry-javaagent.jar", \
"-Dedc.fs.config=/app/configuration.properties", \
"-Djava.util.logging.config.file=/app/logging.properties", \
"-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \
"-Dotel.metrics.exporter=prometheus", \
"-Dotel.exporter.prometheus.port=9090", \
Expand Down
7 changes: 3 additions & 4 deletions mxd-runtimes/tx-control-plane/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:22.0.1_8-jre-alpine
FROM eclipse-temurin:23_37-jre-alpine
ARG JAR
ARG OTEL_JAR
ARG ADDITIONAL_FILES
Expand All @@ -24,12 +24,11 @@ COPY ${JAR} controlplane.jar
COPY ${OTEL_JAR} opentelemetry-javaagent.jar
COPY ${ADDITIONAL_FILES} ./

# health check is handled by K8S
HEALTHCHECK NONE

CMD ["java", \
ENTRYPOINT ["java", \
"-javaagent:/app/opentelemetry-javaagent.jar", \
"-Dedc.fs.config=/app/configuration.properties", \
"-Djava.util.logging.config.file=/app/logging.properties", \
"-Dotel.javaagent.configuration-file=/app/opentelemetry.properties", \
"-Dotel.metrics.exporter=prometheus", \
"-Dotel.exporter.prometheus.port=9090", \
Expand Down
Loading

0 comments on commit 60b0e71

Please sign in to comment.