Google Cloud connector
[osm/RO.git] / Dockerfile.local
1 ############################################################################
2 # Copyright 2021 ETSI
3 #
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
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
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
14 # under the License.
15 ############################################################################
16
17 FROM ubuntu:18.04 as INSTALL
18
19 WORKDIR /build
20
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
26
27 COPY . /build
28
29 RUN git clone https://osm.etsi.org/gerrit/osm/common.git
30
31 RUN python3 -m pip install -r requirements.txt \
32     -r common/requirements.txt
33
34 RUN python3 -m build /build/common && \
35     python3 -m pip install /build/common/dist/*.whl
36
37 RUN python3 -m build /build/RO-plugin && \
38     python3 -m pip install /build/RO-plugin/dist/*.whl
39
40 RUN python3 -m build /build/NG-RO && \
41     python3 -m pip install /build/NG-RO/dist/*.whl
42
43 RUN python3 -m build /build/RO-VIM-vmware && \
44     python3 -m pip install /build/RO-VIM-vmware/dist/*.whl
45
46 RUN python3 -m build /build/RO-VIM-openstack && \
47     python3 -m pip install /build/RO-VIM-openstack/dist/*.whl
48
49 RUN python3 -m build /build/RO-VIM-openvim && \
50     python3 -m pip install /build/RO-VIM-openvim/dist/*.whl
51
52 RUN python3 -m build /build/RO-VIM-aws && \
53     python3 -m pip install /build/RO-VIM-aws/dist/*.whl
54
55 RUN python3 -m build /build/RO-VIM-azure && \
56     python3 -m pip install /build/RO-VIM-azure/dist/*.whl
57
58 RUN python3 -m build /build/RO-VIM-fos && \
59     python3 -m pip install /build/RO-VIM-fos/dist/*.whl
60
61 RUN python3 -m build /build/RO-SDN-dynpac && \
62     python3 -m pip install /build/RO-SDN-dynpac/dist/*.whl
63
64 RUN python3 -m build /build/RO-SDN-ietfl2vpn && \
65     python3 -m pip install /build/RO-SDN-ietfl2vpn/dist/*.whl
66
67 RUN python3 -m build /build/RO-SDN-onos_vpls && \
68     python3 -m pip install /build/RO-SDN-onos_vpls/dist/*.whl
69
70 RUN python3 -m build /build/RO-SDN-onos_openflow && \
71     python3 -m pip install /build/RO-SDN-onos_openflow/dist/*.whl
72
73 RUN python3 -m build /build/RO-SDN-odl_openflow && \
74     python3 -m pip install /build/RO-SDN-odl_openflow/dist/*.whl
75
76 RUN python3 -m build /build/RO-SDN-floodlight_openflow && \
77     python3 -m pip install /build/RO-SDN-floodlight_openflow/dist/*.whl
78
79 RUN python3 -m build /build/RO-SDN-arista_cloudvision && \
80     python3 -m pip install /build/RO-SDN-arista_cloudvision/dist/*.whl
81
82 RUN python3 -m build /build/RO-SDN-juniper_contrail && \
83     python3 -m pip install /build/RO-SDN-juniper_contrail/dist/*.whl
84
85 RUN python3 -m build /build/RO-VIM-gcp && \
86     python3 -m pip install /build/RO-VIM-gcp/dist/*.whl
87
88 FROM ubuntu:18.04
89
90 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
91     DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal
92
93 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
94 COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages  /usr/local/lib/python3.6/dist-packages
95 COPY --from=INSTALL /usr/bin/genisoimage /usr/bin/genisoimage
96 COPY --from=INSTALL /etc/protocols /etc/protocols
97
98 VOLUME /var/log/osm
99
100 EXPOSE 9090
101
102 # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers
103 # These ENV must be provided
104 ENV RO_DB_HOST=""
105 ENV RO_DB_OVIM_HOST=""
106     # if empty RO_DB_HOST is assumed
107
108 # These ENV should be provided first time for creating database. It will create and init only if empty!
109 ENV RO_DB_ROOT_PASSWORD=""
110 ENV RO_DB_OVIM_ROOT_PASSWORD=""
111     # if empty RO_DB_ROOT_PASSWORD is assumed
112
113 # These ENV can be provided, but default values are ok
114 ENV RO_DB_USER=mano
115 ENV RO_DB_OVIM_USER=mano
116 ENV RO_DB_PASSWORD=manopw
117 ENV RO_DB_OVIM_PASSWORD=manopw
118 ENV RO_DB_PORT=3306
119 ENV RO_DB_OVIM_PORT=3306
120 ENV RO_DB_NAME=mano_db
121 ENV RO_DB_OVIM_NAME=mano_vim_db
122 ENV OPENMANO_TENANT=osm
123
124 # database
125 ENV OSMRO_DATABASE_DRIVER mongo
126 ENV OSMRO_DATABASE_URI mongodb://mongo:27017
127 # ENV OSMRO_DATABASE_COMMONKEY  xxx
128 # ENV OSMRO_DATABASE_USER  xxx
129 # ENV OSMRO_DATABASE_PASSWORD  xxx
130
131 # message
132 ENV OSMRO_MESSAGE_DRIVER  kafka
133 ENV OSMRO_MESSAGE_HOST    kafka
134 ENV OSMRO_MESSAGE_PORT    9092
135
136 # logs
137 ENV OSMRO_LOG_LEVEL       INFO
138
139 CMD ["python3", "-u", "-m", "osm_ng_ro.ro_main"]