1 # Copyright (c) 2019 AT&T Intellectual Property.
2 # Copyright (c) 2020 HCL Technologies.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 FROM python:3.8-alpine AS nanobot-build
17 RUN apk update && apk add git build-base libffi-dev libxml2 libxslt libxml2-dev libxslt-dev openssl-dev
18 RUN apk update && apk add git gcc linux-headers libc-dev cmake pkgconfig make
21 RUN pip install kubernetes
23 RUN pip install asyncio
24 RUN pip install websockets
25 RUN pip install robotframework
26 RUN pip install robotframework-requests
27 RUN pip install robotframework-ncclient
30 RUN git clone -b 3.0.1-ONAP https://gerrit.onap.org/r/testsuite/python-testing-utils.git
34 RUN pip install msgpack
35 RUN python3 -m pip install ricsdl
37 RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.19.2/bin/linux/amd64/kubectl
38 RUN chmod +x ./kubectl
39 RUN mv ./kubectl /usr/local/bin/kubectl
42 RUN apk add cmake git gcc
44 RUN git clone https://gerrit.o-ran-sc.org/r/ric-plt/lib/rmr && \
48 cmake -DPACK_EXTERNALS=1 -DDEV_PKG=1 .. && \
51 RUN cp /rmr/build/src/support/rmr_probe /opt/e2/
55 FROM python:3.8-alpine
57 LABEL name="Docker image for the RIC Robot Testing Framework"
59 ENV ROBOT_HOME="/robot"
60 ENV ROBOT_OPTIONS="-T -d /robot/log --console verbose -C off -P /robot/lib/python"
61 ENV KUBECONFIG="/robot/etc/kubernetes-admin-conf"
62 ENV PYTHONPATH="/robot/lib/python"
63 ENV RICPLT_NAMESPACE=ricplt
64 ENV RICPLT_RELEASE_NAME=ric-full
65 ENV RICPLT_COMPONENTS="a1mediator appmgr dbaas e2mgr e2term rtmgr"
66 ENV DBAAS_SERVICE_HOST=service-ricplt-dbaas-tcp.ricplt.svc.cluster.local
67 ENV DBAAS_SERVICE_PORT=6379
68 RUN apk update && apk add libxslt
69 COPY --from=nanobot-build /usr/local/lib/python3.8 /usr/local/lib/python3.8
70 COPY --from=nanobot-build /usr/local/bin/robot /usr/local/bin
73 RUN mkdir -p /robot/lib/python
74 WORKDIR ric-python-utils/ricutils
75 RUN wget -o SDLWrapper.py "https://gerrit.o-ran-sc.org/r/gitweb?p=ric-plt/xapp-frame-py.git;a=blob_plain;f=ricxappframe/xapp_sdl.py"
77 # we only need a few things from this so we won't install the whole thing.
78 COPY --from=nanobot-build /tmp/python-testing-utils/eteutils/StringTemplater.py /robot/lib/python
79 COPY --from=nanobot-build /tmp/python-testing-utils/eteutils/UUID.py /robot/lib/python
80 COPY ric-python-utils/ricutils/*.py /robot/lib/python/
83 # for the nanobot container, we only need a subset of the various support
84 # files/libraries, so we pick and choose what to copy..
85 RUN mkdir /robot/resources
86 COPY robot/resources/json_templater.robot /robot/resources
87 COPY robot/resources/a1mediator /robot/resources/a1mediator
88 COPY robot/resources/appmgr /robot/resources/appmgr
89 COPY robot/resources/dashboard /robot/resources/dashboard
90 COPY robot/resources/e2mgr /robot/resources/e2mgr
91 COPY robot/resources/e2sim /robot/resources/e2sim
92 COPY robot/resources/e2term /robot/resources/e2term
93 COPY robot/resources/o1mediator /robot/resources/o1mediator
94 COPY robot/resources/ric /robot/resources/ric
95 COPY robot/resources/rnib /robot/resources/rnib
96 COPY robot/resources/rtmgr /robot/resources/rtmgr
97 COPY robot/resources/xapps /robot/resources/xapps
98 # this will actually be overlaid by the helm chart, but
99 # it's good to have the placeholder.
100 COPY robot/resources/global_properties.robot /robot/resources
102 RUN mkdir -p /robot/assets/templates
103 COPY robot/assets/templates/e2mgr_setup_nodeb.template /robot/assets/templates
105 RUN python -m compileall /robot/lib/python
108 CMD ["sleep", "9125d"]