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:22.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
85 RUN python3 -m build /build/RO-SDN-tapi && \
86 python3 -m pip install /build/RO-SDN-tapi/dist/*.whl
90 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
91 DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal
93 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
94 COPY --from=INSTALL /usr/local/lib/python3.10/dist-packages /usr/local/lib/python3.10/dist-packages
95 COPY --from=INSTALL /usr/bin/genisoimage /usr/bin/genisoimage
96 COPY --from=INSTALL /etc/protocols /etc/protocols
102 # Creating the user for the app
103 RUN groupadd -g 1000 appuser && \
104 useradd -u 1000 -g 1000 -d /app appuser && \
105 mkdir -p /app/osm_ro && \
106 mkdir -p /app/storage/kafka && \
108 chown -R appuser:appuser /app
112 # Changing the security context
115 # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers
116 # These ENV must be provided
118 ENV RO_DB_OVIM_HOST=""
119 # if empty RO_DB_HOST is assumed
121 # These ENV should be provided first time for creating database. It will create and init only if empty!
122 ENV RO_DB_ROOT_PASSWORD=""
123 ENV RO_DB_OVIM_ROOT_PASSWORD=""
124 # if empty RO_DB_ROOT_PASSWORD is assumed
126 # These ENV can be provided, but default values are ok
128 ENV RO_DB_OVIM_USER=mano
129 ENV RO_DB_PASSWORD=manopw
130 ENV RO_DB_OVIM_PASSWORD=manopw
132 ENV RO_DB_OVIM_PORT=3306
133 ENV RO_DB_NAME=mano_db
134 ENV RO_DB_OVIM_NAME=mano_vim_db
135 ENV OPENMANO_TENANT=osm
138 ENV OSMRO_DATABASE_DRIVER mongo
139 ENV OSMRO_DATABASE_URI mongodb://mongo:27017
140 # ENV OSMRO_DATABASE_COMMONKEY xxx
141 # ENV OSMRO_DATABASE_USER xxx
142 # ENV OSMRO_DATABASE_PASSWORD xxx
145 ENV OSMRO_MESSAGE_DRIVER kafka
146 ENV OSMRO_MESSAGE_HOST kafka
147 ENV OSMRO_MESSAGE_PORT 9092
150 ENV OSMRO_LOG_LEVEL INFO
152 CMD ["python3", "-u", "-m", "osm_ng_ro.ro_main"]