From 805b36b6be03302bdf71ce45a8a6df2734cf4c46 Mon Sep 17 00:00:00 2001 From: Sowmya Ujjappa Banakar <43202851+sowmya695@users.noreply.github.com> Date: Tue, 28 May 2024 10:52:22 +0530 Subject: [PATCH 1/3] Mosip 32461 (#1873) * MOSIP-32461 intial changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 few test cases fixed Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code fix Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code fix Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code fix Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code fix Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code fix Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 docker changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 docker changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 docker changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 docker changes Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 activemq exclude from spring boot Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 activemq exclude from spring boot Signed-off-by: Sowmya Ujjappa Banakar * MOSIP-32461 code changes Signed-off-by: Sowmya Ujjappa Banakar --------- Signed-off-by: Sowmya Ujjappa Banakar Co-authored-by: Sowmya Ujjappa Banakar --- .../status/api/RegistrationStatusApiApplication.java | 4 +++- .../RegistrationTransactionServiceApplication.java | 4 +++- .../RegistrationProcessorLandingZoneApplication.java | 5 +++-- .../src/main/resources/bootstrap.properties | 2 +- .../notification/NotificationApplication.java | 6 +++++- .../src/main/resources/bootstrap.properties | 2 +- .../workflowmanager/WorkflowManagerApplication.java | 11 ++++++++--- .../src/main/resources/bootstrap.properties | 1 + 8 files changed, 25 insertions(+), 10 deletions(-) diff --git a/registration-processor/init/registration-processor-registration-status-service/src/main/java/io/mosip/registration/processor/status/api/RegistrationStatusApiApplication.java b/registration-processor/init/registration-processor-registration-status-service/src/main/java/io/mosip/registration/processor/status/api/RegistrationStatusApiApplication.java index 64807c34ac8..95dacdefb62 100644 --- a/registration-processor/init/registration-processor-registration-status-service/src/main/java/io/mosip/registration/processor/status/api/RegistrationStatusApiApplication.java +++ b/registration-processor/init/registration-processor-registration-status-service/src/main/java/io/mosip/registration/processor/status/api/RegistrationStatusApiApplication.java @@ -2,6 +2,8 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; +import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.FilterType; @@ -24,7 +26,7 @@ * @author Pranav Kumar * */ -@SpringBootApplication +@SpringBootApplication(exclude = { JmsAutoConfiguration.class, ActiveMQAutoConfiguration.class }) @ComponentScan(basePackages = { "io.mosip.registration.processor.status.*", "io.mosip.registration.processor.rest.client.*", "io.mosip.registration.processor.core.token.*", "io.mosip.registration.processor.core.config", diff --git a/registration-processor/post-processor/registration-processor-registration-transaction-service/src/main/java/io/mosip/registration/processor/transaction/api/RegistrationTransactionServiceApplication.java b/registration-processor/post-processor/registration-processor-registration-transaction-service/src/main/java/io/mosip/registration/processor/transaction/api/RegistrationTransactionServiceApplication.java index 7973aa3da77..d7d7b61323f 100644 --- a/registration-processor/post-processor/registration-processor-registration-transaction-service/src/main/java/io/mosip/registration/processor/transaction/api/RegistrationTransactionServiceApplication.java +++ b/registration-processor/post-processor/registration-processor-registration-transaction-service/src/main/java/io/mosip/registration/processor/transaction/api/RegistrationTransactionServiceApplication.java @@ -2,6 +2,8 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; +import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.FilterType; @@ -11,7 +13,7 @@ import io.mosip.registration.processor.rest.client.config.RestConfigBean; import io.mosip.registration.processor.status.config.RegistrationStatusBeanConfig; -@SpringBootApplication +@SpringBootApplication(exclude = { JmsAutoConfiguration.class, ActiveMQAutoConfiguration.class }) @ComponentScan(basePackages= {"io.mosip.registration.processor.status.*","io.mosip.registration.processor.rest.client.*", "io.mosip.registration.processor.core.token.*", "io.mosip.registration.processor.core.config", "io.mosip.registration.processor.transaction.*", "${mosip.auth.adapter.impl.basepackage}", diff --git a/registration-processor/registration-processor-landing-zone/src/main/java/io/mosip/registration/processor/RegistrationProcessorLandingZoneApplication.java b/registration-processor/registration-processor-landing-zone/src/main/java/io/mosip/registration/processor/RegistrationProcessorLandingZoneApplication.java index 96703c73784..83d0b344b34 100644 --- a/registration-processor/registration-processor-landing-zone/src/main/java/io/mosip/registration/processor/RegistrationProcessorLandingZoneApplication.java +++ b/registration-processor/registration-processor-landing-zone/src/main/java/io/mosip/registration/processor/RegistrationProcessorLandingZoneApplication.java @@ -2,15 +2,16 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; +import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; import org.springframework.context.annotation.ComponentScan.Filter; -import io.mosip.kernel.dataaccess.hibernate.config.HibernateDaoConfig; import io.mosip.registration.processor.core.config.configserverloader.PropertyLoaderConfig; import io.mosip.registration.processor.rest.client.config.RestConfigBean; -@SpringBootApplication +@SpringBootApplication(exclude = { JmsAutoConfiguration.class, ActiveMQAutoConfiguration.class }) @ComponentScan( basePackages = { "io.mosip.registration.processor.status.*", "io.mosip.registration.processor.rest.client.*", "io.mosip.registration.processor.util", "io.mosip.registration.processor.core.config", diff --git a/registration-processor/registration-processor-landing-zone/src/main/resources/bootstrap.properties b/registration-processor/registration-processor-landing-zone/src/main/resources/bootstrap.properties index 34dba93bbd2..de9a72ea6d5 100644 --- a/registration-processor/registration-processor-landing-zone/src/main/resources/bootstrap.properties +++ b/registration-processor/registration-processor-landing-zone/src/main/resources/bootstrap.properties @@ -12,7 +12,7 @@ health.config.enabled=false server.port=8098 server.servlet.path=/registrationprocessor/v1/landingzone - +spring.mvc.servlet.path=${server.servlet.path} #management.endpoint.health.show-details=always #management.endpoints.web.exposure.include=info,health,refresh \ No newline at end of file diff --git a/registration-processor/registration-processor-notification-service/src/main/java/io/mosip/registration/processor/notification/NotificationApplication.java b/registration-processor/registration-processor-notification-service/src/main/java/io/mosip/registration/processor/notification/NotificationApplication.java index 16256ac0496..f3078dffedb 100644 --- a/registration-processor/registration-processor-notification-service/src/main/java/io/mosip/registration/processor/notification/NotificationApplication.java +++ b/registration-processor/registration-processor-notification-service/src/main/java/io/mosip/registration/processor/notification/NotificationApplication.java @@ -1,13 +1,17 @@ package io.mosip.registration.processor.notification; import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; +import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.FilterType; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.scheduling.annotation.EnableScheduling; import io.mosip.registration.processor.core.config.configserverloader.PropertyLoaderConfig; + import io.mosip.registration.processor.rest.client.config.RestConfigBean; /** * Init class for Notification service. @@ -16,7 +20,7 @@ * @since 1.0.0 * */ -@SpringBootApplication +@SpringBootApplication(exclude = { JmsAutoConfiguration.class, ActiveMQAutoConfiguration.class }) @ComponentScan( basePackages = { "io.mosip.registration.processor.notification.*", "io.mosip.kernel.websub.api.*","${mosip.auth.adapter.impl.basepackage}", "io.mosip.registration.processor.message.sender.config", "io.mosip.registration.processor.rest.client.*", "io.mosip.registration.processor.packet.storage.config", diff --git a/registration-processor/registration-processor-notification-service/src/main/resources/bootstrap.properties b/registration-processor/registration-processor-notification-service/src/main/resources/bootstrap.properties index 949e3ab8dd1..4a7040b8b31 100644 --- a/registration-processor/registration-processor-notification-service/src/main/resources/bootstrap.properties +++ b/registration-processor/registration-processor-notification-service/src/main/resources/bootstrap.properties @@ -11,4 +11,4 @@ server.port=8088 health.config.enabled=false management.endpoints.web.exposure.include=refresh server.servlet.path=/registrationprocessor/v1/notification - +spring.mvc.servlet.path=${server.servlet.path} \ No newline at end of file diff --git a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/src/main/java/io/mosip/registration/processor/workflowmanager/WorkflowManagerApplication.java b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/src/main/java/io/mosip/registration/processor/workflowmanager/WorkflowManagerApplication.java index 46bc948d061..1bc8326057d 100644 --- a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/src/main/java/io/mosip/registration/processor/workflowmanager/WorkflowManagerApplication.java +++ b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/src/main/java/io/mosip/registration/processor/workflowmanager/WorkflowManagerApplication.java @@ -1,8 +1,11 @@ package io.mosip.registration.processor.workflowmanager; import org.springframework.boot.SpringApplication; +import org.springframework.boot.actuate.jms.JmsHealthIndicator; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration; +import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -16,7 +19,7 @@ import io.mosip.registration.processor.workflowmanager.verticle.WorkflowInternalActionVerticle; @Configuration -@EnableAutoConfiguration +@EnableAutoConfiguration(exclude = { JmsAutoConfiguration.class, ActiveMQAutoConfiguration.class }) @SpringBootApplication @ComponentScan(basePackages = { "io.mosip.registration.processor.core.config", "${mosip.auth.adapter.impl.basepackage}", @@ -24,8 +27,10 @@ "io.mosip.registration.processor.status.config", "io.mosip.registration.processor.core.kernel.beans", "io.mosip.registration.processor.packet.storage.config", - "io.mosip.kernel.websub.api.config.publisher" }, excludeFilters = @Filter(type = FilterType.ASSIGNABLE_TYPE, value = { - HibernateDaoConfig.class, PropertyLoaderConfig.class })) + "io.mosip.kernel.websub.api.config.publisher", + "io.mosip.registration.processor.packet.storage.utils.ActiveMqConnectionUtility" }, excludeFilters = @Filter(type = FilterType.ASSIGNABLE_TYPE, value = { + HibernateDaoConfig.class, PropertyLoaderConfig.class +})) public class WorkflowManagerApplication { public static void main(String[] args) { diff --git a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/src/main/resources/bootstrap.properties b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/src/main/resources/bootstrap.properties index f3296070a8c..f8519d90d7a 100644 --- a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/src/main/resources/bootstrap.properties +++ b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/src/main/resources/bootstrap.properties @@ -13,6 +13,7 @@ health.config.enabled=false eventbus.port=5754 server.port=8026 server.servlet.path=/registrationprocessor/v1/workflowmanager +spring.mvc.servlet.path=${server.servlet.path} mosip.regproc.workflow-manager.internal.action.server.port=8024 mosip.regproc.workflow-manager.internal.action.eventbus.port=5751 mosip.regproc.workflow-manager.workflowaction.server.port=8023 From dea95a1c35dad1bbef5bab8bde4ac9d7d090b5b0 Mon Sep 17 00:00:00 2001 From: syed salman <72004356+syedsalman3753@users.noreply.github.com> Date: Tue, 28 May 2024 15:14:44 +0530 Subject: [PATCH 2/3] [MOSIP-32461] updated group5 Dockerfile (#1874) * [MOSIP-32461] updated group5 Dockerfile Signed-off-by: syed salman * [MOSIP-32461] updated group5 Dockerfile Signed-off-by: syed salman --------- Signed-off-by: syed salman --- .../Dockerfile | 46 ++++++++----------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile index 1fee3caa7a3..b3a7deac695 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile @@ -1,4 +1,4 @@ -FROM eclipse-temurin:21-jre-alpine +FROM mosipdev/openjdk-21-jre:latest ARG SOURCE ARG COMMIT_HASH @@ -9,9 +9,6 @@ LABEL commit_hash=${COMMIT_HASH} LABEL commit_id=${COMMIT_ID} LABEL build_time=${BUILD_TIME} -#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image -#FROM openjdk:8-jdk-alpine - # can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG spring_config_label @@ -49,7 +46,7 @@ ARG container_user=mosip ARG container_user_group=mosip # can be passed during Docker build as build time environment for github branch to pickup configuration from. -ARG container_user_uid=1002 +ARG container_user_uid=1001 # can be passed during Docker build as build time environment for github branch to pickup configuration from. ARG container_user_gid=1001 @@ -64,41 +61,36 @@ ENV biosdk_local_dir_name=${biosdk_local_dir} #ENV bio_sdk_folder_env=${bio_sdk_folder} ENV biosdk_zip_file_path=${biosdk_zip_path} -# install packages and create user -RUN apk -q update \ -&& apk add -q unzip sudo \ -&& addgroup -g ${container_user_gid} ${container_user_group} \ -&& adduser -s /bin/sh -u ${container_user_uid} -G ${container_user_group} -h /home/${container_user} --disabled-password ${container_user} \ -&& addgroup sudo \ -&& adduser ${container_user} sudo \ -&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers +ARG stage_group_name=registration-processor-stage-group-5 -# set working directory for the user -WORKDIR /home/${container_user} +ENV group_name=${stage_group_name} ENV work_dir=/home/${container_user} ARG loader_path=${work_dir}/additional_jars/ -RUN mkdir -p ${loader_path} - ENV loader_path_env=${loader_path} -# change volume to whichever storage directory you want to use for this container. -# /home/logs - -ARG stage_group_name=registration-processor-stage-group-5 - -ENV group_name=${stage_group_name} - ADD ./target/${group_name}-*.jar ${group_name}.jar ADD configure_start.sh configure_start.sh -RUN chmod +x configure_start.sh +# install packages and create user +RUN apt-get -y update \ +&& apt-get install -y unzip sudo \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/bash -m ${container_user} \ +&& adduser ${container_user} sudo \ +&& echo "%sudo ALL=(ALL) NOPASSWD:/home/${container_user}/${biosdk_local_dir}/install.sh" >> /etc/sudoers \ +&& mkdir -p ${loader_path} \ +&& chmod +x configure_start.sh \ +&& chown -R ${container_user}:${container_user} ${work_dir} + +# change volume to whichever storage directory you want to use for this container. +# /home/logs -# change permissions of file inside working dir -RUN chown -R ${container_user}:${container_user} /home/${container_user} +# set working directory for the user +WORKDIR ${work_dir} # select container user for all tasks USER ${container_user_uid}:${container_user_gid} From cf2b0a39bce39626b73a7663607e05e2d9b05529 Mon Sep 17 00:00:00 2001 From: syed salman <72004356+syedsalman3753@users.noreply.github.com> Date: Tue, 28 May 2024 17:09:26 +0530 Subject: [PATCH 3/3] [MOSIP-32461] Fix dockerfile issues (#1875) Signed-off-by: syed salman <72004356+syedsalman3753@users.noreply.github.com> --- .../registration-processor-stage-group-5/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile b/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile index b3a7deac695..d8e575613e4 100644 --- a/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile +++ b/registration-processor/stage-groups/registration-processor-stage-group-5/Dockerfile @@ -71,6 +71,9 @@ ARG loader_path=${work_dir}/additional_jars/ ENV loader_path_env=${loader_path} +# set working directory for the user +WORKDIR ${work_dir} + ADD ./target/${group_name}-*.jar ${group_name}.jar ADD configure_start.sh configure_start.sh @@ -89,9 +92,6 @@ RUN apt-get -y update \ # change volume to whichever storage directory you want to use for this container. # /home/logs -# set working directory for the user -WORKDIR ${work_dir} - # select container user for all tasks USER ${container_user_uid}:${container_user_gid}