1bf7757054be55d205057c684c15020efb52f309
[it/test.git] / ric_robot_suite / docker / nanobot / Dockerfile
1 #   Copyright (c) 2019 AT&T Intellectual Property.
2 #   Copyright (c) 2019 Nokia.
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15 FROM python:3-alpine
16
17 MAINTAINER "RIC"
18
19 LABEL name="Docker image for the RIC Robot Testing Framework"
20
21 ENV ROBOT_HOME="/robot"
22 ENV ROBOT_OPTIONS="-T -d /robot/log --console verbose -C off -P /robot/lib/python"
23 ENV KUBECONFIG="/robot/etc/kubernetes-admin-conf"
24 ENV PYTHONPATH="/robot/lib/python"
25 ENV RICPLT_NAMESPACE=ricplatform
26 ENV RICPLT_RELEASE_NAME=ric-full
27 ENV RICPLT_COMPONENTS="appmgr rtmgr dbaas e2mgr e2term"
28
29 RUN  mkdir -p /robot/lib/python
30
31 # ONAP eteutils
32 # we only need a few things from this so we won't install
33 # the whole thing.
34 # we could do this in a builder image but that seems execssive.
35 RUN apk update && apk add git
36 WORKDIR /tmp/
37 RUN git clone -b 3.0.1-ONAP https://gerrit.onap.org/r/testsuite/python-testing-utils.git
38 RUN cp /tmp/python-testing-utils/eteutils/StringTemplater.py /robot/lib/python
39 RUN cp /tmp/python-testing-utils/eteutils/UUID.py /robot/lib/python
40 RUN rm -rf /tmp/python-testing-utils
41 RUN apk del --purge  git
42
43 COPY ric-python-utils/ricutils/*.py /robot/lib/python/
44
45 #
46 # for the nanobot container, we only need a subset of the various support
47 # files/libraries, so we pick and choose what to copy..
48 RUN mkdir /robot/resources
49 COPY robot/resources/json_templater.robot /robot/resources
50 COPY robot/resources/appmgr /robot/resources/appmgr
51 COPY robot/resources/e2mgr /robot/resources/e2mgr
52 COPY robot/resources/e2sim /robot/resources/e2sim
53 COPY robot/resources/e2term /robot/resources/e2term
54 COPY robot/resources/ric /robot/resources/ric
55 COPY robot/resources/rnib /robot/resources/rnib
56 COPY robot/resources/rtmgr /robot/resources/rtmgr
57 COPY robot/resources/xapps /robot/resources/xapps
58 # this will actually be overlaid by the helm chart, but
59 # it's good to have the placeholder.
60 COPY robot/resources/global_properties.robot /robot/resources
61
62 RUN mkdir -p /robot/assets/templates
63 COPY robot/assets/templates/e2mgr_setup_nodeb.template /robot/assets/templates
64 COPY robot/assets/templates/appmgr_create_xapp.template /robot/assets/templates
65
66 RUN pip install UUID
67 RUN pip install kubernetes
68 RUN pip install redis
69 RUN pip install robotframework
70 RUN pip install robotframework-requests
71
72 RUN python -m compileall /robot/lib/python
73
74 CMD ["sleep", "9125d"]