diff --git a/bpdm-cleaning-service-dummy/pom.xml b/bpdm-cleaning-service-dummy/pom.xml index d74e7b02b..b2ea5deb1 100644 --- a/bpdm-cleaning-service-dummy/pom.xml +++ b/bpdm-cleaning-service-dummy/pom.xml @@ -43,6 +43,10 @@ ${project.groupId} bpdm-pool-api + + ${project.groupId} + bpdm-orchestrator + org.jetbrains.kotlin diff --git a/bpdm-orchestrator/Dockerfile b/bpdm-orchestrator/Dockerfile new file mode 100644 index 000000000..569186472 --- /dev/null +++ b/bpdm-orchestrator/Dockerfile @@ -0,0 +1,17 @@ +FROM maven:3.8.7-eclipse-temurin-17 AS build +COPY . /home/app +WORKDIR /home/app +RUN mvn -B -U clean package -pl bpdm-orchestrator -am -DskipTests + +FROM eclipse-temurin:17-jre-alpine +COPY --from=build /home/app/bpdm-orchestrator/target/bpdm-orchestrator.jar /usr/local/lib/bpdm/app.jar +RUN apk update && apk upgrade libssl3 libcrypto3 +ARG USERNAME=bpdm +ARG USERID=10001 +ARG GID=3000 +RUN addgroup -g $GID -S $USERNAME +RUN adduser -u $USERID -S $USERNAME $USERNAME +USER $USERNAME +WORKDIR /usr/local/lib/bpdm +EXPOSE 8080 +ENTRYPOINT ["java","-jar","app.jar"] diff --git a/bpdm-orchestrator/pom.xml b/bpdm-orchestrator/pom.xml new file mode 100644 index 000000000..08ce20501 --- /dev/null +++ b/bpdm-orchestrator/pom.xml @@ -0,0 +1,170 @@ + + + + + 4.0.0 + + bpdm-orchestrator + Business Partner Data Management Orchestrator + Orchestrator component acts as a passive component and offers for each processing steps individual endpoints + jar + + + org.eclipse.tractusx + bpdm-parent + 4.0.2-SNAPSHOT + + + + + ${project.groupId} + bpdm-common + + + + org.jetbrains.kotlin + kotlin-stdlib + + + org.jetbrains.kotlin + kotlin-reflect + + + + org.springframework.boot + spring-boot-starter-web + + + org.springdoc + springdoc-openapi-starter-common + + + org.springdoc + springdoc-openapi-starter-webmvc-ui + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-oauth2-resource-server + + + io.github.microutils + kotlin-logging-jvm + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-webflux + + + + org.springframework.boot + spring-boot-starter-oauth2-client + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.springframework.boot + spring-boot-starter-validation + + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.mockito + mockito-core + + + + + + org.assertj + assertj-core + test + + + + + + bpdm-orchestrator + + + + true + ${project.basedir}/src/main/resources + + *.properties + + + + false + ${project.basedir}/src/main/resources + + *.properties + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.jetbrains.kotlin + kotlin-maven-plugin + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + + github + GitHub CatenaX-NG Apache Maven Packages + https://maven.pkg.github.com/catenax-ng/tx-bpdm + + + + + \ No newline at end of file diff --git a/bpdm-orchestrator/src/main/kotlin/com/catenax/bpdm/orchestrator/Application.kt b/bpdm-orchestrator/src/main/kotlin/com/catenax/bpdm/orchestrator/Application.kt new file mode 100644 index 000000000..2e767dbaf --- /dev/null +++ b/bpdm-orchestrator/src/main/kotlin/com/catenax/bpdm/orchestrator/Application.kt @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2021,2023 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 com.catenax.bpdm.orchestrator + +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration +import org.springframework.boot.context.properties.ConfigurationPropertiesScan +import org.springframework.boot.runApplication + +@SpringBootApplication(exclude=[DataSourceAutoConfiguration::class]) +@ConfigurationPropertiesScan +class Application + +fun main(args: Array) { + runApplication(*args) +} diff --git a/bpdm-orchestrator/src/main/resources/application.properties b/bpdm-orchestrator/src/main/resources/application.properties new file mode 100644 index 000000000..02ceaf64b --- /dev/null +++ b/bpdm-orchestrator/src/main/resources/application.properties @@ -0,0 +1,42 @@ +################################################################################ +# Copyright (c) 2021,2023 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 +################################################################################ +bpdm.name=@project.name@ +bpdm.description=@project.description@ +bpdm.version=@project.version@ +## +# Change default port +server.port=8085 +## +# Logging Configuration +bpdm.logging.unknown-user=Anonymous + +## +#Springdoc swagger configuration +springdoc.api-docs.enabled=true +springdoc.api-docs.path=/docs/api-docs +springdoc.swagger-ui.disable-swagger-default-url=true +springdoc.swagger-ui.path=/ui/swagger-ui +springdoc.swagger-ui.show-common-extensions=true +springdoc.swagger-ui.csrf.enabled=true +## +#Enable actuator endpoints +management.endpoint.health.probes.enabled=true +management.health.livenessState.enabled=true +management.health.readinessState.enabled=true + diff --git a/bpdm-orchestrator/src/test/kotlin/com/catenax/bpdm/orchestrator/ApplicationTests.kt b/bpdm-orchestrator/src/test/kotlin/com/catenax/bpdm/orchestrator/ApplicationTests.kt new file mode 100644 index 000000000..5ce7ee2dc --- /dev/null +++ b/bpdm-orchestrator/src/test/kotlin/com/catenax/bpdm/orchestrator/ApplicationTests.kt @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2021,2023 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 com.catenax.bpdm.orchestrator + +import org.junit.jupiter.api.Test +import org.springframework.boot.test.context.SpringBootTest +import org.springframework.test.context.ActiveProfiles + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@ActiveProfiles("test") +class ApplicationTests { + + @Test + fun contextLoads() { + + } + +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4d2f050e1..073ba2c72 100644 --- a/pom.xml +++ b/pom.xml @@ -42,8 +42,9 @@ bpdm-pool bpdm-gate-api bpdm-gate - bpdm-bridge-dummy bpdm-cleaning-service-dummy + bpdm-orchestrator + bpdm-bridge-dummy @@ -82,22 +83,27 @@ ${project.groupId} - bpdm-cleaning-service-dummy + bpdm-common ${project.version} ${project.groupId} - bpdm-common + bpdm-pool-api ${project.version} ${project.groupId} - bpdm-pool-api + bpdm-gate-api ${project.version} ${project.groupId} - bpdm-gate-api + bpdm-cleaning-service-dummy + ${project.version} + + + ${project.groupId} + bpdm-orchestrator ${project.version}