From 49c1587a0900eba172e14adc0c93bb73d0fac9f8 Mon Sep 17 00:00:00 2001 From: "Ikramullah, Ikram" Date: Wed, 24 Apr 2019 22:30:17 +0000 Subject: [PATCH] Changes related to running oof on TLS/HTTPS Change-Id: Ie20e65a70262f7b42e0eb9a033768e429d85f7d6 Issue-ID: OPTFRA-461 Signed-off-by: Ikramullah, Ikram --- conductor/docker/Dockerfile | 68 +++++++++++++++++++++------------------------ conductor/docker/app.wsgi | 14 ++++++++++ 2 files changed, 46 insertions(+), 36 deletions(-) mode change 100755 => 100644 conductor/docker/Dockerfile create mode 100644 conductor/docker/app.wsgi diff --git a/conductor/docker/Dockerfile b/conductor/docker/Dockerfile old mode 100755 new mode 100644 index b68ebaf..b7528d8 --- a/conductor/docker/Dockerfile +++ b/conductor/docker/Dockerfile @@ -15,42 +15,38 @@ # # ------------------------------------------------------------------------- -FROM python:2.7-alpine +FROM python:2.7.15-alpine +ENV CON_PORT "8091" -ARG MVN_ARTIFACT_VERSION -ARG REPO -ARG HTTP_PROXY=${HTTP_PROXY} -ARG HTTPS_PROXY=${HTTPS_PROXY} +EXPOSE 8091 -ENV http_proxy $HTTP_PROXY -ENV https_proxy $HTTPS_PROXY -ENV CON_ADDR "127.0.0.1" -ENV CON_PORT "8091" +RUN mkdir -p /etc/nginx/ssl && \ +mkdir -p /var/log/conductor && \ +mkdir -p /run/conductor && \ +mkdir -p /run/nginx + +RUN apk --update add py-setuptools && \ +apk add unzip && \ +apk add curl && \ +apk add wget && \ +apk add fcgiwrap && \ +apk add bash vim && \ +apk add nginx + +RUN apk add py2-pip libpq python-dev +RUN pip install --upgrade pip +RUN apk add --virtual build-dependencies build-base linux-headers pcre-dev libffi-dev libxslt-dev libressl-dev +RUN pip install uwsgi + +#Please leave teh following commmented out line in for test on local clusters +#RUN wget -O /tmp/has.zip "https://nexus.onap.org/service/local/repositories/autorelease-121393/content/org/onap/optf/has/optf-has-conductor/1.2.5/optf-has-conductor-1.2.5.zip" && \ +RUN wget -O /tmp/has.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.optf.has&a=optf-has-conductor&e=zip&v=${MVN_ARTIFACT_VERSION}" && \ + unzip -q -o -B /tmp/has.zip -d /tmp/has && \ + rm -f /tmp/has.zip + +#PKG-INFO file must also exists in the conductor folder (i.e. besides and inside the of_has.egg-info folder). The zip file for distro above is missing it +RUN cp /tmp/has/conductor/of_has.egg-info/PKG-INFO /tmp/has/conductor +RUN pip install -e /tmp/has/conductor -EXPOSE ${CON_PORT} - -# Add required libraries -RUN apk add --no-cache curl \ - gcc \ - libffi-dev \ - linux-headers \ - musl-dev \ - git \ - libxml2-dev \ - libxslt-dev \ - openssl-dev \ - py-setuptools \ - unzip \ - wget \ - xvfb - -WORKDIR /opt/has -RUN wget -O /opt/has.zip "https://nexus.onap.org/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.optf.has&a=optf-has-conductor&e=zip&v=${MVN_ARTIFACT_VERSION}" && \ - unzip -q -o -B /opt/has.zip -d /opt/has && \ - rm -f /opt/has.zip -RUN mkdir -p /var/log/onap/optf/has/ - -RUN cd /opt/has/conductor && \ - git init && \ - pip install -e . -COPY api_paste.ini /usr/local/bin/api_paste.ini +COPY app.wsgi /etc/nginx/conductor.wsgi +COPY api_paste.ini /usr/local/etc/conductor/api_paste.ini diff --git a/conductor/docker/app.wsgi b/conductor/docker/app.wsgi new file mode 100644 index 0000000..91cd980 --- /dev/null +++ b/conductor/docker/app.wsgi @@ -0,0 +1,14 @@ +"""Use this file for deploying the API under mod_wsgi. +See http://pecan.readthedocs.org/en/latest/deployment.html for details. +""" +from conductor import service +from conductor.api import app + +# Initialize the oslo configuration library and logging + +# Prepare service-wide components (e.g., config) +conf = service.prepare_service( + [], config_files=['/usr/local/etc/conductor/conductor.conf']) + +#conf = service.prepare_service([]) +application = app.load_app(conf) -- 2.16.6