summaryrefslogtreecommitdiffstats
path: root/huawei/vnfmadapter
diff options
context:
space:
mode:
authorYuanhong Deng <dengyuanhong@chinamobile.com>2020-09-28 00:56:59 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-28 00:56:59 +0000
commit6c85ab3bca6ce1aeee7ff49e42fc315cf565da5f (patch)
tree6423366bee106a1369a0c50f67244844ac996693 /huawei/vnfmadapter
parenta8a4d6a0f1abf83cbb596a375f453d99fb2c8ed0 (diff)
parent4bc82cd938f0778088d2c101ab58e74bddbcc93f (diff)
Merge "Two main process in vfc huawei vnfm pod Issue-ID: VFC-1692"
Diffstat (limited to 'huawei/vnfmadapter')
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/docker/Dockerfile3
-rwxr-xr-xhuawei/vnfmadapter/VnfmadapterService/docker/docker-entrypoint.sh6
-rw-r--r--huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh31
3 files changed, 39 insertions, 1 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/docker/Dockerfile b/huawei/vnfmadapter/VnfmadapterService/docker/Dockerfile
index 696d4cd7..a257f9e5 100644
--- a/huawei/vnfmadapter/VnfmadapterService/docker/Dockerfile
+++ b/huawei/vnfmadapter/VnfmadapterService/docker/Dockerfile
@@ -6,6 +6,9 @@ ENV CATALINA_HOME /service
ADD . /service
WORKDIR /service
RUN bash docker-env-config.sh
+VOLUME /var/lib/mysql
+
+EXPOSE 8482
USER onap
ENTRYPOINT /service/docker-entrypoint.sh
diff --git a/huawei/vnfmadapter/VnfmadapterService/docker/docker-entrypoint.sh b/huawei/vnfmadapter/VnfmadapterService/docker/docker-entrypoint.sh
index 9cfd4dca..e61bbd19 100755
--- a/huawei/vnfmadapter/VnfmadapterService/docker/docker-entrypoint.sh
+++ b/huawei/vnfmadapter/VnfmadapterService/docker/docker-entrypoint.sh
@@ -46,11 +46,17 @@ echo
# Configure service based on docker environment variables
./instance-config.sh
+# Start mysql
+/usr/bin/mysqld_safe &
+
# Perform one-time config
if [ ! -e init.log ]; then
# Perform workarounds due to defects in release binary
./instance-workaround.sh
+ # Init mysql; set root password
+ ./init-mysql.sh
+
# microservice-specific one-time initialization
./instance-init.sh
diff --git a/huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh b/huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh
index 3ae4f986..7c4d235a 100644
--- a/huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh
+++ b/huawei/vnfmadapter/VnfmadapterService/docker/docker-env-config.sh
@@ -2,7 +2,33 @@
add_user(){
useradd onap
- chown onap:onap -R /service
+}
+
+set_up_mysql_jdk(){
+
+ sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
+ sed -i 's|#baseurl=http://mirror.centos.org/centos|baseurl=http://mirrors.ocf.berkeley.edu/centos|' /etc/yum.repos.d/*.repo
+ yum -y update
+
+ yum -y install wget unzip socat java-11-openjdk-headless
+ sed -i 's|#networkaddress.cache.ttl=-1|networkaddress.cache.ttl=10|' /usr/lib/jvm/jre/lib/security/java.security
+
+ # Set up mysql
+ wget -q http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm && \
+ rpm -ivh mysql-community-release-el7-5.noarch.rpm && \
+ rm -f mysql-community-release-el7-5.noarch.rpm
+ yum -y update
+ yum -y install mysql-server
+ mysql_install_db --user=onap --datadir=/var/lib/mysql
+ chown onap:onap -R /var/run/mysqld
+ chmod g+s /var/run/mysqld
+ setfacl -d --set u:onap:rwx /var/run/mysqld
+ chown onap:onap /var/log/mysqld.log
+ chmod g+s /var/log/mysqld.log
+ chown onap:onap -R /var/lib/mysql-files
+ chmod g+s /var/lib/mysql-files
+ setfacl -d --set u:onap:rwx /var/lib/mysql-files
+ chown onap:onap /etc/my.cnf
}
set_up_tomcat(){
@@ -35,6 +61,9 @@ clean_sf_cache(){
yum clean all
}
+add_user
+set_up_mysql_jdk
+wait
set_up_tomcat
wait
clean_sf_cache