1 ############################################################################
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
15 ############################################################################
17 FROM ubuntu:20.04 as INSTALL
21 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
22 DEBIAN_FRONTEND=noninteractive apt-get --yes install \
23 gcc python3 python3-dev python3-venv python3-pip \
24 python3-setuptools curl git genisoimage netbase && \
25 python3 -m pip install -U pip build
29 RUN git clone https://osm.etsi.org/gerrit/osm/common.git
31 RUN python3 -m pip install -r requirements.txt \
32 -r common/requirements.txt
34 RUN python3 -m build /build/common && \
35 python3 -m pip install /build/common/dist/*.whl
37 RUN python3 -m build /build/RO-plugin && \
38 python3 -m pip install /build/RO-plugin/dist/*.whl
40 RUN python3 -m build /build/NG-RO && \
41 python3 -m pip install /build/NG-RO/dist/*.whl
43 RUN python3 -m build /build/RO-VIM-vmware && \
44 python3 -m pip install /build/RO-VIM-vmware/dist/*.whl
46 RUN python3 -m build /build/RO-VIM-openstack && \
47 python3 -m pip install /build/RO-VIM-openstack/dist/*.whl
49 RUN python3 -m build /build/RO-VIM-openvim && \
50 python3 -m pip install /build/RO-VIM-openvim/dist/*.whl
52 RUN python3 -m build /build/RO-VIM-aws && \
53 python3 -m pip install /build/RO-VIM-aws/dist/*.whl
55 RUN python3 -m build /build/RO-VIM-azure && \
56 python3 -m pip install /build/RO-VIM-azure/dist/*.whl
58 RUN python3 -m build /build/RO-SDN-dynpac && \
59 python3 -m pip install /build/RO-SDN-dynpac/dist/*.whl
61 RUN python3 -m build /build/RO-SDN-ietfl2vpn && \
62 python3 -m pip install /build/RO-SDN-ietfl2vpn/dist/*.whl
64 RUN python3 -m build /build/RO-SDN-onos_vpls && \
65 python3 -m pip install /build/RO-SDN-onos_vpls/dist/*.whl
67 RUN python3 -m build /build/RO-SDN-onos_openflow && \
68 python3 -m pip install /build/RO-SDN-onos_openflow/dist/*.whl
70 RUN python3 -m build /build/RO-SDN-odl_openflow && \
71 python3 -m pip install /build/RO-SDN-odl_openflow/dist/*.whl
73 RUN python3 -m build /build/RO-SDN-floodlight_openflow && \
74 python3 -m pip install /build/RO-SDN-floodlight_openflow/dist/*.whl
76 RUN python3 -m build /build/RO-SDN-arista_cloudvision && \
77 python3 -m pip install /build/RO-SDN-arista_cloudvision/dist/*.whl
79 RUN python3 -m build /build/RO-SDN-juniper_contrail && \
80 python3 -m pip install /build/RO-SDN-juniper_contrail/dist/*.whl
82 RUN python3 -m build /build/RO-VIM-gcp && \
83 python3 -m pip install /build/RO-VIM-gcp/dist/*.whl
87 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
88 DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal
90 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
91 COPY --from=INSTALL /usr/local/lib/python3.8/dist-packages /usr/local/lib/python3.8/dist-packages
92 COPY --from=INSTALL /usr/bin/genisoimage /usr/bin/genisoimage
93 COPY --from=INSTALL /etc/protocols /etc/protocols
99 # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers
100 # These ENV must be provided
102 ENV RO_DB_OVIM_HOST=""
103 # if empty RO_DB_HOST is assumed
105 # These ENV should be provided first time for creating database. It will create and init only if empty!
106 ENV RO_DB_ROOT_PASSWORD=""
107 ENV RO_DB_OVIM_ROOT_PASSWORD=""
108 # if empty RO_DB_ROOT_PASSWORD is assumed
110 # These ENV can be provided, but default values are ok
112 ENV RO_DB_OVIM_USER=mano
113 ENV RO_DB_PASSWORD=manopw
114 ENV RO_DB_OVIM_PASSWORD=manopw
116 ENV RO_DB_OVIM_PORT=3306
117 ENV RO_DB_NAME=mano_db
118 ENV RO_DB_OVIM_NAME=mano_vim_db
119 ENV OPENMANO_TENANT=osm
122 ENV OSMRO_DATABASE_DRIVER mongo
123 ENV OSMRO_DATABASE_URI mongodb://mongo:27017
124 # ENV OSMRO_DATABASE_COMMONKEY xxx
125 # ENV OSMRO_DATABASE_USER xxx
126 # ENV OSMRO_DATABASE_PASSWORD xxx
129 ENV OSMRO_MESSAGE_DRIVER kafka
130 ENV OSMRO_MESSAGE_HOST kafka
131 ENV OSMRO_MESSAGE_PORT 9092
134 ENV OSMRO_LOG_LEVEL INFO
136 CMD ["python3", "-u", "-m", "osm_ng_ro.ro_main"]