Support for additional NR metrics
[ric-app/mc.git] / mc-core / Dockerfile
1 # -------------------------------------------------------------------------------
2 #    Copyright (c) 2018-2019 AT&T Intellectual Property.
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain 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,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15 # -------------------------------------------------------------------------------
16
17 ARG STAGE_DIR=/mc
18
19 FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:7-u18.04 AS project-build
20
21 ARG STAGE_DIR
22
23 ARG RMR_VER=3.7.4
24
25 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb
26 RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb
27 RUN dpkg -i rmr_${RMR_VER}_amd64.deb
28 RUN dpkg -i rmr-dev_${RMR_VER}_amd64.deb
29 RUN ldconfig
30
31 COPY mc ${STAGE_DIR}
32 WORKDIR ${STAGE_DIR}
33 RUN apt-get update && \
34         apt-get install -y libboost-all-dev && \
35         apt-get install -y libhiredis-dev && \
36         apt-get clean
37 RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/sdl
38 WORKDIR ${STAGE_DIR}/sdl
39 RUN ./autogen.sh
40 RUN ./configure
41 RUN make all
42 RUN make install
43 WORKDIR ${STAGE_DIR}
44 RUN git clone https://github.com/protocolbuffers/protobuf.git
45 WORKDIR ${STAGE_DIR}/protobuf
46 RUN ./autogen.sh
47 RUN ./configure
48 RUN make clean
49 RUN make
50 RUN make install
51 RUN ldconfig
52 WORKDIR ${STAGE_DIR}
53 RUN git clone https://github.com/protobuf-c/protobuf-c.git
54 WORKDIR protobuf-c
55 RUN ./autogen.sh
56 ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
57 RUN ./configure
58 RUN make
59 RUN make install
60 RUN ldconfig
61 WORKDIR ${STAGE_DIR}
62 RUN git clone -b release/0.2.0 https://gerrit.o-ran-sc.org/r/com/gs-lite
63 WORKDIR ${STAGE_DIR}/gs-lite
64 COPY mc/cfg/packet_schema.txt ${STAGE_DIR}/gs-lite/cfg/
65 COPY mc/cfg/ifres.xml ${STAGE_DIR}/gs-lite/cfg/
66 COPY mc/cfg/localhost.ifq ${STAGE_DIR}/gs-lite/cfg/
67 COPY mc/local_datasource ${STAGE_DIR}/gs-lite/src/lib/gscprts/local_datasource
68 COPY mc/local ${STAGE_DIR}/gs-lite/include/lfta/local
69 COPY mc/queries ${STAGE_DIR}/gs-lite/demo/queries
70 COPY mc/mcnib/* ${STAGE_DIR}/gs-lite/src/tools/
71 RUN ./build_and_install.sh
72 WORKDIR ${STAGE_DIR}/gs-lite/demo/queries
73 ENV GSLITE_ROOT ${STAGE_DIR}/gs-lite
74 RUN bash ${STAGE_DIR}/gs-lite/bin/buildit
75 RUN python generate_runall.py
76
77
78 # now install the binaries and libraries into smaller docker image
79 FROM nexus3.o-ran-sc.org:10004/o-ran-sc/ric-app-mc-listener:1.5.0
80
81 ARG STAGE_DIR
82
83 COPY --from=project-build ${STAGE_DIR}/gs-lite/demo/queries /mc/gs-lite/demo/queries
84 COPY --from=project-build ${STAGE_DIR}/gs-lite/bin /mc/gs-lite/bin
85 COPY --from=project-build ${STAGE_DIR}/data_gen /mc/data_gen
86 COPY --from=project-build ${STAGE_DIR}/extract_params.py /mc/
87 COPY --from=project-build ${STAGE_DIR}/extract_rmr_port.py /mc/
88 COPY --from=project-build /usr/local/lib/libproto* /usr/local/lib/
89 COPY --from=project-build /usr/local/lib/libsdl* /usr/local/lib/
90
91 WORKDIR /opt/ric/config
92 COPY --from=project-build ${STAGE_DIR}/mc_deployment.json /opt/ric/config/config-file.json
93
94 COPY container_start.sh /playpen/bin/
95
96 RUN apt-get update && \
97     apt-get install -y curl python python-pip libboost-all-dev libhiredis-dev && \
98     apt-get clean
99
100 RUN ldconfig
101 RUN pip install protobuf
102
103 ENV XAPP_DESCRIPTOR_PATH /opt/ric/config/
104 WORKDIR /playpen
105 ENV GSLITE_ROOT /mc/gs-lite
106
107 CMD ["/playpen/bin/container_start.sh"]