blob: 0d2a3d6465e515bb8cb77c86f40d54cb5c631732 [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
8# Copy the current directory contents into the container at /app
Felipe Vicens07f31722018-10-29 15:16:44 +01009#ADD . /app
Mike Marchettic678d042018-04-18 13:51:27 -040010
tiernoa8d63632018-05-10 13:12:32 +020011RUN apt-get update && apt-get install -y git python3 python3-jsonschema \
Eduardo Sousa819d34c2018-07-31 01:20:02 +010012 python3-pymongo python3-yaml python3-pip python3-keystoneclient \
Mike Marchettic678d042018-04-18 13:51:27 -040013 && pip3 install pip==9.0.3 \
Eduardo Sousa819d34c2018-07-31 01:20:02 +010014 && pip3 install aiokafka cherrypy==18.0.0 keystoneauth1 \
Mike Marchettic678d042018-04-18 13:51:27 -040015 && mkdir -p /app/storage/kafka && mkdir -p /app/log
tiernoaae4dc42018-06-11 18:55:50 +020016
17# OSM_COMMON
tiernoa8d63632018-05-10 13:12:32 +020018RUN git clone https://osm.etsi.org/gerrit/osm/common.git \
Eduardo Sousa56e698a2018-10-10 17:47:12 +010019 && pip3 install -e common
20# && cd common && python3 setup.py develop && cd ..
tiernoa8d63632018-05-10 13:12:32 +020021# && pip3 install -U -r requirements.txt \
22# && cd ..
23
tiernoaae4dc42018-06-11 18:55:50 +020024# OSM_IM
25RUN pip3 install pyang && mkdir -p /app && cd /app \
tierno4d34ece2018-10-29 10:16:01 +000026 && git -C /app clone https://github.com/robshakir/pyangbind \
27 && pip3 install -e /app/pyangbind \
28 && git -C /app clone https://osm.etsi.org/gerrit/osm/IM \
tiernoaae4dc42018-06-11 18:55:50 +020029 && cd /app/IM/models/yang \
tierno4d34ece2018-10-29 10:16:01 +000030 && mkdir /app/IM/osm_im \
31 && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/IM/osm_im/vnfd.py vnfd.yang \
32 && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/IM/osm_im/nsd.py nsd.yang \
33 && pip3 install -e /app/IM
Mike Marchettic678d042018-04-18 13:51:27 -040034
35EXPOSE 9999
36
37LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
38 Description="This implements a north bound interface for OSM" \
39 Version="1.0" \
40 Author="Alfonso Tierno"
41
42# Used for local storage
43VOLUME /app/storage
44# Used for logs
45VOLUME /app/log
46
47# The following ENV can be added with "docker run -e xxx' to configure
48# server
Eduardo Sousa819d34c2018-07-31 01:20:02 +010049ENV OSMNBI_SOCKET_HOST 0.0.0.0
50ENV OSMNBI_SOCKET_PORT 9999
Mike Marchettic678d042018-04-18 13:51:27 -040051# storage
Eduardo Sousa819d34c2018-07-31 01:20:02 +010052ENV OSMNBI_STORAGE_PATH /app/storage
Mike Marchettic678d042018-04-18 13:51:27 -040053# database
Eduardo Sousa819d34c2018-07-31 01:20:02 +010054ENV OSMNBI_DATABASE_DRIVER mongo
55ENV OSMNBI_DATABASE_HOST mongo
56ENV OSMNBI_DATABASE_PORT 27017
tiernod985a8d2018-10-19 14:12:28 +020057# ENV OSMNBI_DATABASE_USER xxx
58# ENV OSMNBI_DATABASE_PASSWORD xxx
59# ENV OSMNBI_DATABASE_MASTERPASSWORD xxx
Mike Marchettic678d042018-04-18 13:51:27 -040060# web
Eduardo Sousa819d34c2018-07-31 01:20:02 +010061ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public
Mike Marchettic678d042018-04-18 13:51:27 -040062# logs
Eduardo Sousa819d34c2018-07-31 01:20:02 +010063ENV OSMNBI_LOG_FILE /app/log
64ENV OSMNBI_LOG_LEVEL DEBUG
Mike Marchettic678d042018-04-18 13:51:27 -040065# message
Eduardo Sousa819d34c2018-07-31 01:20:02 +010066ENV OSMNBI_MESSAGE_DRIVER kafka
67ENV OSMNBI_MESSAGE_HOST kafka
68ENV OSMNBI_MESSAGE_PORT 9092
tiernof5298be2018-05-16 14:43:57 +020069# logs
Eduardo Sousa819d34c2018-07-31 01:20:02 +010070ENV OSMNBI_LOG_FILE /app/log/nbi.log
71ENV OSMNBI_LOG_LEVEL DEBUG
72# authentication
73ENV OSMNBI_AUTHENTICATION_BACKEND internal
74#ENV OSMNBI_AUTHENTICATION_BACKEND keystone
75#ENV OSMNBI_AUTHENTICATION_AUTH_URL keystone
76#ENV OSMNBI_AUTHENTICATION_AUTH_PORT 5000
77#ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME default
78#ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME default
79#ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME nbi
80#ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD nbi
81#ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT service
Mike Marchettic678d042018-04-18 13:51:27 -040082
Felipe Vicens07f31722018-10-29 15:16:44 +010083ADD . /app/NBI
84
Mike Marchettic678d042018-04-18 13:51:27 -040085# Run app.py when the container launches
86CMD ["python3", "nbi.py"]
87