blob: c76bc27de7ca9bdd546a0f776f3771e97998b9cc [file] [log] [blame]
tiernoa8d63632018-05-10 13:12:32 +02001# This creates osm/NBI docker from local NBI source code
2
Mike Marchettic678d042018-04-18 13:51:27 -04003FROM ubuntu:16.04
4
5# Set the working directory to /app
tierno4d34ece2018-10-29 10:16:01 +00006WORKDIR /app/NBI/osm_nbi
Mike Marchettic678d042018-04-18 13:51:27 -04007
tiernoa8d63632018-05-10 13:12:32 +02008RUN apt-get update && apt-get install -y git python3 python3-jsonschema \
Eduardo Sousa819d34c2018-07-31 01:20:02 +01009 python3-pymongo python3-yaml python3-pip python3-keystoneclient \
Mike Marchettic678d042018-04-18 13:51:27 -040010 && pip3 install pip==9.0.3 \
Eduardo Sousa819d34c2018-07-31 01:20:02 +010011 && pip3 install aiokafka cherrypy==18.0.0 keystoneauth1 \
Mike Marchettic678d042018-04-18 13:51:27 -040012 && mkdir -p /app/storage/kafka && mkdir -p /app/log
tiernoaae4dc42018-06-11 18:55:50 +020013
14# OSM_COMMON
tierno4c57e2e2018-11-16 22:59:35 +010015RUN git -C /app clone https://osm.etsi.org/gerrit/osm/common.git \
16 && pip3 install -e /app/common
Eduardo Sousa56e698a2018-10-10 17:47:12 +010017# && cd common && python3 setup.py develop && cd ..
tiernoa8d63632018-05-10 13:12:32 +020018# && pip3 install -U -r requirements.txt \
19# && cd ..
20
tiernoaae4dc42018-06-11 18:55:50 +020021# OSM_IM
22RUN pip3 install pyang && mkdir -p /app && cd /app \
tierno4d34ece2018-10-29 10:16:01 +000023 && git -C /app clone https://github.com/robshakir/pyangbind \
24 && pip3 install -e /app/pyangbind \
25 && git -C /app clone https://osm.etsi.org/gerrit/osm/IM \
tiernoaae4dc42018-06-11 18:55:50 +020026 && cd /app/IM/models/yang \
tierno4d34ece2018-10-29 10:16:01 +000027 && mkdir /app/IM/osm_im \
28 && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/IM/osm_im/vnfd.py vnfd.yang \
29 && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/IM/osm_im/nsd.py nsd.yang \
30 && pip3 install -e /app/IM
Mike Marchettic678d042018-04-18 13:51:27 -040031
32EXPOSE 9999
33
34LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
35 Description="This implements a north bound interface for OSM" \
36 Version="1.0" \
37 Author="Alfonso Tierno"
38
39# Used for local storage
40VOLUME /app/storage
41# Used for logs
42VOLUME /app/log
43
44# The following ENV can be added with "docker run -e xxx' to configure
45# server
Eduardo Sousa819d34c2018-07-31 01:20:02 +010046ENV OSMNBI_SOCKET_HOST 0.0.0.0
47ENV OSMNBI_SOCKET_PORT 9999
Mike Marchettic678d042018-04-18 13:51:27 -040048# storage
Eduardo Sousa819d34c2018-07-31 01:20:02 +010049ENV OSMNBI_STORAGE_PATH /app/storage
Mike Marchettic678d042018-04-18 13:51:27 -040050# database
Eduardo Sousa819d34c2018-07-31 01:20:02 +010051ENV OSMNBI_DATABASE_DRIVER mongo
52ENV OSMNBI_DATABASE_HOST mongo
53ENV OSMNBI_DATABASE_PORT 27017
tiernod985a8d2018-10-19 14:12:28 +020054# ENV OSMNBI_DATABASE_USER xxx
55# ENV OSMNBI_DATABASE_PASSWORD xxx
tierno92c1c7d2018-11-12 15:22:37 +010056# ENV OSMNBI_DATABASE_COMMONKEY xxx
Mike Marchettic678d042018-04-18 13:51:27 -040057# web
tierno4c57e2e2018-11-16 22:59:35 +010058ENV OSMNBI_STATIC_DIR /app/NBI/osm_nbi/html_public
Mike Marchettic678d042018-04-18 13:51:27 -040059# logs
tierno0c01ffa2018-11-19 14:39:33 +010060# ENV OSMNBI_LOG_FILE /app/log/nbi.log
Eduardo Sousa819d34c2018-07-31 01:20:02 +010061ENV OSMNBI_LOG_LEVEL DEBUG
Mike Marchettic678d042018-04-18 13:51:27 -040062# message
Eduardo Sousa819d34c2018-07-31 01:20:02 +010063ENV OSMNBI_MESSAGE_DRIVER kafka
64ENV OSMNBI_MESSAGE_HOST kafka
65ENV OSMNBI_MESSAGE_PORT 9092
Eduardo Sousa819d34c2018-07-31 01:20:02 +010066# authentication
67ENV OSMNBI_AUTHENTICATION_BACKEND internal
68#ENV OSMNBI_AUTHENTICATION_BACKEND keystone
69#ENV OSMNBI_AUTHENTICATION_AUTH_URL keystone
70#ENV OSMNBI_AUTHENTICATION_AUTH_PORT 5000
71#ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME default
72#ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME default
73#ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME nbi
74#ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD nbi
75#ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT service
Mike Marchettic678d042018-04-18 13:51:27 -040076
tierno4c57e2e2018-11-16 22:59:35 +010077# Copy the current directory contents into the container at /app
Felipe Vicens07f31722018-10-29 15:16:44 +010078ADD . /app/NBI
79
Mike Marchettic678d042018-04-18 13:51:27 -040080# Run app.py when the container launches
81CMD ["python3", "nbi.py"]