Skip to content

Commit

Permalink
Feat: Backport Add Persistence for dataplaneselector.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmg13 authored and rafaelmag110 committed Aug 21, 2024
1 parent 28d85af commit 33e6360
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,16 @@ spec:
- name: "EDC_DATASOURCE_EDR_URL"
value: {{ tpl .Values.postgresql.jdbcUrl . | quote }}

# see extension https://github.com/eclipse-edc/Connector/tree/main/extensions/data-plane-selector/store/sql/data-plane-instance-store-sql
- name: "EDC_DATASOURCE_DATAPLANEINSTANCE_NAME"
value: "dataplaneinstance"
- name: "EDC_DATASOURCE_DATAPLANEINSTANCE_USER"
value: { { .Values.postgresql.auth.username | required ".Values.postgresql.auth.username is required" | quote } }
- name: "EDC_DATASOURCE_DATAPLANEINSTANCE_PASSWORD"
value: { { .Values.postgresql.auth.password | required ".Values.postgresql.auth.password is required" | quote } }
- name: "EDC_DATASOURCE_DATAPLANEINSTANCE_URL"
value: { { tpl .Values.postgresql.jdbcUrl . | quote } }

#############################
## IATP / STS / DIM CONFIG ##
#############################
Expand Down
10 changes: 10 additions & 0 deletions charts/tractusx-connector/templates/deployment-controlplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ spec:
- name: "EDC_DATASOURCE_EDR_URL"
value: {{ tpl .Values.postgresql.jdbcUrl . | quote }}

# see extension https://github.com/eclipse-edc/Connector/tree/main/extensions/data-plane-selector/store/sql/data-plane-instance-store-sql
- name: "EDC_DATASOURCE_DATAPLANEINSTANCE_NAME"
value: "dataplaneinstance"
- name: "EDC_DATASOURCE_DATAPLANEINSTANCE_USER"
value: { { .Values.postgresql.auth.username | required ".Values.postgresql.auth.username is required" | quote } }
- name: "EDC_DATASOURCE_DATAPLANEINSTANCE_PASSWORD"
value: { { .Values.postgresql.auth.password | required ".Values.postgresql.auth.password is required" | quote } }
- name: "EDC_DATASOURCE_DATAPLANEINSTANCE_URL"
value: { { tpl .Values.postgresql.jdbcUrl . | quote } }

#############################
## IATP / STS / DIM CONFIG ##
#############################
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/********************************************************************************
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* 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.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

package org.eclipse.tractusx.edc.postgresql.migration;

public class DataPlaneInstancePostgresqlMigrationExtension extends AbstractPostgresqlMigrationExtension {
private static final String NAME_SUBSYSTEM = "dataplaneinstance";

protected String getSubsystemName() {
return NAME_SUBSYSTEM;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ org.eclipse.tractusx.edc.postgresql.migration.ContractDefinitionPostgresqlMigrat
org.eclipse.tractusx.edc.postgresql.migration.ContractNegotiationPostgresqlMigrationExtension
org.eclipse.tractusx.edc.postgresql.migration.PolicyPostgresqlMigrationExtension
org.eclipse.tractusx.edc.postgresql.migration.PolicyMonitorPostgresqlMigrationExtension
org.eclipse.tractusx.edc.postgresql.migration.DataPlaneInstancePostgresqlMigrationExtension
org.eclipse.tractusx.edc.postgresql.migration.TransferProcessPostgresqlMigrationExtension
org.eclipse.tractusx.edc.postgresql.migration.BusinessGroupPostgresMigrationExtension
org.eclipse.tractusx.edc.postgresql.migration.EdrIndexPostgresqlMigrationExtension
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
--
-- Copyright (c) 2024 Contributors to the Eclipse Foundation
--
-- 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:
-- Contributors to the Eclipse Foundation - initial API and implementation
--


CREATE TABLE IF NOT EXISTS edc_lease
(
leased_by VARCHAR NOT NULL,
leased_at BIGINT,
lease_duration INTEGER NOT NULL,
lease_id VARCHAR NOT NULL
CONSTRAINT lease_pk
PRIMARY KEY
);


CREATE TABLE IF NOT EXISTS edc_data_plane_instance
(
id VARCHAR NOT NULL PRIMARY KEY,
data JSON,
lease_id VARCHAR
CONSTRAINT data_plane_instance_lease_id_fk
REFERENCES edc_lease
ON DELETE SET NULL
);
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class PgRuntimeExtension extends ParticipantRuntimeExtension {
private static final String PASSWORD = "password";
private static final List<String> DATASOURCES = List.of("asset", "contractdefinition",
"contractnegotiation", "policy", "transferprocess", "bpn",
"policy-monitor", "edr", "dataplane", "accesstokendata");
"policy-monitor", "edr", "dataplane", "accesstokendata", "dataplaneinstance");
private final PostgreSQLContainer<?> postgreSqlContainer;
private final String dbName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies {
testImplementation(libs.edc.config.filesystem)
testImplementation(libs.edc.dpf.http)
testImplementation(libs.edc.auth.tokenbased)
testImplementation(libs.edc.dpf.selector.spi)
testImplementation(libs.edc.spi.dataplane.selector)
testImplementation(libs.testcontainers.junit)
testImplementation(libs.edc.aws.s3.core)
testImplementation(libs.aws.s3)
Expand Down
3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ edc-sql-policy-monitor = { module = "org.eclipse.edc:policy-monitor-store-sql",
edc-sql-edrindex = { module = "org.eclipse.edc:edr-index-sql", 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-data-plane-instance-store-sql = { module = "org.eclipse.edc:data-plane-instance-store-sql", version.ref = "edc" }

# azure stuff
edc-azure-vault = { module = "org.eclipse.edc.azure:vault-azure", version.ref = "edc" }
Expand Down Expand Up @@ -225,6 +226,6 @@ titaniumJsonLd = { module = "com.apicatalog:titanium-json-ld", version.ref = "ti
[bundles]
edc-connector = ["edc.boot", "edc.core-connector", "edc.core-controlplane", "edc.api-observability"]
edc-dpf = ["edc.dpf-transfer-signaling", "edc.dpf-selector-core", "edc.spi-dataplane-selector"]
edc-sqlstores = ["edc.sql-assetindex", "edc.sql-contract-definition", "edc.sql-contract-negotiation", "edc.sql-transferprocess", "edc.sql-policydef", "edc.sql-policy-monitor", "edc.sql-edrindex"]
edc-sqlstores = ["edc.sql-assetindex", "edc.sql-contract-definition", "edc.sql-contract-negotiation", "edc.sql-transferprocess", "edc.sql-policydef", "edc.sql-policy-monitor", "edc.sql-edrindex", "edc.data-plane-instance-store-sql"]
edc-monitoring = ["edc.micrometer-core", "edc.micrometer-jersey", "edc.micrometer-jetty"]
edc-sts = ["edc-identity-trust-sts-core", "edc-identity-trust-sts-api", "edc-identity-trust-sts-client-configuration"]

0 comments on commit 33e6360

Please sign in to comment.