blob: db08a116bd116eeec50afdcf640e87bcc836a7cb [file] [log] [blame]
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -05001FROM ubuntu:16.04
2
azvyagintsevec38a1c2018-12-18 16:10:14 +02003LABEL maintainer="dev@mirantis.com"
4
5ENV DEBIAN_FRONTEND=noninteractive \
6 DEBCONF_NONINTERACTIVE_SEEN=true \
7 LANG=C.UTF-8 \
Hanna Arhipova759e39c2019-05-28 12:38:24 +03008 LANGUAGE=$LANG \
9 PYTEST_REPORT_DIR=/var/lib/validation_artifacts
azvyagintseve67f7352018-12-20 16:11:40 +020010SHELL ["/bin/bash", "-o", "pipefail", "-c"]
azvyagintsevec38a1c2018-12-18 16:10:14 +020011
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -050012USER root
azvyagintseve67f7352018-12-20 16:11:40 +020013ARG UBUNTU_MIRROR_URL="http://archive.ubuntu.com/ubuntu"
Hanna Arhipovaf9a95ca2019-01-30 15:47:00 +020014ARG SL_TEST_REPO='http://gerrit.mcp.mirantis.com/mcp/stacklight-pytest'
15ARG SL_TEST_BRANCH='master'
Hanna Arhipova91dc8152019-07-04 12:43:16 +030016ENV PYTHONHTTPSVERIFY=0
Oleksii Zhurba4ccdbf22018-09-04 21:00:19 -050017
18WORKDIR /var/lib/
Hanna Arhipova55cc1292019-01-08 14:22:18 +020019COPY bin/ /usr/local/bin/
20COPY test_set/ ./
21#
azvyagintseve67f7352018-12-20 16:11:40 +020022RUN set -ex; pushd /etc/apt/ && echo > sources.list && \
23 echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages && \
24 echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes && \
25 echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends && \
26 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial main restricted universe multiverse" >> sources.list && \
27 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-updates main restricted universe multiverse" >> sources.list && \
28 echo "deb [arch=amd64] $UBUNTU_MIRROR_URL xenial-backports main restricted universe multiverse" >> sources.list && \
29 popd ; apt-get update && apt-get upgrade -y && \
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +030030 apt-get install -y build-essential curl git-core iputils-ping libffi-dev libldap2-dev libsasl2-dev libssl-dev patch python-dev python-pip python3-dev python3-pip vim-tiny wget \
Hanna Arhipovaf9a95ca2019-01-30 15:47:00 +020031 python-virtualenv \
32# Enable these packages while porting to Python3 => python3-virtualenv python3-dev \
Hanna Arhipova55cc1292019-01-08 14:22:18 +020033# Due to upstream bug we should use fixed version of pip
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +030034 && python -m pip install --upgrade 'pip==19.3.1' \
Hanna Arhipova55cc1292019-01-08 14:22:18 +020035 # initialize cvp sanity test suite
Hanna Arhipova16e93fb2019-01-23 19:03:01 +020036 && pushd cvp-sanity \
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +030037 && virtualenv --python=python3 venv \
Hanna Arhipova55cc1292019-01-08 14:22:18 +020038 && . venv/bin/activate \
Ekaterina Chernovae32e3f92019-11-12 14:56:03 +030039 && pip3 install -r requirements.txt \
Hanna Arhipova55cc1292019-01-08 14:22:18 +020040 && deactivate \
41 && popd \
42 # initialize cvp spt test suite
Hanna Arhipova16e93fb2019-01-23 19:03:01 +020043 && pushd cvp-spt \
Hanna Arhipovaf9a95ca2019-01-30 15:47:00 +020044 && virtualenv --python=python2 venv \
Hanna Arhipova55cc1292019-01-08 14:22:18 +020045 && . venv/bin/activate \
46 && pip install -r requirements.txt \
47 && deactivate \
Hanna Arhipovaf9a95ca2019-01-30 15:47:00 +020048 && popd \
49 # initialize cvp stacklight test suite
50 && mkdir cvp-stacklight \
51 && pushd cvp-stacklight \
52 && virtualenv --system-site-packages venv \
53 && . venv/bin/activate \
54 && git clone -b $SL_TEST_BRANCH $SL_TEST_REPO \
Hanna Arhipova394f6bc2019-05-31 16:55:56 +030055 && pushd stacklight-pytest \
56 && git log -n1 \
57 && pip install . \
58 && pip install -r requirements.txt \
Hanna Arhipovaf9a95ca2019-01-30 15:47:00 +020059 && deactivate \
Hanna Arhipova394f6bc2019-05-31 16:55:56 +030060 && popd && popd \
azvyagintsevec38a1c2018-12-18 16:10:14 +020061# Cleanup
Hanna Arhipovaf9a95ca2019-01-30 15:47:00 +020062 && apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc && \
azvyagintseve67f7352018-12-20 16:11:40 +020063 apt-get -y autoremove; apt-get -y clean ; rm -rf /root/.cache; rm -rf /var/lib/apt/lists/* && \
Ievgeniia Zadorozhna55261342019-11-11 16:26:28 +030064 rm -rf /tmp/* ; rm -rf /var/tmp/* ; rm -rfv /etc/apt/sources.list.d/* ; echo > /etc/apt/sources.list \
65
66# Download iperf package
67 && wget http://ftp.br.debian.org/debian/pool/main/i/iperf/iperf_2.0.5+dfsg1-2_amd64.deb -O /var/lib/iperf_2.0.5+dfsg1-2_amd64.deb
Hanna Arhipova55cc1292019-01-08 14:22:18 +020068
69ENTRYPOINT ["entrypoint.sh"]
70# docker build --no-cache -t cvp-sanity-checks:test_latest .