mirror of
https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
synced 2025-11-02 19:47:52 +00:00
TW-144: Create Docker container for Opensync-gateway process
This task deals with creating the docker container for Opensync-gateway process
This commit is contained in:
@@ -1,19 +1,21 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.telecominfraproject.wlan</groupId>
|
<groupId>com.telecominfraproject.wlan</groupId>
|
||||||
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
<artifactId>tip-wlan-cloud-root-pom</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
<relativePath>../../tip-wlan-cloud-root</relativePath>
|
<relativePath>../../tip-wlan-cloud-root</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>opensync-gateway-static-process</artifactId>
|
<artifactId>opensync-gateway-static-process</artifactId>
|
||||||
<name>opensync-gateway-static-process</name>
|
<name>opensync-gateway-static-process</name>
|
||||||
<description>Process definition for opensync gateway that uses static configuration</description>
|
<description>Process definition for opensync gateway that uses static configuration</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<start-class>com.telecominfraproject.wlan.opensync.experiment.OpenSyncProcess</start-class>
|
<start-class>com.telecominfraproject.wlan.opensync.experiment.OpenSyncProcess</start-class>
|
||||||
|
<docker.fabric.version>0.28.0</docker.fabric.version>
|
||||||
|
<docker.push.registry>ec2-54-80-163-0.compute-1.amazonaws.com:5000</docker.push.registry>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.telecominfraproject.wlan</groupId>
|
<groupId>com.telecominfraproject.wlan</groupId>
|
||||||
@@ -25,16 +27,77 @@
|
|||||||
<artifactId>opensync-ext-static</artifactId>
|
<artifactId>opensync-ext-static</artifactId>
|
||||||
<version>${tip-wlan-cloud.release.version}</version>
|
<version>${tip-wlan-cloud.release.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!-- package executable jar file with all the dependencies in it -->
|
<!-- package executable jar file with all the dependencies in it -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>io.fabric8</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>${docker.fabric.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<verbose>true</verbose>
|
||||||
|
<apiVersion>1.23</apiVersion>
|
||||||
|
<images>
|
||||||
|
<image>
|
||||||
|
<name>opensync_gateway:${project.version}
|
||||||
|
</name>
|
||||||
|
<build>
|
||||||
|
<filter>@</filter>
|
||||||
|
<cleanup>try</cleanup>
|
||||||
|
<dockerFileDir>${project.basedir}/src/main/docker</dockerFileDir>
|
||||||
|
<dockerFile>Dockerfile</dockerFile>
|
||||||
|
<assembly>
|
||||||
|
<inline>
|
||||||
|
<dependencySets>
|
||||||
|
<dependencySet>
|
||||||
|
<includes>
|
||||||
|
<include>com.telecominfraproject.wlan:opensync-gateway-static-process</include>
|
||||||
|
</includes>
|
||||||
|
<outputFileNameMapping>app.jar</outputFileNameMapping>
|
||||||
|
</dependencySet>
|
||||||
|
</dependencySets>
|
||||||
|
</inline>
|
||||||
|
</assembly>
|
||||||
|
</build>
|
||||||
|
</image>
|
||||||
|
</images>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>clean-images</id>
|
||||||
|
<phase>pre-clean</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>remove</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<removeAll>true</removeAll>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>generate-images</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>build</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>push-images</id>
|
||||||
|
<phase>deploy</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>push</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
17
opensync-gateway-static-process/src/main/docker/Dockerfile
Normal file
17
opensync-gateway-static-process/src/main/docker/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
FROM openjdk:13-alpine
|
||||||
|
MAINTAINER ConnectUs
|
||||||
|
|
||||||
|
# Update the package list and upgrade installed packages
|
||||||
|
RUN apk update && apk upgrade && apk add bash
|
||||||
|
RUN mkdir /app && mkdir /app/logs && mkdir /app/opensync
|
||||||
|
RUN mkdir -p /opt/tip-wlan/certs
|
||||||
|
|
||||||
|
COPY maven/app.jar /app
|
||||||
|
COPY app/opensync/logback.xml /app/opensync/logback.xml
|
||||||
|
COPY app/run.sh /app
|
||||||
|
COPY app/opensync/config_2_ssids.json /app/opensync/config_2_ssids.json
|
||||||
|
|
||||||
|
RUN chmod +x /app/run.sh
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
CMD ["/app/run.sh"]
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"_type" : "OpensyncAPConfig",
|
||||||
|
"radioConfig" : {
|
||||||
|
"_type" : "OpensyncAPRadioConfig",
|
||||||
|
"country" : "CA",
|
||||||
|
"radioChannel24G" : 1,
|
||||||
|
"radioChannel5LG" : 44,
|
||||||
|
"radioChannel5HG" : 108
|
||||||
|
},
|
||||||
|
"ssidConfigs" : [ {
|
||||||
|
"_type" : "OpensyncAPSsidConfig",
|
||||||
|
"radioType" : "is2dot4GHz",
|
||||||
|
"ssid" : "Connectus-local",
|
||||||
|
"encryption" : "WPA-PSK",
|
||||||
|
"key" : "12345678",
|
||||||
|
"mode" : "2",
|
||||||
|
"broadcast" : true
|
||||||
|
}, {
|
||||||
|
"_type" : "OpensyncAPSsidConfig",
|
||||||
|
"radioType" : "is5GHz",
|
||||||
|
"ssid" : "Connectus-local-5",
|
||||||
|
"encryption" : "WPA-PSK",
|
||||||
|
"key" : "12345678",
|
||||||
|
"mode" : "2",
|
||||||
|
"broadcast" : true
|
||||||
|
} ]
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!-- For assistance related to logback-translator or configuration -->
|
||||||
|
<!-- files in general, please contact the logback user mailing list -->
|
||||||
|
<!-- at http://www.qos.ch/mailman/listinfo/logback-user -->
|
||||||
|
<!-- -->
|
||||||
|
<!-- For professional support please see -->
|
||||||
|
<!-- http://www.qos.ch/shop/products/professionalSupport -->
|
||||||
|
<!-- -->
|
||||||
|
<configuration>
|
||||||
|
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{yyyy-MM-DD HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||||
|
<file>myApp.log</file>
|
||||||
|
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<appender name="logfile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>/app/logs/opensyncgw.log</file>
|
||||||
|
<append>true</append>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date %level [%thread] %logger{36} [%file:%line] %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
|
||||||
|
<fileNamePattern>/app/logs/opensyncgw.%i.log.gz</fileNamePattern>
|
||||||
|
<minIndex>1</minIndex>
|
||||||
|
<maxIndex>3</maxIndex>
|
||||||
|
</rollingPolicy>
|
||||||
|
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
|
||||||
|
<maxFileSize>20MB</maxFileSize>
|
||||||
|
</triggeringPolicy>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
details: http://logback.qos.ch/manual/configuration.html#auto_configuration
|
||||||
|
|
||||||
|
runtime configuration, if need to override the defaults:
|
||||||
|
-Dlogback.configurationFile=/path/to/logback.xml
|
||||||
|
|
||||||
|
for log configuration debugging - use
|
||||||
|
-Dlogback.statusListenerClass=ch.qos.logback.core.status.OnConsoleStatusListener
|
||||||
|
|
||||||
|
log levels:
|
||||||
|
OFF ERROR WARN INFO DEBUG TRACE
|
||||||
|
-->
|
||||||
|
<logger name="org.apache.catalina.startup.DigesterFactory" level="ERROR"/>
|
||||||
|
<logger name="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" level="INFO"/>
|
||||||
|
<logger name="org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer" level="INFO"/>
|
||||||
|
|
||||||
|
<logger name="com.telecominfraproject.wlan" level="DEBUG"/>
|
||||||
|
<logger name="ai.connectus" level="DEBUG"/>
|
||||||
|
<logger name="com.netflix.servo.tag.aws.AwsInjectableTag" level="OFF"/>
|
||||||
|
<logger name="com.vmware.ovsdb.service.OvsdbConnectionInfo" level="OFF"/>
|
||||||
|
<logger name="com.vmware.ovsdb.netty.OvsdbConnectionHandler" level="ERROR"/>
|
||||||
|
|
||||||
|
<logger name="MQTT_DATA" level="DEBUG"/>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<logger name="org.springframework.security.web.authentication.preauth" level="DEBUG"/>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<root level="WARN">
|
||||||
|
<!-- <appender-ref ref="stdout"/>-->
|
||||||
|
<appender-ref ref="logfile"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
20
opensync-gateway-static-process/src/main/resources/run.sh → opensync-gateway-static-process/src/main/docker/app/run.sh
Normal file → Executable file
20
opensync-gateway-static-process/src/main/resources/run.sh → opensync-gateway-static-process/src/main/docker/app/run.sh
Normal file → Executable file
@@ -1,27 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
PROFILES=" -Dspring.profiles.include=mqtt_receiver,ovsdb_redirector,ovsdb_manager"
|
PROFILES=" -Dspring.profiles.include=mqtt_receiver,ovsdb_redirector,ovsdb_manager"
|
||||||
|
|
||||||
SSL_PROPS=" "
|
SSL_PROPS=" "
|
||||||
SSL_PROPS+=" -Dssl.props=file:/app/certs/ssl.properties"
|
SSL_PROPS+=" -Dssl.props=file:/opt/tip-wlan/certs/ssl.properties"
|
||||||
SSL_PROPS+=" -Dwhizcontrol.httpClientConfig=file:/app/certs/httpClientConfig.json"
|
SSL_PROPS+=" -Dwhizcontrol.httpClientConfig=file:/opt/tip-wlan/certs/httpClientConfig.json"
|
||||||
|
|
||||||
CLIENT_MQTT_SSL_PROPS=" "
|
CLIENT_MQTT_SSL_PROPS=" "
|
||||||
CLIENT_MQTT_SSL_PROPS+=" -Djavax.net.ssl.keyStore=/app/certs/client_keystore.jks"
|
CLIENT_MQTT_SSL_PROPS+=" -Djavax.net.ssl.keyStore=/opt/tip-wlan/certs/client_keystore.jks"
|
||||||
CLIENT_MQTT_SSL_PROPS+=" -Djavax.net.ssl.keyStorePassword=mypassword"
|
CLIENT_MQTT_SSL_PROPS+=" -Djavax.net.ssl.keyStorePassword=mypassword"
|
||||||
CLIENT_MQTT_SSL_PROPS+=" -Djavax.net.ssl.trustStore=/app/certs/truststore.jks"
|
CLIENT_MQTT_SSL_PROPS+=" -Djavax.net.ssl.trustStore=/opt/tip-wlan/certs/truststore.jks"
|
||||||
CLIENT_MQTT_SSL_PROPS+=" -Djavax.net.ssl.trustStorePassword=mypassword"
|
CLIENT_MQTT_SSL_PROPS+=" -Djavax.net.ssl.trustStorePassword=mypassword"
|
||||||
CLIENT_MQTT_SSL_PROPS+=" -Dconnectus.mqttBroker.password=admin"
|
CLIENT_MQTT_SSL_PROPS+=" -Dconnectus.mqttBroker.password=admin"
|
||||||
|
|
||||||
OVSDB_PROPS=" "
|
OVSDB_PROPS=" "
|
||||||
OVSDB_PROPS+=" -Dconnectus.ovsdb.managerAddr=________"
|
OVSDB_PROPS+=" -Dconnectus.ovsdb.managerAddr=opensync-controller"
|
||||||
OVSDB_PROPS+=" -Dconnectus.ovsdb.listenPort=6640 "
|
OVSDB_PROPS+=" -Dconnectus.ovsdb.listenPort=6640 "
|
||||||
OVSDB_PROPS+=" -Dconnectus.ovsdb.redirector.listenPort=6643"
|
OVSDB_PROPS+=" -Dconnectus.ovsdb.redirector.listenPort=6643"
|
||||||
OVSDB_PROPS+=" -Dconnectus.ovsdb.timeoutSec=30"
|
OVSDB_PROPS+=" -Dconnectus.ovsdb.timeoutSec=30"
|
||||||
OVSDB_PROPS+=" -Dconnectus.ovsdb.trustStore=/app/certs/truststore.jks"
|
OVSDB_PROPS+=" -Dconnectus.ovsdb.trustStore=/opt/tip-wlan/certs/truststore.jks"
|
||||||
OVSDB_PROPS+=" -Dconnectus.ovsdb.keyStore=/app/certs/server.pkcs12"
|
OVSDB_PROPS+=" -Dconnectus.ovsdb.keyStore=/opt/tip-wlan/certs/server.pkcs12"
|
||||||
OVSDB_PROPS+=" -Dconnectus.ovsdb.configFileName=/app/opensync/config_2_ssids.json"
|
OVSDB_PROPS+=" -Dconnectus.ovsdb.configFileName=/app/opensync/config_2_ssids.json"
|
||||||
|
|
||||||
MQTT_PROPS=" "
|
MQTT_PROPS=" "
|
||||||
MQTT_PROPS+=" -Dconnectus.mqttBroker.address=_________"
|
MQTT_PROPS+=" -Dconnectus.mqttBroker.address=opensync-wifi-controller-opensync-mqtt-broker"
|
||||||
MQTT_PROPS+=" -Dconnectus.mqttBroker.listenPort=1883"
|
MQTT_PROPS+=" -Dconnectus.mqttBroker.listenPort=1883"
|
||||||
|
|
||||||
LOGGING_PROPS=" -Dlogging.config=file:/app/opensync/logback.xml"
|
LOGGING_PROPS=" -Dlogging.config=file:/app/opensync/logback.xml"
|
||||||
@@ -31,5 +32,4 @@ RESTAPI_PROPS+=" -Dserver.port=443"
|
|||||||
|
|
||||||
export ALL_PROPS="$PROFILES $SSL_PROPS $CLIENT_MQTT_SSL_PROPS $OVSDB_PROPS $MQTT_PROPS $LOGGING_PROPS $RESTAPI_PROPS "
|
export ALL_PROPS="$PROFILES $SSL_PROPS $CLIENT_MQTT_SSL_PROPS $OVSDB_PROPS $MQTT_PROPS $LOGGING_PROPS $RESTAPI_PROPS "
|
||||||
|
|
||||||
sudo java $ALL_PROPS -jar opensync-gateway-static-process-0.0.1-SNAPSHOT.jar > stdout.out 2>&1 &
|
java $ALL_PROPS -jar app.jar
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
sudo: unable to read password: Input/output error
|
||||||
Reference in New Issue
Block a user