Add a document describing vIPSEC testcase
[yardstick.git] / docker / uwsgi.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
4 #
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10
11 : ${YARDSTICK_REPO_DIR:='/home/opnfv/repos/yardstick'}
12
13 # generate uwsgi config file
14 mkdir -p /etc/yardstick
15
16 # create api log directory
17 mkdir -p /var/log/yardstick
18
19 # create yardstick.sock for communicating
20 touch /var/run/yardstick.sock
21
22 uwsgi_config='/etc/yardstick/yardstick.ini'
23 if [[ ! -e "${uwsgi_config}" ]];then
24
25     cat << EOF > "${uwsgi_config}"
26 [uwsgi]
27 master = true
28 debug = true
29 chdir = ${YARDSTICK_REPO_DIR}/api
30 module = server
31 plugins = python
32 processes = 10
33 threads = 5
34 async = true
35 max-requests = 5000
36 chmod-socket = 666
37 callable = app_wrapper
38 enable-threads = true
39 close-on-exec = 1
40 daemonize= /var/log/yardstick/uwsgi.log
41 socket = /var/run/yardstick.sock
42 EOF
43     if [[ "${YARDSTICK_VENV}" ]];then
44         echo "virtualenv = ${YARDSTICK_VENV}" >> "${uwsgi_config}"
45     fi
46 fi