Initial commit to gerrit repo
[osm/PLA.git] / docker / integrationtest.Dockerfile
1 # Copyright 2020 ArctosLabs Scandinavia AB
2 # *************************************************************
3
4 # This file is part of OSM Placement module
5 # All Rights Reserved to ArctosLabs Scandinavia AB
6
7 # Licensed under the Apache License, Version 2.0 (the "License"); you may
8 # not use this file except in compliance with the License. You may obtain
9 # a copy of the License at
10
11 #         http://www.apache.org/licenses/LICENSE-2.0
12
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 # License for the specific language governing permissions and limitations
17 # under the License.
18 FROM ubuntu:18.04
19
20 LABEL authors="Martin Björklund, Lars-Göran Magnusson"
21
22 RUN apt-get --yes update \
23  && apt-get --yes install git python3 python3-pip libgl1-mesa-glx \ 
24  && pip3 install pip==9.0.3
25
26 COPY requirements.txt /pla/requirements.txt
27
28 RUN pip3 install -r /pla/requirements.txt
29
30 ADD https://github.com/MiniZinc/MiniZincIDE/releases/download/2.3.1/MiniZincIDE-2.3.1-bundle-linux-x86_64.tgz /minizinc.tgz
31 #COPY MiniZincIDE-2.3.1-bundle-linux-x86_64.tgz /minizinc.tgz
32
33 RUN tar -zxf /minizinc.tgz && \
34     mv /MiniZincIDE-2.3.1-bundle-linux /minizinc
35
36 RUN mkdir /entry_data \
37     && mkdir /entry_data/mzn-lib \
38     && ln -s /entry_data/mzn-lib /minizinc/share/minizinc/exec
39
40 COPY . /pla
41
42 RUN pip3 install /pla
43
44 RUN mkdir /placement
45 COPY ./osm_pla/test/pil_price_list.yaml /placement/.
46 COPY ./osm_pla/test/vnf_price_list.yaml /placement/.
47
48 ENV OSMPLA_MESSAGE_DRIVER kafka
49 ENV OSMPLA_MESSAGE_HOST kafka
50 ENV OSMPLA_MESSAGE_PORT 9092
51
52 ENV OSMPLA_DATABASE_DRIVER mongo
53 ENV OSMPLA_DATABASE_URI mongodb://mongo:27017
54
55 ENV OSMPLA_SQL_DATABASE_URI sqlite:///pla_sqlite.db
56 ENV OSMPLA_GLOBAL_REQUEST_TIMEOUT 10
57 ENV OSMPLA_GLOBAL_LOGLEVEL INFO
58 ENV OSMPLA_VCA_HOST localhost
59 ENV OSMPLA_VCA_SECRET secret
60 ENV OSMPLA_VCA_USER admin
61 ENV OSMPLA_DATABASE_COMMONKEY changeme
62
63 ENV FZNEXEC "/entry_data/fzn-exec"
64 ENV PATH "/minizinc/bin:${PATH}"
65 ENV LD_LIBRARY_PATH "/minizinc/lib:${LD_LIBRARY_PATH}"
66
67 EXPOSE 1234
68
69 #HEALTHCHECK --interval=5s --timeout=2s --retries=12 \
70 #  CMD osm-pla-healthcheck || exit 1
71
72 CMD /bin/bash pla/docker/scripts/start.sh
73
74 #WORKDIR /minizinc