Moving RMR message reciver into go routine
[ric-plt/a1.git] / a1-go / Dockerfile
index be0eafb..1a4cfec 100644 (file)
 
 #-----------------------------------------------------------
 
-FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu18-c-go:1.9.0 AS a1-build
+FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.1.0 AS a1-build
+
+
+#TODO check why defualt golang is not working
+ARG GOVERSION="1.18.5"
+RUN wget -nv https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz \
+     && tar -xf go${GOVERSION}.linux-amd64.tar.gz \
+     && mv go /opt/go/${GOVERSION} \
+     && rm -f go*.gz
+
+
+ENV DEFAULTPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ENV PATH=$DEFAULTPATH:/usr/local/go/bin:/opt/go/${GOVERSION}/bin:/root/go/bin
 
 RUN apt-get update -y && apt-get install -y jq
 
@@ -24,6 +36,18 @@ RUN apt update && apt install --reinstall -y \
   && \
   update-ca-certificates
 
+#Install RMR
+
+ARG RMR_VER=4.8.3
+ARG RMR_PKG_URL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/
+
+RUN wget -nv --content-disposition ${RMR_PKG_URL}/rmr_${RMR_VER}_amd64.deb/download.deb
+RUN wget -nv --content-disposition ${RMR_PKG_URL}/rmr-dev_${RMR_VER}_amd64.deb/download.deb
+RUN    dpkg -i rmr_${RMR_VER}_amd64.deb  \
+        && dpkg -i rmr-dev_${RMR_VER}_amd64.deb \
+        && ldconfig
+
+
 ENV PATH="/usr/local/go/bin:${PATH}"
 
 ENV GOPATH="/go"
@@ -40,12 +64,20 @@ RUN GO111MODULE=on go mod download
 # build and test
 COPY . /go/src/ws
 
+COPY  ./config/uta_rtg.rt /opt/a1-mediator/
+
+ENV RMR_RTG_SVC=-1
+ENV RMR_LOG_VLEVEL=5
+ENV CFG_FILE=/opt/a1-mediator/config-file.json
+ENV RMR_SEED_RT=/opt/a1-mediator/uta_rtg.rt
+
 # Build the code
 RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/src/ws/cache/go/cmd/a1 cmd/a1.go
 
 # Run unit tests
 RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/resthooks/
 RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/a1/
+RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/policyManager
 
 RUN gofmt -l $(find cmd/ pkg/  -name '*.go' -not -name '*_test.go')
 
@@ -56,9 +88,20 @@ CMD ["/bin/bash"]
 FROM ubuntu:18.04 as a1-mediator
 
 RUN apt-get update -y \
-    && apt-get install --reinstall -y sudo openssl ca-certificates ca-cacert \
+    && apt-get install --reinstall -y sudo openssl ca-certificates ca-cacert wget\
     && apt-get clean && update-ca-certificates
 
+#Install RMR
+
+ARG RMR_VER=4.8.3
+ARG RMR_PKG_URL=https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/
+
+RUN wget -nv --content-disposition ${RMR_PKG_URL}/rmr_${RMR_VER}_amd64.deb/download.deb
+RUN wget -nv --content-disposition ${RMR_PKG_URL}/rmr-dev_${RMR_VER}_amd64.deb/download.deb
+RUN    dpkg -i rmr_${RMR_VER}_amd64.deb  \
+        && dpkg -i rmr-dev_${RMR_VER}_amd64.deb \
+        && ldconfig
+
 #
 # a1-mediator
 #