1 # Copyright (c) 2019 AT&T Intellectual Property.
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-alpine AS nanobot-build
17 RUN apk update && apk add git build-base libffi-dev libxml2 libxslt libxml2-dev libxslt-dev openssl-dev
20 RUN pip install kubernetes
22 RUN pip install asyncio
23 RUN pip install websockets
24 RUN pip install robotframework
25 RUN pip install robotframework-requests
26 RUN pip install robotframework-ncclient
29 RUN git clone -b 3.0.1-ONAP https://gerrit.onap.org/r/testsuite/python-testing-utils.git
33 LABEL name="Docker image for the RIC Robot Testing Framework"
35 ENV ROBOT_HOME="/robot"
36 ENV ROBOT_OPTIONS="-T -d /robot/log --console verbose -C off -P /robot/lib/python"
37 ENV KUBECONFIG="/robot/etc/kubernetes-admin-conf"
38 ENV PYTHONPATH="/robot/lib/python"
39 ENV RICPLT_NAMESPACE=ricplt
40 ENV RICPLT_RELEASE_NAME=ric-full
41 ENV RICPLT_COMPONENTS="a1mediator appmgr dbaas e2mgr e2term rtmgr"
43 RUN apk update && apk add libxslt
44 COPY --from=nanobot-build /usr/local/lib/python3.8 /usr/local/lib/python3.8
45 COPY --from=nanobot-build /usr/local/bin/robot /usr/local/bin
47 RUN mkdir -p /robot/lib/python
50 # we only need a few things from this so we won't install the whole thing.
51 COPY --from=nanobot-build /tmp/python-testing-utils/eteutils/StringTemplater.py /robot/lib/python
52 COPY --from=nanobot-build /tmp/python-testing-utils/eteutils/UUID.py /robot/lib/python
53 COPY ric-python-utils/ricutils/*.py /robot/lib/python/
56 # for the nanobot container, we only need a subset of the various support
57 # files/libraries, so we pick and choose what to copy..
58 RUN mkdir /robot/resources
59 COPY robot/resources/json_templater.robot /robot/resources
60 COPY robot/resources/appmgr /robot/resources/appmgr
61 COPY robot/resources/dashboard /robot/resources/dashboard
62 COPY robot/resources/e2mgr /robot/resources/e2mgr
63 COPY robot/resources/e2sim /robot/resources/e2sim
64 COPY robot/resources/e2term /robot/resources/e2term
65 COPY robot/resources/o1mediator /robot/resources/o1mediator
66 COPY robot/resources/ric /robot/resources/ric
67 COPY robot/resources/rnib /robot/resources/rnib
68 COPY robot/resources/rtmgr /robot/resources/rtmgr
69 COPY robot/resources/xapps /robot/resources/xapps
70 # this will actually be overlaid by the helm chart, but
71 # it's good to have the placeholder.
72 COPY robot/resources/global_properties.robot /robot/resources
74 RUN mkdir -p /robot/assets/templates
75 COPY robot/assets/templates/e2mgr_setup_nodeb.template /robot/assets/templates
77 RUN python -m compileall /robot/lib/python
81 CMD ["sleep", "9125d"]