Fix bug 1442: set SDN target in vim_info for NS VLD
[osm/LCM.git] / Dockerfile.local
1 # Copyright 2018 Telefonica S.A.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #    http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 # implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 FROM ubuntu:18.04
17
18 # Set the working directory to /app
19 WORKDIR /app/LCM
20
21 RUN apt-get update && apt-get install -y curl xz-utils gnupg2 \
22     && apt-get update && apt-get install -y apt-transport-https \
23     && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
24     && echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list \
25     && apt-get update && apt-get install -y kubectl
26
27 RUN curl https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz --output helm-v2.15.2.tar.gz \
28     && tar -zxvf helm-v2.15.2.tar.gz \
29     && mv linux-amd64/helm /usr/local/bin/helm \
30     && rm -r linux-amd64/
31
32 RUN curl https://get.helm.sh/helm-v3.3.4-linux-amd64.tar.gz --output helm-v3.3.4.tar.gz \
33     && tar -zxvf helm-v3.3.4.tar.gz \
34     && mv linux-amd64/helm /usr/local/bin/helm3 \
35     && rm -r linux-amd64/
36
37 RUN curl -L https://launchpad.net/juju/2.7/2.7.6/+download/juju-2.7.6-k8s.tar.xz --output juju-2.7.6-k8s.tar.xz \
38     && tar -xvf juju-2.7.6-k8s.tar.xz \
39     && mv juju /usr/local/bin/juju
40
41 RUN apt-get update && apt-get install -y git tox python3 \
42     python3-pip python3-jinja2 \
43     && python3 -m pip install pip --upgrade  \
44     && python3 -m pip install -U 'PyYAML' 'aiohttp>=2.3.10' flake8
45
46 RUN git -C /app clone https://osm.etsi.org/gerrit/osm/N2VC.git \
47     && python3 -m pip install -e /app/N2VC \
48     && python3 -m pip install -U juju \
49     && apt-get install -y libffi-dev libssl-dev openssh-client
50     # cd N2VC; python3 setup.py develop
51     # cd modules/libjuju; python3 setup.py develop
52
53 RUN git -C /app clone https://osm.etsi.org/gerrit/osm/common.git \
54     && python3 -m pip install -e /app/common
55     #  python3-pymongo python3-yaml pycrypto aiokafka
56
57 RUN python3 -m pip install grpcio-tools grpclib
58
59 RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
60
61
62 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
63       Description="This implements the Life Cicle Management module of OSM" \
64       Version="1.0" \
65       Author="Alfonso Tierno"
66
67 # Used for local storage
68 VOLUME /app/storage
69 # Used for logs
70 VOLUME /app/log
71
72 # The following ENV can be added with "docker run -e xxx' to configure LCM
73 ENV OSMLCM_RO_HOST         ro
74 ENV OSMLCM_RO_PORT         9090
75 ENV OSMLCM_RO_TENANT       osm
76
77 # VCA
78 ENV OSMLCM_VCA_HOST        vca
79 ENV OSMLCM_VCA_PORT        17070
80 ENV OSMLCM_VCA_USER        admin
81 ENV OSMLCM_VCA_SECRET      secret
82 ENV OSMLCM_VCA_CLOUD:      localhost
83 # ENV OSMLCM_VCA_ENABLEOSUPGRADE false
84 # ENV OSMLCM_VCA_APTMIRROR  http://archive.ubuntu.com/ubuntu/
85 # ENV OSMLCM_VCA_PUBKEY     pubkey
86 # ENV OSMLCM_VCA_CACERT     cacert
87
88 # VCA - k8s
89 ENV OSMLCM_VCA_HELMPATH    /usr/local/bin/helm
90 ENV OSMLCM_VCA_KUBECTLPATH /usr/bin/kubectl
91 ENV OSMLCM_VCA_JUJUPATH    /usr/local/bin/juju
92
93 # database
94 ENV OSMLCM_DATABASE_DRIVER mongo
95 ENV OSMLCM_DATABASE_URI mongodb://mongo:27017
96 # ENV OSMLCM_DATABASE_COMMONKEY  xxx
97 # ENV OSMLCM_DATABASE_USER  xxx
98 # ENV OSMLCM_DATABASE_PASSWORD  xxx
99
100 # storage
101 ENV OSMLCM_STORAGE_DRIVER                       local
102 ENV OSMLCM_STORAGE_PATH                         /app/storage
103 # ENV OSMLCM_STORAGE_DRIVER                       mongo
104 # ENV OSMLCM_STORAGE_URI                          mongodb://mongo:27017
105 # ENV OSMLCM_STORAGE_COLLECTION                   files
106
107 # message
108 ENV OSMLCM_MESSAGE_DRIVER  kafka
109 ENV OSMLCM_MESSAGE_HOST    kafka
110 ENV OSMLCM_MESSAGE_PORT    9092
111
112 # tsdb
113 # ENV OSMLCM_TSDB_DRIVER     prometheus
114 # ENV OSMLCM_TSDB_PATH       /etc/prometheus
115 # ENV OSMLCM_TSDB_URI        http://prometheus:9090/
116
117 # logs
118 # ENV OSMLCM_GLOBAL_LOGFILE  /app/log/lcm.log
119 ENV OSMLCM_GLOBAL_LOGLEVEL DEBUG
120
121 # timeouts
122 # ENV OSMLCM_TIMEOUT_NS_DEPLOY 7200
123 # ENV OSMLCM_TIMEOUT_NSI_DEPLOY 7200
124
125 # Copy the current directory contents into the container at /app/LCM
126 ADD . /app/LCM
127
128 # Run app.py when the container launches
129 CMD python3 -m osm_lcm.lcm
130
131 # HEALTHCHECK --start-period=120s --interval=30s --timeout=30s --retries=1 \
132 #   CMD python3 -m osm_lcm.lcm_hc  || exit 1
133