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

Refactor(Pool): remove opensearch component from Pool #601

Merged
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
47 changes: 0 additions & 47 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
maven/mavencentral/ch.qos.logback/logback-classic/1.4.11, EPL-1.0 OR LGPL-2.1-only, approved, #3435
maven/mavencentral/ch.qos.logback/logback-core/1.4.11, EPL-1.0 OR LGPL-2.1-only, approved, #3373
maven/mavencentral/com.carrotsearch/hppc/0.8.1, Apache-2.0, approved, CQ22339
maven/mavencentral/com.fasterxml.jackson.core/jackson-annotations/2.15.3, Apache-2.0, approved, #7947
maven/mavencentral/com.fasterxml.jackson.core/jackson-core/2.15.3, MIT AND Apache-2.0, approved, #7932
maven/mavencentral/com.fasterxml.jackson.core/jackson-databind/2.15.3, Apache-2.0, approved, #7934
maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/2.15.3, Apache-2.0, approved, #10053
maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-smile/2.15.3, Apache-2.0, approved, #10052
maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-toml/2.15.3, Apache-2.0, approved, #9160
maven/mavencentral/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.15.3, Apache-2.0, approved, #8802
maven/mavencentral/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.15.3, Apache-2.0, approved, #8808
maven/mavencentral/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.15.3, Apache-2.0, approved, #7930
maven/mavencentral/com.fasterxml.jackson.module/jackson-module-kotlin/2.15.3, Apache-2.0, approved, #10051
maven/mavencentral/com.fasterxml.jackson.module/jackson-module-parameter-names/2.15.3, Apache-2.0, approved, #8803
maven/mavencentral/com.fasterxml/classmate/1.5.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.github.spullara.mustache.java/compiler/0.9.10, Apache-2.0, approved, CQ14417
maven/mavencentral/com.github.stephenc.jcip/jcip-annotations/1.0-1, Apache-2.0, approved, CQ21949
maven/mavencentral/com.google.code.findbugs/jsr305/3.0.2, Apache-2.0, approved, #20
maven/mavencentral/com.neovisionaries/nv-i18n/1.29, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.nimbusds/content-type/2.2, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.nimbusds/lang-tag/1.7, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.nimbusds/nimbus-jose-jwt/9.24.4, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.nimbusds/oauth2-oidc-sdk/9.43.3, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.tdunning/t-digest/3.2, Apache-2.0, approved, clearlydefined
maven/mavencentral/com.zaxxer/HikariCP/5.0.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/commons-codec/commons-codec/1.15, Apache-2.0 AND BSD-3-Clause AND LicenseRef-Public-Domain, approved, CQ22641
maven/mavencentral/commons-logging/commons-logging/1.2, Apache-2.0, approved, CQ10162
maven/mavencentral/io.github.classgraph/classgraph/4.8.149, MIT, approved, CQ22530
maven/mavencentral/io.github.microutils/kotlin-logging-jvm/2.1.23, Apache-2.0, approved, clearlydefined
maven/mavencentral/io.micrometer/micrometer-commons/1.11.5, Apache-2.0 AND (Apache-2.0 AND MIT), approved, #9243
Expand Down Expand Up @@ -55,53 +47,28 @@ maven/mavencentral/io.swagger.core.v3/swagger-core-jakarta/2.2.7, Apache-2.0, ap
maven/mavencentral/io.swagger.core.v3/swagger-models-jakarta/2.2.7, Apache-2.0, approved, #5919
maven/mavencentral/jakarta.activation/jakarta.activation-api/2.1.2, EPL-2.0 OR BSD-3-Clause OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.jaf
maven/mavencentral/jakarta.annotation/jakarta.annotation-api/2.1.1, EPL-2.0 OR GPL-2.0-only with Classpath-exception-2.0, approved, ee4j.ca
maven/mavencentral/jakarta.json/jakarta.json-api/2.1.2, EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0, approved, #7907
maven/mavencentral/jakarta.persistence/jakarta.persistence-api/3.1.0, EPL-2.0 OR BSD-3-Clause AND (EPL-2.0 OR BSD-3-Clause AND BSD-3-Clause), approved, #7696
maven/mavencentral/jakarta.transaction/jakarta.transaction-api/2.0.1, EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0, approved, #7697
maven/mavencentral/jakarta.validation/jakarta.validation-api/3.0.2, Apache-2.0, approved, ee4j.validation
maven/mavencentral/jakarta.xml.bind/jakarta.xml.bind-api/4.0.1, BSD-3-Clause, approved, ee4j.jaxb
maven/mavencentral/joda-time/joda-time/2.10.12, Apache-2.0, approved, clearlydefined
maven/mavencentral/net.java.dev.jna/jna/5.5.0, Apache-2.0 or LGPL-2.1, approved, #1508
maven/mavencentral/net.minidev/accessors-smart/2.4.11, Apache-2.0, approved, #7515
maven/mavencentral/net.minidev/json-smart/2.4.11, Apache-2.0, approved, #3288
maven/mavencentral/net.sf.jopt-simple/jopt-simple/5.0.4, MIT, approved, CQ13174
maven/mavencentral/org.antlr/antlr4-runtime/4.10.1, BSD-3-Clause AND LicenseRef-Public-domain AND MIT AND LicenseRef-Unicode-TOU, approved, #7065
maven/mavencentral/org.apache.commons/commons-csv/1.10.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.commons/commons-lang3/3.12.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.commons/commons-text/1.10.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.httpcomponents/httpasyncclient/4.1.5, Apache-2.0, approved, CQ13506
maven/mavencentral/org.apache.httpcomponents/httpclient/4.5.13, Apache-2.0 AND LicenseRef-Public-Domain, approved, CQ23527
maven/mavencentral/org.apache.httpcomponents/httpcore-nio/4.4.16, Apache-2.0, approved, CQ13509
maven/mavencentral/org.apache.httpcomponents/httpcore/4.4.16, Apache-2.0, approved, CQ23528
maven/mavencentral/org.apache.logging.log4j/log4j-api/2.20.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.logging.log4j/log4j-jul/2.20.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.apache.logging.log4j/log4j-to-slf4j/2.20.0, Apache-2.0, approved, #8799
maven/mavencentral/org.apache.lucene/lucene-analysis-common/9.4.2, Apache-2.0 AND BSD-3-Clause, approved, #5636
maven/mavencentral/org.apache.lucene/lucene-backward-codecs/9.4.2, Apache-2.0, approved, #4394
maven/mavencentral/org.apache.lucene/lucene-core/9.4.2, Apache-2.0 AND BSD-3-Clause AND NCSA AND ISC AND LicenseRef-scancode-sunpro AND ICU AND LicenseRef-scancode-unicode-mappings AND MIT AND BSD-2-Clause, approved, #5635
maven/mavencentral/org.apache.lucene/lucene-grouping/9.4.2, Apache-2.0, approved, #7005
maven/mavencentral/org.apache.lucene/lucene-highlighter/9.4.2, Apache-2.0, approved, #6968
maven/mavencentral/org.apache.lucene/lucene-join/9.4.2, Apache-2.0, approved, #6985
maven/mavencentral/org.apache.lucene/lucene-memory/9.4.2, Apache-2.0, approved, #7007
maven/mavencentral/org.apache.lucene/lucene-misc/9.4.2, Apache-2.0, approved, #6992
maven/mavencentral/org.apache.lucene/lucene-queries/9.4.2, Apache-2.0, approved, #4386
maven/mavencentral/org.apache.lucene/lucene-queryparser/9.4.2, Apache-2.0, approved, #4373
maven/mavencentral/org.apache.lucene/lucene-sandbox/9.4.2, Apache-2.0, approved, #4369
maven/mavencentral/org.apache.lucene/lucene-spatial-extras/9.4.2, Apache-2.0, approved, #6991
maven/mavencentral/org.apache.lucene/lucene-spatial3d/9.4.2, Apache-2.0, approved, #6975
maven/mavencentral/org.apache.lucene/lucene-suggest/9.4.2, Apache-2.0, approved, #6970
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-core/10.1.15, Apache-2.0 AND (EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND (CDDL-1.0 OR GPL-2.0-only WITH Classpath-exception-2.0) AND W3C AND CC0-1.0, approved, #5949
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-el/10.1.15, Apache-2.0, approved, #6997
maven/mavencentral/org.apache.tomcat.embed/tomcat-embed-websocket/10.1.15, Apache-2.0, approved, #7920
maven/mavencentral/org.aspectj/aspectjweaver/1.9.20, EPL-1.0, approved, tools.aspectj
maven/mavencentral/org.eclipse.parsson/parsson/1.0.0, EPL-2.0, approved, ee4j.parsson
maven/mavencentral/org.eclipse.tractusx/bpdm-common/4.1.0-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/bpdm-gate-api/4.1.0-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/bpdm-orchestrator-api/4.1.0-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/bpdm-orchestrator/4.1.0-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.eclipse.tractusx/bpdm-pool-api/4.1.0-SNAPSHOT, Apache-2.0, approved, automotive.tractusx
maven/mavencentral/org.flywaydb/flyway-core/9.16.3, Apache-2.0, approved, #7935
maven/mavencentral/org.hdrhistogram/HdrHistogram/2.1.12, BSD-2-Clause OR LicenseRef-Public-Domain, approved, CQ13192
maven/mavencentral/org.hibernate.orm/hibernate-core/6.2.13.Final, LGPL-2.1-only AND Apache-2.0 AND MIT AND CC-PDDC AND (EPL-2.0 OR BSD-3-Clause), approved, #9121
maven/mavencentral/org.hibernate.validator/hibernate-validator/8.0.1.Final, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jboss.logging/jboss-logging/3.5.3.Final, Apache-2.0, approved, #9471
Expand All @@ -111,20 +78,6 @@ maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.7.21, Apache-2.0, a
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.7.21, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains.kotlin/kotlin-stdlib/1.7.21, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.jetbrains/annotations/13.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.opensearch.client/opensearch-java/2.0.0, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.opensearch.client/opensearch-rest-client/2.5.0, Apache-2.0, approved, #6995
maven/mavencentral/org.opensearch.client/opensearch-rest-high-level-client/2.5.0, Apache-2.0, approved, #6984
maven/mavencentral/org.opensearch.plugin/aggs-matrix-stats-client/2.5.0, Apache-2.0, approved, #6988
maven/mavencentral/org.opensearch.plugin/lang-mustache-client/2.5.0, Apache-2.0, approved, #6978
maven/mavencentral/org.opensearch.plugin/mapper-extras-client/2.5.0, Apache-2.0, approved, #7000
maven/mavencentral/org.opensearch.plugin/parent-join-client/2.5.0, Apache-2.0, approved, #6969
maven/mavencentral/org.opensearch.plugin/rank-eval-client/2.5.0, Apache-2.0, approved, #6993
maven/mavencentral/org.opensearch/opensearch-cli/2.5.0, Apache-2.0, approved, #7002
maven/mavencentral/org.opensearch/opensearch-core/2.5.0, Apache-2.0, approved, #6998
maven/mavencentral/org.opensearch/opensearch-geo/2.5.0, Apache-2.0, approved, #6994
maven/mavencentral/org.opensearch/opensearch-secure-sm/2.5.0, Apache-2.0, approved, #6990
maven/mavencentral/org.opensearch/opensearch-x-content/2.5.0, Apache-2.0, approved, #6980
maven/mavencentral/org.opensearch/opensearch/2.5.0, Apache-2.0, approved, #6996
maven/mavencentral/org.ow2.asm/asm/9.3, BSD-3-Clause, approved, clearlydefined
maven/mavencentral/org.reactivestreams/reactive-streams/1.0.4, CC0-1.0, approved, CQ16332
maven/mavencentral/org.slf4j/jul-to-slf4j/2.0.9, MIT, approved, #7698
Expand Down
8 changes: 4 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Then depending on which module you want to start go to the module subfolder you
* Docker and Docker Compose
* Keycloak 17.0.0 (with enabled `auth` profile)

When running, the project requires a PostgreSQL database and an OpenSearch instance to be available to connect to. You can set up these dependencies manually, or you can use the provided `docker-compose` file which will start the necessary dependencies for you.
When running, the project requires a PostgreSQL database instance to be available to connect to. You can set up these dependencies manually, or you can use the
provided `docker-compose` file which will start the necessary dependencies for you.

To use Docker Compose, navigate to the project directory and run the following command:

Expand All @@ -29,7 +30,6 @@ docker-compose up
```

Per default configuration the application expects postgres to run on `localhost` on port `5432`.
Opensearch needs to run on `localhost` on port `9200` on default.

You can find and edit the default configuration for the Pool in the `application.properties`, `application-auth.properties`
files in the `resources` folder.
Expand All @@ -40,7 +40,7 @@ The REST API documentation can be accessed at <http://localhost:8080/ui/swagger-

The default configuration of the application is determined by the `application.properties` file.
Here you can find core application configuration such as Swagger documentation, BPN generation and Actuator.
Furthermore, here you can find the configuration for the connection to the Spring datasource (currently, developed against PostgreSQL) and Opensearch.
Furthermore, here you can find the configuration for the connection to the Spring datasource (currently, developed against PostgreSQL).

You can also run the project with Spring profiles to enable additional components on top of the default configuration.
Currently, the BPDM Pool offers the profile `auth`.
Expand All @@ -54,7 +54,7 @@ The following sections detail the configuration properties for each profile.

`application-auth.properties` enables authorization of endpoints and configures the connection to a Keycloak instance on which the authorization relies on.
The application expects the Keycloak to run on `localhost` on port `8180`.
However, as with the Spring datasource and Opensearch connections, the connection to the Keycloak can be freely configured.
However, as with the Spring datasource connection, the connection to the Keycloak can be freely configured.
The application uses the configured auth server URL to validate incoming tokens.

For authorization purposes the application checks incoming token's permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package com.catenax.bpdm.bridge.dummy

import com.catenax.bpdm.bridge.dummy.util.BpdmGateContextInitializer
import com.catenax.bpdm.bridge.dummy.util.BpdmPoolContextInitializer
import com.catenax.bpdm.bridge.dummy.util.OpenSearchContextInitializer
import com.catenax.bpdm.bridge.dummy.util.PostgreSQLContextInitializer
import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest
Expand All @@ -30,7 +29,7 @@ import org.springframework.test.context.ContextConfiguration

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
@ContextConfiguration(initializers = [PostgreSQLContextInitializer::class, OpenSearchContextInitializer::class, BpdmPoolContextInitializer::class, BpdmGateContextInitializer::class])
@ContextConfiguration(initializers = [PostgreSQLContextInitializer::class, BpdmPoolContextInitializer::class, BpdmGateContextInitializer::class])
class ApplicationTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import com.catenax.bpdm.bridge.dummy.client.BridgeClient
import com.catenax.bpdm.bridge.dummy.testdata.CommonValues
import com.catenax.bpdm.bridge.dummy.testdata.GateRequestValues
import com.catenax.bpdm.bridge.dummy.testdata.GateRequestValues.addressGateInputRequest1
import com.catenax.bpdm.bridge.dummy.util.*
import com.catenax.bpdm.bridge.dummy.util.BpdmGateContextInitializer
import com.catenax.bpdm.bridge.dummy.util.BpdmPoolContextInitializer
import com.catenax.bpdm.bridge.dummy.util.PostgreSQLContextInitializer
import com.catenax.bpdm.bridge.dummy.util.TestHelpers
import org.assertj.core.api.Assertions.assertThat
import org.eclipse.tractusx.bpdm.common.dto.request.AddressPartnerBpnSearchRequest
import org.eclipse.tractusx.bpdm.common.dto.request.PaginationRequest
Expand Down Expand Up @@ -52,7 +55,7 @@ private val DEFAULT_PAGINATION_REQUEST = PaginationRequest(0, 100)

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
@ContextConfiguration(initializers = [PostgreSQLContextInitializer::class, OpenSearchContextInitializer::class, BpdmPoolContextInitializer::class, BpdmGateContextInitializer::class])
@ContextConfiguration(initializers = [PostgreSQLContextInitializer::class, BpdmPoolContextInitializer::class, BpdmGateContextInitializer::class])
class BridgeSyncIT @Autowired constructor(
val bridgeClient: BridgeClient,
val gateClient: GateClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package com.catenax.bpdm.bridge.dummy.util


import com.catenax.bpdm.bridge.dummy.util.BpdmPoolContextInitializer.Companion.bpdmPoolContainer
import com.catenax.bpdm.bridge.dummy.util.OpenSearchContextInitializer.Companion.openSearchContainer
import com.catenax.bpdm.bridge.dummy.util.PostgreSQLContextInitializer.Companion.postgreSQLContainer
import mu.KotlinLogging
import org.springframework.boot.test.util.TestPropertyValues
Expand Down Expand Up @@ -49,7 +48,7 @@ class BpdmGateContextInitializer : ApplicationContextInitializer<ConfigurableApp

private val bpdmGateContainer: GenericContainer<*> =
GenericContainer(IMAGE)
.dependsOn(listOf<Startable>(postgreSQLContainer, openSearchContainer, bpdmPoolContainer))
.dependsOn(listOf<Startable>(postgreSQLContainer, bpdmPoolContainer))
.withNetwork(postgreSQLContainer.getNetwork())
.withExposedPorts(BPDM_PORT, DEBUG_PORT)
.withEnv(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
package com.catenax.bpdm.bridge.dummy.util


import com.catenax.bpdm.bridge.dummy.util.OpenSearchContextInitializer.Companion.openSearchContainer
import com.catenax.bpdm.bridge.dummy.util.PostgreSQLContextInitializer.Companion.postgreSQLContainer
import mu.KotlinLogging
import org.springframework.boot.test.util.TestPropertyValues
Expand Down Expand Up @@ -48,8 +47,8 @@ class BpdmPoolContextInitializer : ApplicationContextInitializer<ConfigurableApp

val bpdmPoolContainer: GenericContainer<*> =
GenericContainer(IMAGE)
.dependsOn(listOf<Startable>(postgreSQLContainer, openSearchContainer))
.withNetwork(postgreSQLContainer.getNetwork())
.dependsOn(listOf<Startable>(postgreSQLContainer))
.withNetwork(postgreSQLContainer.network)
.withExposedPorts(BPDM_PORT, DEBUG_PORT)
.withEnv(
"JAVA_OPTIONS",
Expand All @@ -60,7 +59,6 @@ class BpdmPoolContextInitializer : ApplicationContextInitializer<ConfigurableApp

override fun initialize(applicationContext: ConfigurableApplicationContext) {
val postgresNetworkAlias = applicationContext.environment.getProperty("bpdm.datasource.alias")
val openSearchNetworkAlias = applicationContext.environment.getProperty("bpdm.opensearch.alias")
val dataBase = postgreSQLContainer.getDatabaseName()
val bpdmAlias = applicationContext.environment.getProperty("bpdm.pool.alias")
bpdmPoolContainer.withNetworkAliases(bpdmAlias)
Expand All @@ -74,12 +72,6 @@ class BpdmPoolContextInitializer : ApplicationContextInitializer<ConfigurableApp
bpdmPoolContainer.withEnv(
"spring.datasource.url", "jdbc:postgresql://${postgresNetworkAlias}:5432/${dataBase}?loggerLevel=OFF"
)
.withEnv("bpdm.opensearch.host", openSearchNetworkAlias)
.withEnv(
"pdm.opensearch.port",
OpenSearchContextInitializer.OPENSEARCH_PORT.toString()
)
.withEnv("bpdm.opensearch.scheme", "http")
.withEnv(
"spring.datasource.username", postgreSQLContainer.username
)
Expand Down
Loading