| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 1 | ## |
| 2 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | # you may not use this file except in compliance with the License. |
| 4 | # You may obtain a copy of the License at |
| 5 | # |
| 6 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | # |
| 8 | # Unless required by applicable law or agreed to in writing, software |
| 9 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 11 | # implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | ## |
| 15 | |
| 16 | FROM ubuntu:18.04 |
| 17 | |
| 18 | LABEL authors="Alfonso Tierno" |
| 19 | |
| 20 | RUN apt-get update && apt-get install -y git python3 python3-pip \ |
| 21 | && python3 -m pip install --upgrade pip \ |
| lloretgalleg | 17587e3 | 2019-11-25 14:31:18 +0100 | [diff] [blame] | 22 | && DEBIAN_FRONTEND=noninteractive apt-get -y install libssl-dev libmysqlclient-dev mysql-client \ |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 23 | && DEBIAN_FRONTEND=noninteractive python3 -m pip install -U networking-l2gw \ |
| 24 | && DEBIAN_FRONTEND=noninteractive python3 -m pip install -U progressbar pyvmomi pyvcloud==19.1.1 \ |
| 25 | && DEBIAN_FRONTEND=noninteractive apt-get -y install genisoimage |
| 26 | |
| 27 | # This is not needed, because package dependency will install anyway. |
| 28 | # But done here in order to harry up image generation using cache |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 29 | RUN DEBIAN_FRONTEND=noninteractive apt-get -y install python3-neutronclient python3-openstackclient \ |
| tierno | ed502b1 | 2020-04-01 17:08:43 +0000 | [diff] [blame] | 30 | python3-requests python3-netaddr python3-argcomplete \ |
| 31 | && DEBIAN_FRONTEND=noninteractive python3 -m pip install -U jsonrpclib-pelix cvprac \ |
| tierno | f3b9008 | 2020-04-16 14:33:25 +0000 | [diff] [blame] | 32 | "osm-im @ git+https://osm.etsi.org/gerrit/osm/IM.git#egg=osm-im" "azure==4.0.0" boto "fog05rest>=0.0.4" \ |
| tierno | ed502b1 | 2020-04-01 17:08:43 +0000 | [diff] [blame] | 33 | untangle pyone "oca @ git+https://github.com/python-oca/python-oca#egg=oca" |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 34 | |
| 35 | # DEBIAN_FRONTEND=noninteractive apt-get -y install python-openstacksdk python-openstackclient && \ |
| 36 | # TODO py3 DEBIAN_FRONTEND=noninteractive add-apt-repository -y cloud-archive:rocky && apt-get update && apt-get install -y python3-networking-l2gw \ |
| 37 | |
| 38 | # DEBIAN_FRONTEND=noninteractive apt-get -y install python-cffi libssl-dev libffi-dev python-mysqldb && \ |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 39 | # && DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common && \ |
| 40 | # DEBIAN_FRONTEND=noninteractive apt-get -y install wget tox && \ |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 41 | |
| 42 | COPY . /root/RO |
| 43 | |
| 44 | RUN /root/RO/RO/osm_ro/scripts/install-osm-im.sh --develop && \ |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 45 | mkdir -p /var/log/osm && \ |
| 46 | python3 -m pip install -e /root/RO/RO && \ |
| 47 | python3 -m pip install -e /root/RO/RO-client && \ |
| 48 | python3 -m pip install -e /root/RO/RO-VIM-vmware && \ |
| 49 | python3 -m pip install -e /root/RO/RO-VIM-openstack && \ |
| 50 | python3 -m pip install -e /root/RO/RO-VIM-openvim && \ |
| 51 | python3 -m pip install -e /root/RO/RO-VIM-aws && \ |
| lloretgalleg | 17587e3 | 2019-11-25 14:31:18 +0100 | [diff] [blame] | 52 | python3 -m pip install -e /root/RO/RO-VIM-azure && \ |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 53 | python3 -m pip install -e /root/RO/RO-VIM-fos && \ |
| tierno | ed3e4d4 | 2019-10-21 15:31:27 +0000 | [diff] [blame] | 54 | python3 -m pip install -e /root/RO/RO-SDN-dynpac && \ |
| 55 | python3 -m pip install -e /root/RO/RO-SDN-tapi && \ |
| Benjamin Diaz | 949e053 | 2019-12-09 20:12:42 -0300 | [diff] [blame] | 56 | python3 -m pip install -e /root/RO/RO-SDN-onos_vpls && \ |
| tierno | 4126d05 | 2019-12-11 15:30:44 +0000 | [diff] [blame] | 57 | python3 -m pip install -e /root/RO/RO-SDN-onos_openflow && \ |
| tierno | ce1c9c8 | 2020-03-04 20:09:42 +0000 | [diff] [blame] | 58 | python3 -m pip install -e /root/RO/RO-SDN-odl_openflow && \ |
| tierno | 4126d05 | 2019-12-11 15:30:44 +0000 | [diff] [blame] | 59 | python3 -m pip install -e /root/RO/RO-SDN-floodlight_openflow && \ |
| perales | 9c70147 | 2020-01-17 15:55:13 +0100 | [diff] [blame] | 60 | python3 -m pip install -e /root/RO/RO-SDN-arista && \ |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 61 | rm -rf /root/.cache && \ |
| 62 | apt-get clean && \ |
| 63 | rm -rf /var/lib/apt/lists/* |
| 64 | |
| 65 | VOLUME /var/log/osm |
| 66 | |
| 67 | EXPOSE 9090 |
| 68 | |
| 69 | # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers |
| 70 | # These ENV must be provided |
| 71 | # RO_DB_HOST: host of the main |
| 72 | # RO_DB_OVIM_HOST: ... if empty RO_DB_HOST is assumed |
| 73 | # RO_DB_ROOT_PASSWORD: this has to be provided first time for creating database. It will create and init only if empty! |
| 74 | # RO_DB_OVIM_ROOT_PASSWORD: ... if empty RO_DB_ROOT_PASSWORD is assumed |
| 75 | # RO_DB_USER: default value 'mano' |
| 76 | # RO_DB_OVIM_USER: default value 'mano' |
| 77 | # RO_DB_PASSWORD: default value 'manopw' |
| 78 | # RO_DB_OVIM_PASSWORD: default value 'manopw' |
| 79 | # RO_DB_PORT: default value '3306' |
| 80 | # RO_DB_OVIM_PORT: default value '3306' |
| 81 | # RO_DB_NAME: default value 'mano_db' |
| 82 | # RO_DB_OVIM_NAME: default value 'mano_vim_db' |
| 83 | # RO_LOG_FILE: default log to stderr if not defined |
| 84 | |
| 85 | ENV RO_DB_HOST="" \ |
| 86 | RO_DB_OVIM_HOST="" \ |
| 87 | RO_DB_ROOT_PASSWORD="" \ |
| 88 | RO_DB_OVIM_ROOT_PASSWORD="" \ |
| 89 | RO_DB_USER=mano \ |
| 90 | RO_DB_OVIM_USER=mano \ |
| 91 | RO_DB_PASSWORD=manopw \ |
| 92 | RO_DB_OVIM_PASSWORD=manopw \ |
| 93 | RO_DB_PORT=3306 \ |
| 94 | RO_DB_OVIM_PORT=3306 \ |
| 95 | RO_DB_NAME=mano_db \ |
| 96 | RO_DB_OVIM_NAME=mano_vim_db \ |
| 97 | OPENMANO_TENANT=osm \ |
| 98 | RO_LOG_LEVEL=DEBUG |
| 99 | |
| 100 | CMD RO-start.sh |
| 101 | |
| 102 | # HEALTHCHECK --start-period=30s --interval=10s --timeout=5s --retries=12 \ |
| 103 | # CMD curl --silent --fail localhost:9090/openmano/tenants || exit 1 |