dbafdb0b6eeb6e7526aba2a9ec887ab3bbbe8e43
[it/test.git] / ric_robot_suite / docker / nanobot / Dockerfile
1 #   Copyright (c) 2019 AT&T Intellectual Property.
2 #
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
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
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.
14
15 FROM python:3-alpine AS nanobot-build
16
17 RUN apk update && apk add git build-base libffi-dev libxml2 libxslt libxml2-dev libxslt-dev openssl-dev
18
19 RUN pip install UUID
20 RUN pip install kubernetes
21 RUN pip install redis
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
27
28 WORKDIR /tmp/
29 RUN git clone -b 3.0.1-ONAP https://gerrit.onap.org/r/testsuite/python-testing-utils.git
30
31 FROM python:3-alpine
32 MAINTAINER "RIC"
33 LABEL name="Docker image for the RIC Robot Testing Framework"
34
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"
42
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
46
47 RUN  mkdir -p /robot/lib/python
48
49 # ONAP eteutils
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/
54
55 #
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/a1mediator /robot/resources/a1mediator
61 COPY robot/resources/appmgr /robot/resources/appmgr
62 COPY robot/resources/dashboard /robot/resources/dashboard
63 COPY robot/resources/e2mgr /robot/resources/e2mgr
64 COPY robot/resources/e2sim /robot/resources/e2sim
65 COPY robot/resources/e2term /robot/resources/e2term
66 COPY robot/resources/o1mediator /robot/resources/o1mediator
67 COPY robot/resources/ric /robot/resources/ric
68 COPY robot/resources/rnib /robot/resources/rnib
69 COPY robot/resources/rtmgr /robot/resources/rtmgr
70 COPY robot/resources/xapps /robot/resources/xapps
71 # this will actually be overlaid by the helm chart, but
72 # it's good to have the placeholder.
73 COPY robot/resources/global_properties.robot /robot/resources
74
75 RUN mkdir -p /robot/assets/templates
76 COPY robot/assets/templates/e2mgr_setup_nodeb.template /robot/assets/templates
77
78 RUN python -m compileall /robot/lib/python
79
80 WORKDIR /
81
82 CMD ["sleep", "9125d"]