Skip to content

Commit

Permalink
Merge pull request #73 from JanardhanBS-SyncByte/release-1.3.x
Browse files Browse the repository at this point in the history
[MOSIP-37358] Readme.md
  • Loading branch information
ckm007 authored Nov 12, 2024
2 parents 5941be6 + 8ae58bf commit bca796b
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 47 deletions.
25 changes: 23 additions & 2 deletions kernel-bio-converter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM mosipdev/openjdk-21-jre:latest

# label to be assigned along with Docker build [Mandatory]
ARG SOURCE
ARG COMMIT_HASH
Expand All @@ -8,50 +9,68 @@ LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

# can be passed during Docker build as build time environment for github branch to pickup configuration from.
ARG spring_config_label

# can be passed during Docker build as build time environment for spring profiles active
ARG active_profile

# can be passed during Docker build as build time environment for config server URL
ARG spring_config_url

# can be passed during Docker build as build time environment for glowroot
ARG is_glowroot

# can be passed during Docker build as build time environment for artifactory URL
ARG artifactory_url

# environment variable to pass active profile such as DEV, QA etc at docker runtime
ENV active_profile_env=${active_profile}

# environment variable to pass github branch to pickup configuration from, at docker runtime
ENV spring_config_label_env=${spring_config_label}

# environment variable to pass spring configuration url, at docker runtime
ENV spring_config_url_env=${spring_config_url}

# environment variable to pass glowroot, at docker runtime
ENV is_glowroot_env=${is_glowroot}

# environment variable to pass artifactory url, at docker runtime
ENV artifactory_url_env=${artifactory_url}

# environment variable to pass iam_adapter url, at docker runtime
ENV iam_adapter_url_env=${iam_adapter_url}

# can be passed during Docker build as build time environment for github branch to pickup configuration from.
ARG container_user=mosip

# can be passed during Docker build as build time environment for github branch to pickup configuration from.
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=1001

# can be passed during Docker build as build time environment for github branch to pickup configuration from.
ARG container_user_gid=1001

# set working directory for the user
WORKDIR /home/${container_user}
ENV work_dir=/home/${container_user}
ARG loader_path=${work_dir}/additional_jars/
ENV loader_path_env=${loader_path}
ARG logging_level_root=INFO
ENV logging_level_root_env=${logging_level_root}

# set working directory for the user
WORKDIR /home/${container_user}
ENV work_dir=/home/${container_user}
ARG loader_path=${work_dir}/additional_jars/
ENV loader_path_env=${loader_path}
ARG logging_level_root=INFO
ENV logging_level_root_env=${logging_level_root}

# install packages and create user
RUN apt-get update && \
apt-get install -y --no-install-recommends sudo && \
Expand All @@ -60,8 +79,10 @@ RUN apt-get update && \
mkdir -p /home/${container_user} ${loader_path}
ENV loader_path_env=${loader_path}
COPY ./target/kernel-bio-converter-*.jar kernel-bio-converter.jar

# change permissions of file inside working dir
RUN chown -R ${container_user}:${container_user} /home/${container_user}

# select container user for all tasks
USER ${container_user_uid}:${container_user_gid}
EXPOSE 8079
Expand All @@ -73,6 +94,6 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \
wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
java -javaagent:glowroot/glowroot.jar -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED -jar kernel-bio-converter.jar ; \
else \
wget -q --show-progress "${iam_adapter_url_env}" -O "${loader_path_env}"/kernel-auth-adapter.jar; \
java -Dloader.path="${loader_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED -jar kernel-bio-converter.jar ; \
fi
fi

14 changes: 13 additions & 1 deletion kernel-bio-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@
<jai.imageio.jpeg2000.version>1.3.0</jai.imageio.jpeg2000.version>
<github.mhshams.jnbis.version>2.0.2</github.mhshams.jnbis.version>
<jackson.dataformat.xml.version>2.14.0</jackson.dataformat.xml.version>

<vertx.version>3.9.13</vertx.version>

<!-- Mosip kernel -->
<kernel.bom.version>1.3.0-beta.1</kernel.bom.version>
<kernel.core.version>1.3.0-beta.1</kernel.core.version>
<kernel.auth.adapter.version>1.3.0-beta.1</kernel.auth.adapter.version>
<kernel.logger.logback.version>1.3.0-beta.1</kernel.logger.logback.version>
<mosip.biometrics.util.version>1.3.0-beta.1</mosip.biometrics.util.version>
<!-- Auth adapter remove -->
Expand Down Expand Up @@ -197,6 +199,16 @@
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-auth-adapter</artifactId>
<version>${kernel.auth.adapter.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>${vertx.version}</version>
</dependency>
</dependencies>

<distributionManagement>
Expand Down
1 change: 1 addition & 0 deletions kernel-bio-converter/run_local.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java -Dloader.path="lib;" --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED -jar target/kernel-bio-converter-1.3.0-SNAPSHOT.jar
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

/**
* The entry point for the Kernel Bio Converter Application.
Expand All @@ -26,6 +28,10 @@
*/
@SpringBootApplication(scanBasePackages = { "${mosip.auth.adapter.impl.basepackage}, io.mosip.kernel.bio.*" })
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class })
@ComponentScan(
basePackages = "io.mosip.kernel",
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {io.mosip.kernel.auth.defaultadapter.config.SecurityConfig.class})
)
public class KernelBioConverterApplication {
/**
* The main method which serves as the entry point for the Spring Boot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring.profiles.default=default
management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=info,health,refresh

server.port=8098
server.port=8079
server.servlet.context-path=/v1/converter-service

#disabling health check so that client does not try to load properties from sprint configuration server every
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package io.mosip.kernel.bio.converter;

import io.mosip.kernel.bio.converter.config.TestSecurityConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;

import io.mosip.kernel.bio.converter.config.TestSecurityConfig;

/**
* Main Spring Boot application class for testing purposes.
*
Expand All @@ -31,7 +34,11 @@
"${mosip.auth.adapter.impl.basepackage}, io.mosip.kernel.bio.*" }, exclude = {
DataSourceAutoConfiguration.class })
@EnableAsync
@Import(TestSecurityConfig.class)
@Import(io.mosip.kernel.bio.converter.config.TestSecurityConfig.class)
@ComponentScan(
basePackages = "io.mosip.kernel",
excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {io.mosip.kernel.auth.defaultadapter.config.SecurityConfig.class})
)
public class TestBootApplication {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* method security.
* </p>
*
* @author Janardan B S
* @author Janardhan B S
* @since 1.0.0
*/

Expand Down Expand Up @@ -119,12 +119,12 @@ public CorsConfigurationSource corsConfigurationSource() {
* @return AuthenticationManager instance
* @throws Exception if an error occurs while retrieving AuthenticationManager
*/
@Bean
public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration)
throws Exception {
return authenticationConfiguration.getAuthenticationManager();
}

/*
* @Bean public AuthenticationManager
* authenticationManager(AuthenticationConfiguration
* authenticationConfiguration) throws Exception { return
* authenticationConfiguration.getAuthenticationManager(); }
*/
/**
* Configures an in-memory user details service with predefined users and roles.
*
Expand Down
Loading

0 comments on commit bca796b

Please sign in to comment.