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

tests: enrich compatibility test framework #36

Closed
wants to merge 5 commits into from
Closed
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
122 changes: 122 additions & 0 deletions gradle/libs.0.10.0.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
[metadata]
format.version = "1.1"

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

# add here

[libraries]
edc-runtime-metamodel = { module = "org.eclipse.edc:runtime-metamodel", version.ref = "edc" }
# SPI modules
edc-spi-core = { module = "org.eclipse.edc:core-spi", version.ref = "edc" }
edc-spi-identity-trust = { module = "org.eclipse.edc:identity-trust-spi", version.ref = "edc" }
edc-spi-jwt = { module = "org.eclipse.edc:jwt-spi", version.ref = "edc" }
edc-boot-spi = { module = "org.eclipse.edc:boot-spi", version.ref = "edc" }


# Common dependencies
edc-boot = { module = "org.eclipse.edc:boot", version.ref = "edc" }
edc-core-connector = { module = "org.eclipse.edc:connector-core", version.ref = "edc" }
edc-auth-tokenbased = { module = "org.eclipse.edc:auth-tokenbased", version.ref = "edc" }
edc-auth-configuration = { module = "org.eclipse.edc:auth-configuration", version.ref = "edc" }
edc-did-web = { module = "org.eclipse.edc:identity-did-web", version.ref = "edc" }
edc-identity-core-did = { module = "org.eclipse.edc:identity-did-core", version.ref = "edc" }
edc-identity-vc-ldp = { module = "org.eclipse.edc:ldp-verifiable-credentials", version.ref = "edc" }
edc-identity-vc-jwt = { module = "org.eclipse.edc:jwt-verifiable-credentials", version.ref = "edc" }
edc-vault-hashicorp = { module = "org.eclipse.edc:vault-hashicorp", version.ref = "edc" }
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-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" }
edc-dsp = { module = "org.eclipse.edc:dsp", version.ref = "edc" }
edc-api-management-dataplaneselector = { module = "org.eclipse.edc:data-plane-selector-api", version.ref = "edc" }
edc-http = { module = "org.eclipse.edc:http", version.ref = "edc" }
edc-controlplane-callback-dispatcher-event = { module = "org.eclipse.edc:callback-event-dispatcher", version.ref = "edc" }
edc-controlplane-callback-dispatcher-http = { module = "org.eclipse.edc:callback-http-dispatcher", version.ref = "edc" }
edc-iam-mock = { module = "org.eclipse.edc:iam-mock", version.ref = "edc" }
edc-identity-trust-transform = { module = "org.eclipse.edc:identity-trust-transform", version.ref = "edc" }
edc-api-control-configuration = { module = "org.eclipse.edc:control-api-configuration", version.ref = "edc" }
edc-core-edrstore = { module = "org.eclipse.edc:edr-store-core", version.ref = "edc" }
edc-edr-storereceiver = { module = "org.eclipse.edc:edr-store-receiver", version.ref = "edc" }
edc-policy-monitor-core = { module = "org.eclipse.edc:policy-monitor-core", version.ref = "edc" }

# Dataplane Framework dependencies
edc-dpf-transfer-signaling = { module = "org.eclipse.edc:transfer-data-plane-signaling", version.ref = "edc" }
edc-spi-dataplane-selector = { module = "org.eclipse.edc:data-plane-selector-spi", version.ref = "edc" }
edc-dpf-selector-control-api = { module = "org.eclipse.edc:data-plane-selector-control-api", version.ref = "edc" }
edc-dpf-signaling-client = { module = "org.eclipse.edc:data-plane-signaling-client", version.ref = "edc" }
edc-dpf-selector-core = { module = "org.eclipse.edc:data-plane-selector-core", version.ref = "edc" }
edc-dpf-selector-client = { module = "org.eclipse.edc:data-plane-selector-client", version.ref = "edc" }

# Data Plane specific dependencies
edc-dataplane-core = { module = "org.eclipse.edc:data-plane-core", version.ref = "edc" }
edc-dataplane-api-control-config = { module = "org.eclipse.edc:control-api-configuration", version.ref = "edc" }
edc-dataplane-api-control-client = { module = "org.eclipse.edc:control-plane-api-client", version.ref = "edc" }
edc-dataplane-selfregistration = { module = "org.eclipse.edc:data-plane-self-registration", version.ref = "edc" }
edc-dataplane-http = { module = "org.eclipse.edc:data-plane-http", version.ref = "edc" }
edc-dataplane-http-oauth2 = { module = "org.eclipse.edc:data-plane-http-oauth2", version.ref = "edc" }
edc-dataplane-api-public = { module = "org.eclipse.edc:data-plane-public-api-v2", version.ref = "edc" }
edc-dataplane-api-signaling = { module = "org.eclipse.edc:data-plane-signaling-api", version.ref = "edc" }
edc-dataplane-iam = { module = "org.eclipse.edc:data-plane-iam", version.ref = "edc" }

# API modules
edc-api-version = { module = "org.eclipse.edc:version-api", version.ref = "edc" }
edc-api-management = { module = "org.eclipse.edc:management-api", version.ref = "edc" }
edc-api-management-test-fixtures = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" }
edc-api-management-config = { module = "org.eclipse.edc:management-api-configuration", version.ref = "edc" }
edc-api-management-edr = { module = "org.eclipse.edc:edr-cache-api", version.ref = "edc" }
edc-api-observability = { module = "org.eclipse.edc:api-observability", version.ref = "edc" }

# Lib dependencies
edc-lib-transform = { module = "org.eclipse.edc:transform-lib", version.ref = "edc" }
edc-lib-jws2020 = { module = "org.eclipse.edc:jws2020-lib", version.ref = "edc" }

# SQL Dependencies
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-policymonitor = { module = "org.eclipse.edc:policy-monitor-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" }
edc-sql-accesstokendata = { module = "org.eclipse.edc:accesstokendata-store-sql", version.ref = "edc" }
edc-sql-dataplane = { module = "org.eclipse.edc:data-plane-store-sql", version.ref = "edc" }
edc-sql-dataplane-instancestore = { module = "org.eclipse.edc:data-plane-instance-store-sql", version.ref = "edc" }

# Third-part dependencies
postgres = { module = "org.postgresql:postgresql", version.ref = "postgres" }

# add some

[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-configuration-filesystem", "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", "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-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",
"edc-sql-pool", "edc-sql-transactionlocal", "postgres"]
sql-dataplane = ["edc-sql-accesstokendata", "edc-sql-dataplane", "edc-sql-core", "edc-sql-lease", "edc-sql-pool", "edc-sql-transactionlocal", "edc-sql-dataplane-instancestore", "postgres"]


[plugins]
docker = { id = "com.bmuschko.docker-remote-api", version = "9.4.0" }
64 changes: 64 additions & 0 deletions runtimes/010/controlplane-010/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
*
*/

import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
import com.github.jengelman.gradle.plugins.shadow.ShadowJavaPlugin

plugins {
id("application")
alias(libs.plugins.shadow)
alias(libs.plugins.docker)
}

dependencies {
runtimeOnly(libs010.edc.spi.core) // we need some constants

runtimeOnly(libs010.bundles.controlplane)
runtimeOnly(libs010.edc.core.connector)

runtimeOnly(libs010.bundles.dpf)
runtimeOnly(libs010.edc.api.version)
// uncomment the following lines to compile with Hashicorp Vault and Postgres persistence
// runtimeOnly(libs010.edc.vault.hashicorp)
runtimeOnly(libs010.bundles.sql.controlplane)

}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
exclude("**/pom.properties", "**/pom.xml")
mergeServiceFiles()
archiveFileName.set("${project.name}.jar")
}

application {
mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime")
}

edcBuild {
publish.set(false)
}

// configure the "dockerize" task
tasks.register("dockerize", DockerBuildImage::class) {
val dockerContextDir = project.projectDir
dockerFile.set(file("$dockerContextDir/src/main/docker/Dockerfile"))
images.add("${project.name}:${libs010.versions.edc.get()}")
images.add("${project.name}:latest")
// specify platform with the -Dplatform flag:
if (System.getProperty("platform") != null)
platform.set(System.getProperty("platform"))
buildArgs.put("JAR", "build/libs/${project.name}.jar")
inputDir.set(file(dockerContextDir))
dependsOn(tasks.named(ShadowJavaPlugin.SHADOW_JAR_TASK_NAME))
}
18 changes: 18 additions & 0 deletions runtimes/010/controlplane-010/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -buster is required to have apt available
FROM eclipse-temurin:23.0.1_11-jre-alpine

# Optional JVM arguments, such as memory settings
ARG JVM_ARGS=""
ARG JAR

RUN apk --no-cache add curl

WORKDIR /app

COPY ${JAR} edc-controlplane.jar

# Use "exec" for graceful termination (SIGINT) to reach JVM.
# ARG can not be used in ENTRYPOINT so storing value in an ENV variable
ENV ENV_JVM_ARGS=$JVM_ARGS
# use the "exec" syntax so that SIGINT reaches the JVM -> graceful termination
CMD ["sh", "-c", "exec java -Djava.security.egd=file:/dev/urandom -jar edc-controlplane.jar"]
67 changes: 67 additions & 0 deletions runtimes/010/dataplane-010/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
*
*/

import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
import com.github.jengelman.gradle.plugins.shadow.ShadowJavaPlugin

plugins {
id("application")
alias(libs.plugins.shadow)
alias(libs.plugins.docker)
}

dependencies {
implementation(libs010.edc.runtime.metamodel)
implementation(libs010.edc.boot.spi)
runtimeOnly(libs010.edc.spi.core)
runtimeOnly(libs010.edc.api.observability)
runtimeOnly(libs010.edc.core.connector)
runtimeOnly(libs010.edc.boot)
runtimeOnly(libs010.bundles.dataplane)
runtimeOnly(libs010.edc.jsonld) // needed by the DataPlaneSignalingApi
runtimeOnly(libs010.edc.dpf.selector.client) // for the selector service -> self registration

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

}

tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
exclude("**/pom.properties", "**/pom.xml")
mergeServiceFiles()
archiveFileName.set("${project.name}.jar")
}

application {
mainClass.set("org.eclipse.edc.boot.system.runtime.BaseRuntime")
}

edcBuild {
publish.set(false)
}

// configure the "dockerize" task
tasks.register("dockerize", DockerBuildImage::class) {
val dockerContextDir = project.projectDir
dockerFile.set(file("$dockerContextDir/src/main/docker/Dockerfile"))
images.add("${project.name}:${libs010.versions.edc.get()}")
images.add("${project.name}:latest")
// specify platform with the -Dplatform flag:
if (System.getProperty("platform") != null)
platform.set(System.getProperty("platform"))
buildArgs.put("JAR", "build/libs/${project.name}.jar")
inputDir.set(file(dockerContextDir))
dependsOn(tasks.named(ShadowJavaPlugin.SHADOW_JAR_TASK_NAME))
}
18 changes: 18 additions & 0 deletions runtimes/010/dataplane-010/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -buster is required to have apt available
FROM eclipse-temurin:23.0.1_11-jre-alpine

# Optional JVM arguments, such as memory settings
ARG JVM_ARGS=""
ARG JAR

RUN apk --no-cache add curl

WORKDIR /app

COPY ${JAR} edc-dataplane.jar

# Use "exec" for graceful termination (SIGINT) to reach JVM.
# ARG can not be used in ENTRYPOINT so storing value in an ENV variable
ENV ENV_JVM_ARGS=$JVM_ARGS
# use the "exec" syntax so that SIGINT reaches the JVM -> graceful termination
CMD ["sh", "-c", "exec java -Djava.security.egd=file:/dev/urandom -jar edc-dataplane.jar"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
*
*/

package org.eclipse.edc.compatibility.tests;

import org.eclipse.edc.runtime.metamodel.annotation.Inject;
import org.eclipse.edc.spi.security.Vault;
import org.eclipse.edc.spi.system.ServiceExtension;
import org.eclipse.edc.spi.system.ServiceExtensionContext;

import java.util.Map;

public class VaultSeedExtension implements ServiceExtension {


public static final String VAULT_TESTING_PREFIX = "testing.edc.vaults";

public static final String VAULT_TESTING_KEY = "key";
public static final String VAULT_TESTING_VALUE = "value";

@Inject
private Vault vault;

@Override
public void initialize(ServiceExtensionContext context) {
ServiceExtension.super.initialize(context);

var config = context.getConfig(VAULT_TESTING_PREFIX);
var secrets = config.partition().map((partition) -> {
var key = partition.getString(VAULT_TESTING_KEY);
var value = partition.getString(VAULT_TESTING_VALUE);
return Map.entry(key, value);
}).toList();

secrets.forEach(secret -> vault.storeSecret(secret.getKey(), secret.getValue()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
#
# Contributors:
# Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
#
#

org.eclipse.edc.compatibility.tests.VaultSeedExtension
5 changes: 5 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ dependencyResolutionManagement {
create("stableLibs") {
from(files("./gradle/libs.stable.versions.toml"))
}
create("libs010") {
from(files("./gradle/libs.0.10.0.versions.toml"))
}
}
}

Expand All @@ -46,4 +49,6 @@ include(":runtimes:snapshot:controlplane-snapshot")
include(":runtimes:snapshot:dataplane-snapshot")
include(":runtimes:stable:controlplane-stable")
include(":runtimes:stable:dataplane-stable")
include(":runtimes:010:controlplane-010")
include(":runtimes:010:dataplane-010")
include(":tests:compatibility-tests")
Loading