diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/AasDiscoveryMongoDBBackendProvider.java b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/AasDiscoveryMongoDBBackendProvider.java index 47df36dc8..dbe06c2a5 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/AasDiscoveryMongoDBBackendProvider.java +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice-backend-mongodb/src/main/java/org/eclipse/digitaltwin/basyx/aasdiscoveryservice/backend/mongodb/AasDiscoveryMongoDBBackendProvider.java @@ -30,17 +30,23 @@ import org.eclipse.digitaltwin.basyx.common.mongocore.BasyxMongoMappingContext; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.context.annotation.Bean; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity; import org.springframework.data.mongodb.repository.support.MappingMongoEntityInformation; import org.springframework.data.mongodb.repository.support.SimpleMongoRepository; import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Component; /** * MongoDB backend provider for the AAS Discovery * * @author zielstor, fried */ + +@ConditionalOnExpression("'${basyx.backend}'.equals('MongoDB')") +@Component public class AasDiscoveryMongoDBBackendProvider implements AasDiscoveryBackendProvider { private BasyxMongoMappingContext mappingContext; diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile index 2af59d73c..1c3e9648d 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile @@ -4,6 +4,8 @@ WORKDIR /application ARG JAR_FILE=target/*-exec.jar COPY ${JAR_FILE} basyxExecutable.jar COPY src/main/resources/application.properties application.properties +ARG PORT=8081 +ENV SERVER_PORT=${PORT} EXPOSE ${SERVER_PORT} HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1 ENTRYPOINT ["java","-jar","basyxExecutable.jar"] diff --git a/basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile b/basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile index 2af59d73c..1c3e9648d 100644 --- a/basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile +++ b/basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile @@ -4,6 +4,8 @@ WORKDIR /application ARG JAR_FILE=target/*-exec.jar COPY ${JAR_FILE} basyxExecutable.jar COPY src/main/resources/application.properties application.properties +ARG PORT=8081 +ENV SERVER_PORT=${PORT} EXPOSE ${SERVER_PORT} HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1 ENTRYPOINT ["java","-jar","basyxExecutable.jar"] diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mem/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mem/src/main/docker/Dockerfile index d903433a5..31915dec7 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mem/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mem/src/main/docker/Dockerfile @@ -11,6 +11,8 @@ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENV SPRING_PROFILES_ACTIVE=kafkaEvents,inMemoryStorage +ARG PORT=8080 +ENV SERVER_PORT=${PORT} ARG CONTEXT_PATH=/ ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH} EXPOSE ${SERVER_PORT} diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile index 47ae34ae9..65024b26e 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile @@ -11,6 +11,8 @@ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENV SPRING_PROFILES_ACTIVE=kafkaEvents,mongoDbStorage +ARG PORT=8080 +ENV SERVER_PORT=${PORT} ARG CONTEXT_PATH=/ ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH} EXPOSE ${SERVER_PORT} diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-log-mem/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-log-mem/src/main/docker/Dockerfile index 12ff102f0..57ae2024c 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-log-mem/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-log-mem/src/main/docker/Dockerfile @@ -11,6 +11,8 @@ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENV SPRING_PROFILES_ACTIVE=logEvents,inMemoryStorage +ARG PORT=8080 +ENV SERVER_PORT=${PORT} ARG CONTEXT_PATH=/ ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH} EXPOSE ${SERVER_PORT} diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-log-mongodb/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-log-mongodb/src/main/docker/Dockerfile index 3f541de3e..69f0bb66d 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-log-mongodb/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-log-mongodb/src/main/docker/Dockerfile @@ -11,6 +11,8 @@ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENV SPRING_PROFILES_ACTIVE=logEvents,mongoDbStorage +ARG PORT=8080 +ENV SERVER_PORT=${PORT} ARG CONTEXT_PATH=/ ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH} EXPOSE ${SERVER_PORT} diff --git a/basyx.aasrepository/basyx.aasrepository.component/Dockerfile b/basyx.aasrepository/basyx.aasrepository.component/Dockerfile index 2af59d73c..1c3e9648d 100644 --- a/basyx.aasrepository/basyx.aasrepository.component/Dockerfile +++ b/basyx.aasrepository/basyx.aasrepository.component/Dockerfile @@ -4,6 +4,8 @@ WORKDIR /application ARG JAR_FILE=target/*-exec.jar COPY ${JAR_FILE} basyxExecutable.jar COPY src/main/resources/application.properties application.properties +ARG PORT=8081 +ENV SERVER_PORT=${PORT} EXPOSE ${SERVER_PORT} HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1 ENTRYPOINT ["java","-jar","basyxExecutable.jar"] diff --git a/basyx.aasxfileserver/basyx.aasxfileserver-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasxfileserver/AASXFileServerInMemoryBackendProvider.java b/basyx.aasxfileserver/basyx.aasxfileserver-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasxfileserver/AASXFileServerInMemoryBackendProvider.java index f5cba7d95..68a050e98 100644 --- a/basyx.aasxfileserver/basyx.aasxfileserver-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasxfileserver/AASXFileServerInMemoryBackendProvider.java +++ b/basyx.aasxfileserver/basyx.aasxfileserver-backend-inmemory/src/main/java/org/eclipse/digitaltwin/basyx/aasxfileserver/AASXFileServerInMemoryBackendProvider.java @@ -27,8 +27,13 @@ import org.eclipse.digitaltwin.basyx.aasxfileserver.backend.AASXFileServerBackendProvider; import org.eclipse.digitaltwin.basyx.aasxfileserver.model.Package; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Component; + +@ConditionalOnExpression("'${basyx.backend}'.equals('InMemory')") +@Component public class AASXFileServerInMemoryBackendProvider implements AASXFileServerBackendProvider { private AASXFileServerInMemoryCrudRepository repository = new AASXFileServerInMemoryCrudRepository(); diff --git a/basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile b/basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile index 2af59d73c..1c3e9648d 100644 --- a/basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile +++ b/basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile @@ -4,6 +4,8 @@ WORKDIR /application ARG JAR_FILE=target/*-exec.jar COPY ${JAR_FILE} basyxExecutable.jar COPY src/main/resources/application.properties application.properties +ARG PORT=8081 +ENV SERVER_PORT=${PORT} EXPOSE ${SERVER_PORT} HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1 ENTRYPOINT ["java","-jar","basyxExecutable.jar"] diff --git a/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile b/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile index 15179d0ba..850188a4c 100644 --- a/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile +++ b/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile @@ -4,6 +4,8 @@ WORKDIR /application ARG JAR_FILE=target/*-exec.jar COPY ${JAR_FILE} basyxExecutable.jar COPY src/main/resources/application.properties application.properties +ARG PORT=8081 +ENV SERVER_PORT=${PORT} EXPOSE ${SERVER_PORT} HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=30s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1 ENTRYPOINT ["java","-jar","basyxExecutable.jar"] diff --git a/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mem/src/main/docker/Dockerfile b/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mem/src/main/docker/Dockerfile index d903433a5..31915dec7 100644 --- a/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mem/src/main/docker/Dockerfile +++ b/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mem/src/main/docker/Dockerfile @@ -11,6 +11,8 @@ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENV SPRING_PROFILES_ACTIVE=kafkaEvents,inMemoryStorage +ARG PORT=8080 +ENV SERVER_PORT=${PORT} ARG CONTEXT_PATH=/ ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH} EXPOSE ${SERVER_PORT} diff --git a/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile b/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile index 47ae34ae9..65024b26e 100644 --- a/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile +++ b/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile @@ -11,6 +11,8 @@ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENV SPRING_PROFILES_ACTIVE=kafkaEvents,mongoDbStorage +ARG PORT=8080 +ENV SERVER_PORT=${PORT} ARG CONTEXT_PATH=/ ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH} EXPOSE ${SERVER_PORT} diff --git a/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker/Dockerfile b/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker/Dockerfile index 12ff102f0..57ae2024c 100644 --- a/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker/Dockerfile +++ b/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker/Dockerfile @@ -11,6 +11,8 @@ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENV SPRING_PROFILES_ACTIVE=logEvents,inMemoryStorage +ARG PORT=8080 +ENV SERVER_PORT=${PORT} ARG CONTEXT_PATH=/ ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH} EXPOSE ${SERVER_PORT} diff --git a/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker/Dockerfile b/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker/Dockerfile index 3f541de3e..69f0bb66d 100644 --- a/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker/Dockerfile +++ b/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker/Dockerfile @@ -11,6 +11,8 @@ RUN true COPY --from=builder spring-boot-loader/ ./ COPY --from=builder application/ ./ ENV SPRING_PROFILES_ACTIVE=logEvents,mongoDbStorage +ARG PORT=8080 +ENV SERVER_PORT=${PORT} ARG CONTEXT_PATH=/ ENV SERVER_SERVLET_CONTEXT_PATH=${CONTEXT_PATH} EXPOSE ${SERVER_PORT} diff --git a/basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile b/basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile index 2af59d73c..1c3e9648d 100644 --- a/basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile +++ b/basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile @@ -4,6 +4,8 @@ WORKDIR /application ARG JAR_FILE=target/*-exec.jar COPY ${JAR_FILE} basyxExecutable.jar COPY src/main/resources/application.properties application.properties +ARG PORT=8081 +ENV SERVER_PORT=${PORT} EXPOSE ${SERVER_PORT} HEALTHCHECK --interval=30s --timeout=3s --retries=3 --start-period=15s CMD curl --fail http://localhost:${SERVER_PORT}/actuator/health || exit 1 ENTRYPOINT ["java","-jar","basyxExecutable.jar"] diff --git a/ci/.env b/ci/.env index 5e316bdf3..de25045b8 100644 --- a/ci/.env +++ b/ci/.env @@ -1,3 +1,3 @@ -BASYX_VERSION=2.0.0-SNAPSHOT +BASYX_VERSION=2.0.0-milestone-02 AAS_WEBUI_VERSION=v2-240125 -KEYCLOAK_VERSION=24.0.4 \ No newline at end of file +KEYCLOAK_VERSION=24.0.4 diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index 7912aeb0a..ff216c98d 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -81,7 +81,6 @@ services: - "8050:8080" environment: SERVER_SERVLET_CONTEXT_PATH: / - SERVER_PORT: 8080 restart: always networks: - basyx-java-server-sdk @@ -91,7 +90,6 @@ services: container_name: sm-registry-log-mem environment: SERVER_SERVLET_CONTEXT_PATH: / - SERVER_PORT: 8080 ports: - "8060:8080" restart: always @@ -105,7 +103,6 @@ services: - "8051:8080" environment: SERVER_SERVLET_CONTEXT_PATH: / - SERVER_PORT: 8080 BASYX_CORS_ALLOWED_ORIGINS: '*' BASYX_CORS_ALLOWED_METHODS: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD BASYX_FEATURE_AUTHORIZATION_ENABLED: true @@ -124,7 +121,6 @@ services: container_name: secured-sm-registry-log-mem environment: SERVER_SERVLET_CONTEXT_PATH: / - SERVER_PORT: 8080 BASYX_CORS_ALLOWED_ORIGINS: '*' BASYX_CORS_ALLOWED_METHODS: GET,POST,PATCH,DELETE,PUT,OPTIONS,HEAD BASYX_FEATURE_AUTHORIZATION_ENABLED: true diff --git a/examples/BaSyxMinimal/docker-compose.yml b/examples/BaSyxMinimal/docker-compose.yml index 22e46c6cb..ed3b998c8 100644 --- a/examples/BaSyxMinimal/docker-compose.yml +++ b/examples/BaSyxMinimal/docker-compose.yml @@ -34,8 +34,6 @@ services: aas-env: image: eclipsebasyx/aas-environment:2.0.0-SNAPSHOT - environment: - - SERVER_PORT=8081 volumes: - ./aas-env.properties:/application/application.properties - ./aas:/application/aas @@ -55,8 +53,6 @@ services: image: eclipsebasyx/aas-registry-log-mongodb:2.0.0-SNAPSHOT ports: - 8082:8080 - environment: - - SERVER_PORT=8080 volumes: - ./aas-registry.yml:/workspace/config/application.yml depends_on: @@ -67,8 +63,6 @@ services: image: eclipsebasyx/submodel-registry-log-mongodb:2.0.0-SNAPSHOT ports: - 8083:8080 - environment: - - SERVER_PORT=8080 volumes: - ./sm-registry.yml:/workspace/config/application.yml depends_on: @@ -79,8 +73,6 @@ services: image: eclipsebasyx/aas-discovery:2.0.0-SNAPSHOT ports: - 8084:8081 - environment: - - SERVER_PORT=8081 volumes: - ./aas-discovery.properties:/application/application.properties depends_on: diff --git a/examples/BaSyxNGINX/docker-compose.yml b/examples/BaSyxNGINX/docker-compose.yml index 256ac09aa..e37379cfd 100644 --- a/examples/BaSyxNGINX/docker-compose.yml +++ b/examples/BaSyxNGINX/docker-compose.yml @@ -26,8 +26,6 @@ services: aas-env: image: eclipsebasyx/aas-environment:2.0.0-SNAPSHOT container_name: aas-env - environment: - SERVER_PORT: 8081 volumes: - ./basyx/aas-env.properties:/application/application.properties - ./aas:/application/aas @@ -72,8 +70,6 @@ services: container_name: aas-discovery ports: - 8084:8081 - environment: - SERVER_PORT: 8081 volumes: - ./basyx/aas-discovery.properties:/application/application.properties restart: always diff --git a/examples/BaSyxOperationDelegation/docker-compose.yml b/examples/BaSyxOperationDelegation/docker-compose.yml index 1955ab840..61212e17d 100644 --- a/examples/BaSyxOperationDelegation/docker-compose.yml +++ b/examples/BaSyxOperationDelegation/docker-compose.yml @@ -3,8 +3,6 @@ services: aas-env: image: eclipsebasyx/aas-environment:2.0.0-milestone-02 container_name: aas-env - environment: - - SERVER_PORT=8081 volumes: - ./aas:/application/aas - ./basyx/aas-env.properties:/application/application.properties @@ -21,8 +19,6 @@ services: container_name: aas-registry ports: - '8082:8080' - environment: - - SERVER_PORT=8080 volumes: - ./basyx/aas-registry.yml:/workspace/config/application.yml restart: always @@ -31,8 +27,6 @@ services: container_name: sm-registry ports: - '8083:8080' - environment: - - SERVER_PORT=8080 volumes: - ./basyx/sm-registry.yml:/workspace/config/application.yml restart: always