ARG STAGE_DIR=/mc
FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu16-c-go:3-u16.04-nng AS project-build
+
# Update & installation of linux packages
RUN apt-get update -y && \
apt-get install -y curl && \
ENV GSLITE_ROOT ${STAGE_DIR}/gs-lite
RUN bash ${STAGE_DIR}/gs-lite/bin/buildit
+# Update & installation of linux packages
+RUN apt-get update -y && \
+ apt-get install -y curl && \
+ apt-get install -y procps && \
+ apt-get install -y python-pip
# now install the binaries and libraries into smaller docker image
-FROM ubuntu:16.04
+# use the mc_listener container as the base; all of it's stuff is in /playpen and can
+# stay where it is
+#
+FROM nexus3.o-ran-sc.org:10004/o-ran-sc/ric-app-mc-listener:1.3.2
ARG STAGE_DIR
COPY --from=project-build ${STAGE_DIR}/extract_params.py /mc/
COPY --from=project-build /usr/local/lib/libproto* /usr/local/lib/
+COPY container_start.sh /playpen/bin/
+
RUN apt-get update && \
apt-get install -y curl python python-pip && \
apt-get clean
RUN pip install protobuf
ENV XAPP_DESCRIPTOR_PATH /mc/mc_deployment.json
-WORKDIR /mc/gs-lite/demo/queries
+WORKDIR /playpen
ENV GSLITE_ROOT /mc/gs-lite
-CMD ["./runall"]
+
+CMD ["/playpen/bin/container_start.sh"]
--- /dev/null
+#!/usr/bin/env bash
+# vim: ts=4 sw=4 noet:
+#----------------------------------------------------------------------------------
+#
+# Copyright (c) 2018-2020 AT&T Intellectual Property.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+#---------------------------------------------------------------------------------
+
+
+# ----------------------------------------------------------------------
+# Mnemonic: container_start.sh
+# Abstract: For some "pod" environments a single container is required.
+# This starts all of the related processes which normally would
+# be started in individual containers.
+#
+# There are two environment variables which affect the operation
+# of this script:
+# USE_NNG -- if set to !0 then the NNG version of the listener
+# is started; undefined or when 0 then the SI95
+# version is used.
+#
+# GSLITE_ROOT -- Assumed to be the root directory for the
+# core MC xAPP. If not defined, /mc/gs-lite is
+# assumed.
+#
+# Date: 13 February 2019
+# Author: E. Scott Daniels
+# ----------------------------------------------------------------------
+
+set -e
+
+SIMULATOR_MODE=`python /mc/extract_params.py $XAPP_DESCRIPTOR_PATH simulator_mode`
+
+if [ "$SIMULATOR_MODE" != "true" ]
+then
+# --- start "sidecars" first. They are expected to need /playpen as the working dir
+
+(
+ cd /playpen
+ if (( $USE_NNG )) || [[ ! -f bin/mc_listener_si ]] # we really want the si version unless forced
+ then
+ bin/mc_listener
+ else
+ bin/mc_listener_si
+ fi
+) >/tmp/listener.std 2>&1 &
+
+echo "listener was started" >&2
+
+fi
+
+# ---- finally, start the core MC application -----------------------------
+cd ${GSLITE_ROOT:-/mc/gs-lite}/demo/queries
+./runall
+
+