summaryrefslogtreecommitdiffstats
path: root/utils/test/reporting/docker
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/reporting/docker')
-rw-r--r--utils/test/reporting/docker/Dockerfile7
-rw-r--r--utils/test/reporting/docker/nginx.conf24
-rwxr-xr-xutils/test/reporting/docker/reporting.sh18
-rw-r--r--utils/test/reporting/docker/requirements.pip1
-rw-r--r--utils/test/reporting/docker/supervisor.conf16
5 files changed, 65 insertions, 1 deletions
diff --git a/utils/test/reporting/docker/Dockerfile b/utils/test/reporting/docker/Dockerfile
index b5fe09894..42f019a45 100644
--- a/utils/test/reporting/docker/Dockerfile
+++ b/utils/test/reporting/docker/Dockerfile
@@ -32,6 +32,9 @@ ssh \
python-pip \
git-core \
wkhtmltopdf \
+nodejs \
+npm \
+supervisor \
--no-install-recommends
RUN pip install --upgrade pip
@@ -41,3 +44,7 @@ RUN pip install -r ${working_dir}/docker/requirements.pip
WORKDIR ${working_dir}
RUN docker/reporting.sh
+
+expose 8000
+
+CMD ["/usr/bin/supervisord"]
diff --git a/utils/test/reporting/docker/nginx.conf b/utils/test/reporting/docker/nginx.conf
new file mode 100644
index 000000000..9e2697248
--- /dev/null
+++ b/utils/test/reporting/docker/nginx.conf
@@ -0,0 +1,24 @@
+upstream backends {
+ server localhost:8001;
+ server localhost:8002;
+ server localhost:8003;
+ server localhost:8004;
+}
+
+
+server {
+ listen 8000;
+ server_name localhost;
+
+ location / {
+ proxy_pass http://backends;
+ }
+
+ location /reporting/ {
+ alias /home/opnfv/utils/test/reporting/pages/dist/;
+ }
+
+ location /display/ {
+ alias /home/opnfv/utils/test/reporting/display/;
+ }
+}
diff --git a/utils/test/reporting/docker/reporting.sh b/utils/test/reporting/docker/reporting.sh
index d6b173ceb..1bef1b811 100755
--- a/utils/test/reporting/docker/reporting.sh
+++ b/utils/test/reporting/docker/reporting.sh
@@ -61,4 +61,20 @@ else
echo "********************************"
python ./$project/reporting-$reporting_type.py
fi
-mv display /usr/share/nginx/html
+cp -r display /usr/share/nginx/html
+
+
+# nginx config
+cp /home/opnfv/utils/test/reporting/docker/nginx.conf /etc/nginx/conf.d/
+echo "daemon off;" >> /etc/nginx/nginx.conf
+
+# supervisor config
+cp /home/opnfv/utils/test/reporting/docker/supervisor.conf /etc/supervisor/conf.d/
+
+# build pages
+cd pages
+ln -s /usr/bin/nodejs /usr/bin/node
+npm install
+npm install -g grunt bower
+bower install --allow-root
+grunt build
diff --git a/utils/test/reporting/docker/requirements.pip b/utils/test/reporting/docker/requirements.pip
index c1bf4b109..6de856e35 100644
--- a/utils/test/reporting/docker/requirements.pip
+++ b/utils/test/reporting/docker/requirements.pip
@@ -11,3 +11,4 @@ pdfkit==0.5.0
PyYAML==3.11
simplejson==3.8.1
jinja2==2.8
+tornado==4.4.2
diff --git a/utils/test/reporting/docker/supervisor.conf b/utils/test/reporting/docker/supervisor.conf
new file mode 100644
index 000000000..0c2207793
--- /dev/null
+++ b/utils/test/reporting/docker/supervisor.conf
@@ -0,0 +1,16 @@
+[supervisord]
+nodaemon = true
+
+[program:reporting_tornado]
+user = root
+directory = /home/opnfv/utils/test/reporting/api
+command = python server.py --port=800%(process_num)d
+process_name=%(program_name)s%(process_num)d
+numprocs=4
+numprocs_start=1
+autorestart = true
+
+[program:reporting_nginx]
+user = root
+command = service nginx restart
+autorestart = true