diff options
author | Moshe <moshehoa@amdocs.com> | 2018-03-29 09:14:00 +0300 |
---|---|---|
committer | Moshe <moshehoa@amdocs.com> | 2018-03-29 09:14:41 +0300 |
commit | 4e0a60741c8a6e0387ec3d18fcf0b41def8fcb86 (patch) | |
tree | b0b67723d44a905e2b06b8066875c8274e8a6597 | |
parent | e4c31a3b9f7fa0f7da935f985a9f47bccb1b00d4 (diff) |
Fix docker image creation during maven build
Issue-ID: VNFSDK-183
Change-Id: I6224bae4ae472c6029156dea659a89dc992d1f76
Signed-off-by: Moshe <moshehoa@amdocs.com>
-rw-r--r-- | docker/Dockerfile | 10 | ||||
-rw-r--r-- | docker/Makefile | 2 | ||||
-rwxr-xr-x | docker/exec_tests.sh | 10 | ||||
-rwxr-xr-x | docker/nginx.sh | 43 | ||||
-rwxr-xr-x | docker/supervisor.sh | 33 | ||||
-rwxr-xr-x | docker/uwsgi.sh | 53 | ||||
-rwxr-xr-x | install.sh | 19 |
7 files changed, 3 insertions, 167 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 20598c7..62095ca 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,7 +15,7 @@ # yardstick/docker/Dockerfile FROM ubuntu:16.04 -LABEL image=onap/vnftest +LABEL image=onap/vnfsdk/vnftest ARG BRANCH=master @@ -41,11 +41,6 @@ RUN git clone --depth 1 -b $BRANCH https://gerrit.onap.org/r/vnfsdk/dovetail-int WORKDIR ${VNFTEST_REPO_DIR} RUN ${VNFTEST_REPO_DIR}/install.sh -RUN ${VNFTEST_REPO_DIR}/docker/supervisor.sh - -RUN echo "daemon off;" >> /etc/nginx/nginx.conf - -EXPOSE 6000 ADD http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img ${IMAGE_DIR} ADD http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img ${IMAGE_DIR} @@ -54,6 +49,3 @@ COPY ./exec_tests.sh /usr/local/bin/ ENV NSB_DIR="/opt/nsb_bin" \ PYTHONPATH="${PYTHONPATH}:${NSB_DIR}/trex_client:${NSB_DIR}/trex_client/stl" - -WORKDIR ${REPOS_DIR} -CMD ["/usr/bin/supervisord"] diff --git a/docker/Makefile b/docker/Makefile index 4f9e18b..75cba89 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -16,7 +16,7 @@ SHELL = /bin/bash -IMAGE = onap/vnftest +IMAGE = onap/vnfsdk/vnftest DOCKER_TAG = beijing.0 diff --git a/docker/exec_tests.sh b/docker/exec_tests.sh index 9e16476..a4ea4ca 100755 --- a/docker/exec_tests.sh +++ b/docker/exec_tests.sh @@ -83,12 +83,4 @@ if [ ! -d ${VNFTEST_REPO_DIR} ]; then git clone ${VNFTEST_REPO} ${VNFTEST_REPO_DIR} fi cd ${VNFTEST_REPO_DIR} -git_checkout ${VNFTEST_BRANCH} - -if [[ "${DEPLOY_STEP:0:2}" == "os" ]];then - # setup the environment - source ${VNFTEST_REPO_DIR}/tests/ci/prepare_env.sh -fi - -# execute tests -${VNFTEST_REPO_DIR}/tests/ci/vnftest-verify $@ +git_checkout ${VNFTEST_BRANCH}
\ No newline at end of file diff --git a/docker/nginx.sh b/docker/nginx.sh deleted file mode 100755 index ac81c73..0000000 --- a/docker/nginx.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.0 (the"License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and limitations under -# the License -############################################################################## -# vnftest comment: this is a modified copy of -# yardstick/docker/nginx.sh - -# nginx config -nginx_config='/etc/nginx/conf.d/vnftest.conf' - -if [[ ! -e "${nginx_config}" ]];then - - cat << EOF > "${nginx_config}" -server { - listen 6000; - server_name localhost; - index index.htm index.html; - location / { - include uwsgi_params; - client_max_body_size 2000m; - uwsgi_pass unix:///var/run/vnftest.sock; - } - - location /gui/ { - alias /etc/nginx/vnftest/gui/; - } - - location /report/ { - alias /tmp/; - } -} -EOF -fi diff --git a/docker/supervisor.sh b/docker/supervisor.sh deleted file mode 100755 index 0462024..0000000 --- a/docker/supervisor.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.0 (the"License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and limitations under -# the License -############################################################################## -# vnftest comment: this is a modified copy of -# yardstick/docker/supervisor.sh - -# nginx service start when boot -supervisor_config='/etc/supervisor/conf.d/vnftest.conf' - -if [[ ! -e "${supervisor_config}" ]];then - cat << EOF > "${supervisor_config}" -[supervisord] -nodaemon = true - -[program:nginx] -command = service nginx restart - -[program:vnftest_uwsgi] -directory = /etc/vnftest -command = uwsgi -i vnftest.ini -EOF -fi diff --git a/docker/uwsgi.sh b/docker/uwsgi.sh deleted file mode 100755 index da0833a..0000000 --- a/docker/uwsgi.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright 2018 EuropeanSoftwareMarketingLtd. -# =================================================================== -# Licensed under the ApacheLicense, Version2.0 (the"License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# software distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and limitations under -# the License -############################################################################## -# vnftest comment: this is a modified copy of -# yardstick/docker/uwsgi.sh - -: ${VNFTEST_REPO_DIR:='/home/onap/repos/vnftest'} - -# generate uwsgi config file -mkdir -p /etc/vnftest - -# create api log directory -mkdir -p /var/log/vnftest - -# create vnftest.sock for communicating -touch /var/run/vnftest.sock - -uwsgi_config='/etc/vnftest/vnftest.ini' -if [[ ! -e "${uwsgi_config}" ]];then - - cat << EOF > "${uwsgi_config}" -[uwsgi] -master = true -debug = true -chdir = ${VNFTEST_REPO_DIR}/api -module = server -plugins = python -processes = 10 -threads = 5 -async = true -max-requests = 5000 -chmod-socket = 666 -callable = app_wrapper -enable-threads = true -close-on-exec = 1 -daemonize= /var/log/vnftest/uwsgi.log -socket = /var/run/vnftest.sock -EOF - if [[ "${VNFTEST_VENV}" ]];then - echo "virtualenv = ${VNFTEST_VENV}" >> "${uwsgi_config}" - fi -fi @@ -23,7 +23,6 @@ UBUNTU_ARCHIVE_URL="http://archive.ubuntu.com/ubuntu/" source /etc/os-release source_file=/etc/apt/sources.list -NSB_DIR="/opt/nsb_bin" if [[ "${DOCKER_ARCH}" == "aarch64" ]]; then sed -i -e 's/^deb \([^/[]\)/deb [arch=arm64] \1/g' "${source_file}" @@ -82,9 +81,6 @@ apt-get update && apt-get install -y \ python-dev \ libxml2-dev \ libxslt1-dev \ - nginx \ - uwsgi \ - uwsgi-plugin-python \ supervisor \ python-pip \ vim \ @@ -106,18 +102,3 @@ git config --global http.sslVerify false easy_install -U pip pip install -r requirements.txt pip install -e . - -/bin/bash "${PWD}/docker/uwsgi.sh" -/bin/bash "${PWD}/docker/nginx.sh" -cd "${PWD}/gui" && /bin/bash gui.sh -mkdir -p /etc/nginx/vnftest -mv dist /etc/nginx/vnftest/gui - -mkdir -p ${NSB_DIR} - -wget -P ${NSB_DIR}/ http://artifacts.onap.org/vnftest/third-party/trex_client.tar.gz -tar xvf ${NSB_DIR}/trex_client.tar.gz -C ${NSB_DIR} -rm -f ${NSB_DIR}/trex_client.tar.gz - -service nginx restart -uwsgi -i /etc/vnftest/vnftest.ini |