Fixes in Docker build
Change-Id: Ib4d8dafb32de907fae5427a394cf354c9596dae2
diff --git a/rapp-manager/.classpath b/rapp-manager/.classpath
deleted file mode 100644
index 1f94f5f..0000000
--- a/rapp-manager/.classpath
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java">
- <attributes>
- <attribute name="test" value="true"/>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="src" output="target/classes" path="target/generated-sources/annotations">
- <attributes>
- <attribute name="optional" value="true"/>
- <attribute name="maven.pomderived" value="true"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/rapp-manager/.project b/rapp-manager/.project
deleted file mode 100644
index 1f1a6f8..0000000
--- a/rapp-manager/.project
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>rapp-manager</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.m2e.core.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.m2e.core.maven2Nature</nature>
- </natures>
-</projectDescription>
diff --git a/rapp-manager/.settings/org.eclipse.jdt.core.prefs b/rapp-manager/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 55e549b..0000000
--- a/rapp-manager/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,9 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
-org.eclipse.jdt.core.compiler.compliance=11
-org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=11
diff --git a/rapp-manager/Dockerfile b/rapp-manager/Dockerfile
index 786b12c..a131caf 100644
--- a/rapp-manager/Dockerfile
+++ b/rapp-manager/Dockerfile
@@ -31,5 +31,8 @@
EXPOSE 8080
ADD /config/application.yaml /opt/app/rapp-manager/config/application.yaml
ADD target/${JAR} /opt/app/rapp-manager/rapp-manager.jar
+ADD /config/keystore.jks /opt/app/rapp-manager/etc/cert/keystore.jks
+ADD /config/truststore.jks /opt/app/rapp-manager/etc/cert/truststore.jks
-CMD ["java", "-jar", "/opt/app/rapp-manager/rapp-manager.jar"]
\ No newline at end of file
+
+CMD ["java", "-jar", "/opt/app/rapp-manager/rapp-manager.jar"]
diff --git a/rapp-manager/config/application.yaml b/rapp-manager/config/application.yaml
index 8631bce..d4af7bf 100644
--- a/rapp-manager/config/application.yaml
+++ b/rapp-manager/config/application.yaml
@@ -20,17 +20,26 @@
exposure:
include: "loggers,logfile,health,info,metrics,threaddump,heapdump"
server:
+ # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework.
+ # See springboot documentation.
port : 8080
http-port: 8083
ssl:
key-store-type: JKS
key-store-password: policy_agent
- key-store: /opt/app/enrichment-coordinator-service/etc/cert/keystore.jks
+ key-store: /opt/app/rapp-manager/etc/cert/keystore.jks
key-password: policy_agent
key-alias: policy_agent
logging:
+ # Configuration of logging
level:
ROOT: INFO
+ org.springframework: ERROR
+ org.springframework.data: ERROR
+ org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+ org.oransc.rappmanager: INFO
+ file:
+ name: /var/log/rapp-manager/application.log
app:
basepath: https://kubernetes.docker.internal:6443
certpath: /opt/app/rapp-manager/cert/ca.crt
@@ -42,7 +51,7 @@
# Note that the same keystore as for the server is used.
trust-store-used: false
trust-store-password: policy_agent
- trust-store: /opt/app/enrichment-coordinator-service/etc/cert/truststore.jks
+ trust-store: /opt/app/rapp-manager/etc/cert/truststore.jks
# Configuration of usage of HTTP Proxy for the southbound accesses.
# The HTTP proxy (if configured) will only be used for accessing NearRT RIC:s
http.proxy-host:
diff --git a/rapp-manager/src/main/java/org/oransc/rappmanager/BeanFactory.java b/rapp-manager/src/main/java/org/oransc/rappmanager/BeanFactory.java
index dc16b5b..9ea0609 100644
--- a/rapp-manager/src/main/java/org/oransc/rappmanager/BeanFactory.java
+++ b/rapp-manager/src/main/java/org/oransc/rappmanager/BeanFactory.java
@@ -18,6 +18,10 @@
package org.oransc.rappmanager;
+import org.apache.catalina.connector.Connector;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
+import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartResolver;
@@ -26,6 +30,26 @@
@Configuration
public class BeanFactory {
+ @Value("${server.http-port}")
+ private int httpPort = 0;
+
+ @Bean
+ public ServletWebServerFactory servletContainer() {
+ TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
+ if (httpPort > 0) {
+ tomcat.addAdditionalTomcatConnectors(getHttpConnector(httpPort));
+ }
+ return tomcat;
+ }
+
+ private static Connector getHttpConnector(int httpPort) {
+ Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
+ connector.setScheme("http");
+ connector.setPort(httpPort);
+ connector.setSecure(false);
+ return connector;
+ }
+
@Bean(name = "multipartResolver")
public MultipartResolver multipartResolver() {
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();