Report: Add comparison soak vs ndr
[csit.git] / resources / tools / testbed-setup / ansible / roles / csit_sut_image / files / Dockerfile
1 # Copyright (c) 2020 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 FROM ubuntu:18.04
15 LABEL Description="CSIT vpp-device ubuntu 18.04 SUT image"
16 LABEL Version="master"
17
18 # Setup the environment
19 ENV DEBIAN_FRONTEND=noninteractive
20 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
21 ENV NOTVISIBLE "in users profile"
22 ENV VPP_PYTHON_PREFIX=/var/cache/vpp/python
23
24 # Install packages and Docker
25 RUN apt-get -q update \
26  && apt-get install -y -qq \
27         # general tools
28         apt-transport-https \
29         bridge-utils \
30         cloud-init \
31         curl \
32         gdb \
33         locales \
34         net-tools \
35         openssh-server \
36         pciutils \
37         rsyslog \
38         software-properties-common \
39         ssh \
40         sudo \
41         supervisor \
42         tar \
43         vim \
44         wget \
45         # csit requirements
46         cmake \
47         dkms \
48         gfortran \
49         libblas-dev \
50         libffi-dev \
51         liblapack-dev \
52         libpcap-dev \
53         libssl-dev \
54         python-all \
55         python-apt \
56         python-cffi \
57         python-cffi-backend \
58         python-dev \
59         python-enum34 \
60         python-pip \
61         python-setuptools \
62         python-virtualenv \
63         python3-all \
64         python3-apt \
65         python3-cffi \
66         python3-cffi-backend \
67         python3-dev \
68         python3-pip \
69         python3-setuptools \
70         python3-virtualenv \
71         qemu-system \
72         socat \
73         strongswan \
74         unzip \
75         tcpdump \
76         zlib1g-dev \
77         # vpp requirements
78         ca-certificates \
79         libapr1 \
80         libmbedcrypto1 \
81         libmbedtls10 \
82         libmbedx509-0 \
83         libnuma1 \
84         sshpass \
85  && curl -L https://packagecloud.io/fdio/master/gpgkey | sudo apt-key add - \
86  && curl -s https://packagecloud.io/install/repositories/fdio/master/script.deb.sh | sudo bash \
87  # temp hack due to build.sh
88  && apt-get install -y -qq vpp-ext-deps \
89  && curl -fsSL https://get.docker.com | sh \
90  && rm -rf /var/lib/apt/lists/*
91
92 # Configure locales
93 RUN locale-gen en_US.UTF-8 \
94  && dpkg-reconfigure locales
95
96 # Fix permissions
97 RUN chown root:syslog /var/log \
98  && chmod 755 /etc/default
99
100 # Create directory structure
101 RUN mkdir -p /tmp/dumps \
102  && mkdir -p /var/cache/vpp/python \
103  && mkdir -p /var/run/sshd
104
105 # CSIT PIP pre-cache
106 RUN pip3 install \
107         ecdsa==0.13.3 \
108         paramiko==2.6.0 \
109         pycrypto==2.6.1 \
110         pypcap==1.2.3 \
111         PyYAML==5.1.1 \
112         requests==2.22.0 \
113         robotframework==3.1.2 \
114         scapy==2.4.3 \
115         scp==0.13.2 \
116         ansible==2.7.8 \
117         dill==0.2.8.2 \
118         numpy==1.17.3 \
119         hdrhistogram==0.6.1 \
120         plotly==4.1.1 \
121         PTable==0.9.2 \
122         Sphinx==2.2.1 \
123         sphinx-rtd-theme==0.4.0 \
124         sphinxcontrib-programoutput==0.15 \
125         sphinxcontrib-robotdoc==0.11.0 \
126         alabaster==0.7.12 \
127         Babel==2.7.0 \
128         bcrypt==3.1.7 \
129         certifi==2019.9.11 \
130         cffi==1.13.2 \
131         chardet==3.0.4 \
132         cryptography==2.8 \
133         docutils==0.15.2 \
134         future==0.18.2 \
135         idna==2.8 \
136         imagesize==1.1.0 \
137         Jinja2==2.10.3 \
138         MarkupSafe==1.1.1 \
139         packaging==19.2 \
140         pbr==5.4.3 \
141         pycparser==2.19 \
142         Pygments==2.4.2 \
143         PyNaCl==1.3.0 \
144         pyparsing==2.4.4 \
145         python-dateutil==2.8.1 \
146         pytz==2019.3 \
147         retrying==1.3.3 \
148         six==1.13.0 \
149         snowballstemmer==2.0.0 \
150         sphinxcontrib-applehelp==1.0.1 \
151         sphinxcontrib-devhelp==1.0.1 \
152         sphinxcontrib-htmlhelp==1.0.2 \
153         sphinxcontrib-jsmath==1.0.1 \
154         sphinxcontrib-qthelp==1.0.2 \
155         sphinxcontrib-serializinghtml==1.1.3 \
156         urllib3==1.25.6
157
158 # ARM workaround
159 RUN pip3 install \
160         pandas==0.25.3 \
161         scipy==1.1.0
162
163 # SSH settings
164 RUN echo 'root:Csit1234' | chpasswd \
165  && sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
166  && sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd \
167  && echo "export VISIBLE=now" >> /etc/profile
168
169 EXPOSE 2222
170
171 COPY supervisord.conf /etc/supervisor/supervisord.conf
172
173 CMD ["sh", "-c", "rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api; /usr/bin/supervisord -c /etc/supervisor/supervisord.conf; /usr/sbin/sshd -D -p 2222"]