blob: 56b4765d8fbd1ae88627c7c6897c38eb65769d2e [file] [log] [blame]
vlad shkapenyuk31d238a2019-10-29 10:45:09 -04001# -------------------------------------------------------------------------------
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
17ARG STAGE_DIR=/mc
18
E. Scott Daniels3d4b8812021-02-01 11:51:19 -050019FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 AS project-build
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040020
21ARG STAGE_DIR
22
E. Scott Daniels3d4b8812021-02-01 11:51:19 -050023ARG RMR_VER=4.5.2
vlad shkapenyuk50db50e2020-04-15 19:07:44 -040024
vlad shkapenyuk167fe262020-05-19 11:10:52 -040025RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr_${RMR_VER}_amd64.deb/download.deb
26RUN wget -nv --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/rmr-dev_${RMR_VER}_amd64.deb/download.deb
vlad shkapenyuk50db50e2020-04-15 19:07:44 -040027RUN dpkg -i rmr_${RMR_VER}_amd64.deb
28RUN dpkg -i rmr-dev_${RMR_VER}_amd64.deb
29RUN ldconfig
30
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040031COPY mc ${STAGE_DIR}
32WORKDIR ${STAGE_DIR}
vlad shkapenyuk6d6450e2020-05-01 17:36:08 -040033RUN apt-get update && \
34 apt-get install -y libboost-all-dev && \
35 apt-get install -y libhiredis-dev && \
36 apt-get clean
vlad shkapenyuk0eb834e2020-02-20 19:34:50 -050037RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/sdl
38WORKDIR ${STAGE_DIR}/sdl
39RUN ./autogen.sh
40RUN ./configure
41RUN make all
42RUN make install
43WORKDIR ${STAGE_DIR}
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040044RUN git clone https://github.com/protocolbuffers/protobuf.git
45WORKDIR ${STAGE_DIR}/protobuf
46RUN ./autogen.sh
47RUN ./configure
48RUN make clean
49RUN make
50RUN make install
51RUN ldconfig
52WORKDIR ${STAGE_DIR}
53RUN git clone https://github.com/protobuf-c/protobuf-c.git
54WORKDIR protobuf-c
55RUN ./autogen.sh
56ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
57RUN ./configure
58RUN make
59RUN make install
60RUN ldconfig
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040061WORKDIR ${STAGE_DIR}
vlad shkapenyuk1634fd92020-05-29 12:35:05 -040062RUN git clone -b release/0.3.0 https://gerrit.o-ran-sc.org/r/com/gs-lite
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040063WORKDIR ${STAGE_DIR}/gs-lite
vlad shkapenyuk6d6450e2020-05-01 17:36:08 -040064COPY mc/cfg/packet_schema.txt ${STAGE_DIR}/gs-lite/cfg/
65COPY mc/cfg/ifres.xml ${STAGE_DIR}/gs-lite/cfg/
66COPY mc/cfg/localhost.ifq ${STAGE_DIR}/gs-lite/cfg/
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040067COPY mc/local_datasource ${STAGE_DIR}/gs-lite/src/lib/gscprts/local_datasource
68COPY mc/local ${STAGE_DIR}/gs-lite/include/lfta/local
69COPY mc/queries ${STAGE_DIR}/gs-lite/demo/queries
vlad shkapenyuk0eb834e2020-02-20 19:34:50 -050070COPY mc/mcnib/* ${STAGE_DIR}/gs-lite/src/tools/
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040071RUN ./build_and_install.sh
72WORKDIR ${STAGE_DIR}/gs-lite/demo/queries
73ENV GSLITE_ROOT ${STAGE_DIR}/gs-lite
74RUN bash ${STAGE_DIR}/gs-lite/bin/buildit
vlad shkapenyuk0eb834e2020-02-20 19:34:50 -050075RUN python generate_runall.py
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040076
77
78# now install the binaries and libraries into smaller docker image
vlad shkapenyuk0d6fd962020-12-07 18:15:45 -050079FROM nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-mc-listener:1.7.0
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040080
E. Scott Daniels3d4b8812021-02-01 11:51:19 -050081# keep this close to the top to prevent lengthy rebuilds during testing
82RUN apt-get update && \
83 apt-get install -y curl python python-pip libboost-all-dev libhiredis-dev && \
84 apt-get clean
85
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040086ARG STAGE_DIR
87
88COPY --from=project-build ${STAGE_DIR}/gs-lite/demo/queries /mc/gs-lite/demo/queries
89COPY --from=project-build ${STAGE_DIR}/gs-lite/bin /mc/gs-lite/bin
90COPY --from=project-build ${STAGE_DIR}/data_gen /mc/data_gen
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040091COPY --from=project-build ${STAGE_DIR}/extract_params.py /mc/
vlad shkapenyuk50db50e2020-04-15 19:07:44 -040092COPY --from=project-build ${STAGE_DIR}/extract_rmr_port.py /mc/
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040093COPY --from=project-build /usr/local/lib/libproto* /usr/local/lib/
vlad shkapenyuk0eb834e2020-02-20 19:34:50 -050094COPY --from=project-build /usr/local/lib/libsdl* /usr/local/lib/
vlad shkapenyuk31d238a2019-10-29 10:45:09 -040095
vlad shkapenyuk9dbc4262020-03-24 11:46:38 -040096WORKDIR /opt/ric/config
vlad shkapenyuk783f6bf2020-04-06 16:11:36 -040097COPY --from=project-build ${STAGE_DIR}/mc_deployment.json /opt/ric/config/config-file.json
vlad shkapenyuk9dbc4262020-03-24 11:46:38 -040098
E. Scott Daniels7f09b7d2020-02-14 14:27:08 -050099COPY container_start.sh /playpen/bin/
E. Scott Daniels3d4b8812021-02-01 11:51:19 -0500100COPY package/*.py package/*.sh /playpen/bin/
vlad shkapenyuk31d238a2019-10-29 10:45:09 -0400101
102RUN ldconfig
103RUN pip install protobuf
104
vlad shkapenyuk783f6bf2020-04-06 16:11:36 -0400105ENV XAPP_DESCRIPTOR_PATH /opt/ric/config/
E. Scott Daniels7f09b7d2020-02-14 14:27:08 -0500106WORKDIR /playpen
vlad shkapenyuk31d238a2019-10-29 10:45:09 -0400107ENV GSLITE_ROOT /mc/gs-lite
E. Scott Daniels7f09b7d2020-02-14 14:27:08 -0500108
109CMD ["/playpen/bin/container_start.sh"]