azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 1 | FROM ubuntu:16.04 |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 2 | LABEL maintainer="qa@mirantis.com" |
| 3 | |
| 4 | ARG TEMPEST_TAG="mcp/pike" |
| 5 | # Tempest plugins |
| 6 | ARG HORIZON_TAG="mcp/pike" |
Ilya Menkov | bf72514 | 2018-03-05 20:18:01 +0400 | [diff] [blame] | 7 | ARG BARBICAN_TAG="mcp/pike" |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 8 | ARG DESIGNATE_TAG="mcp/pike" |
| 9 | ARG HEAT_TAG="mcp/pike" |
Ilya Menkov | bf72514 | 2018-03-05 20:18:01 +0400 | [diff] [blame] | 10 | ARG IRONIC_TAG="mcp/pike" |
| 11 | ARG MANILA_TAG="mcp/pike" |
| 12 | ARG TELEMETRY_TAG="mcp/pike" |
ibumarskov | 48ca209 | 2018-10-18 13:49:17 +0400 | [diff] [blame] | 13 | ARG PATROLE_TAG="0.4.x" |
| 14 | ARG TUNGSTEN_TAG="0.1.x" |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 15 | # global openstack requirements repo |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 16 | # This is the commit where tempest version is 17.2.0 in u-c |
| 17 | ARG UPPER_CONSTRAINTS_TAG="83b1de74834fbcdbe749e270c29e76cdc28f85d5" |
Oleksii Butenko | 1fed0f0 | 2018-07-27 14:19:14 +0300 | [diff] [blame] | 18 | |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 19 | ENV DEBIAN_FRONTEND=noninteractive \ |
| 20 | DEBCONF_NONINTERACTIVE_SEEN=true \ |
| 21 | LANG=C.UTF-8 \ |
| 22 | LANGUAGE=$LANG |
| 23 | SHELL ["/bin/bash", "-xec"] |
| 24 | USER root |
| 25 | # pre-update |
| 26 | RUN cd /etc/apt/ && echo > sources.list \ |
| 27 | && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> sources.list \ |
| 28 | && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> sources.list \ |
| 29 | && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse" >> sources.list \ |
| 30 | && echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages \ |
| 31 | && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes \ |
| 32 | && echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends \ |
| 33 | && apt-get update && apt-get upgrade -y \ |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 34 | && apt-get install -y vim-tiny git-core python-pip libffi-dev libssl-dev python-dev python3-dev iputils-ping patch openssh-server |
| 35 | |
| 36 | RUN mkdir -p /root/.ssh |
| 37 | COPY bin/ssh/config /root/.ssh/ |
| 38 | COPY bin/ssh/mcp-jenkins.key /root/.ssh/ |
| 39 | RUN chmod 400 /root/.ssh/mcp-jenkins.key |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 40 | |
Maksym Shalamov | a95d720 | 2018-04-19 17:21:19 +0300 | [diff] [blame] | 41 | #Due to upstream bug we should use fixed version of pip |
sgarbuz | 5d5631f | 2018-04-18 13:54:56 +0300 | [diff] [blame] | 42 | RUN pip install -U 'pip==9.0.3' |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 43 | WORKDIR /var/lib/ |
| 44 | # TODO migrate to downstrem mirror? |
| 45 | RUN git clone https://github.com/openstack/requirements.git openstack_requirements && \ |
| 46 | pushd openstack_requirements; git checkout $UPPER_CONSTRAINTS_TAG; popd ; |
| 47 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 48 | RUN sed -i -e 's|tempest===17.2.0|git+ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest@mcp/pike#egg=tempest|g' \ |
Maksym Shalamov | df54d20 | 2018-04-13 16:13:12 +0300 | [diff] [blame] | 49 | /var/lib/openstack_requirements/upper-constraints.txt; |
| 50 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 51 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest-horizon tempest-horizon-plugin; \ |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 52 | pushd tempest-horizon-plugin ; git checkout $HORIZON_TAG; \ |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 53 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \ |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 54 | popd; |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 55 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 56 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/barbican-tempest-plugin && \ |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 57 | pushd barbican-tempest-plugin; git checkout $BARBICAN_TAG; \ |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 58 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \ |
| 59 | popd; |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 60 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 61 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/designate-tempest-plugin && \ |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 62 | pushd designate-tempest-plugin; git checkout $DESIGNATE_TAG; \ |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 63 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \ |
| 64 | popd; |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 65 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 66 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/heat-tempest-plugin && \ |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 67 | pushd heat-tempest-plugin; git checkout $HEAT_TAG; \ |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 68 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \ |
| 69 | popd; |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 70 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 71 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/ironic-tempest-plugin && \ |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 72 | pushd ironic-tempest-plugin; git checkout $IRONIC_TAG; \ |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 73 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \ |
| 74 | popd; |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 75 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 76 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/manila-tempest-plugin && \ |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 77 | pushd manila-tempest-plugin; git checkout $MANILA_TAG; \ |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 78 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \ |
| 79 | popd; |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 80 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 81 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/telemetry-tempest-plugin && \ |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 82 | pushd telemetry-tempest-plugin; git checkout $TELEMETRY_TAG; \ |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 83 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \ |
| 84 | popd; |
| 85 | |
ibumarskov | 86e9adc | 2018-10-18 13:49:17 +0400 | [diff] [blame^] | 86 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/patrole patrole-tempest-plugin ; \ |
| 87 | pushd /var/lib/patrole-tempest-plugin; git checkout $PATROLE_TAG; \ |
| 88 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \ |
| 89 | popd; |
| 90 | |
| 91 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/contrail/tungsten-tempest tungsten-tempest-plugin ; \ |
| 92 | pushd /var/lib/tungsten-tempest-plugin; git checkout $TUNGSTEN_TAG; \ |
| 93 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt . ; \ |
| 94 | popd; |
| 95 | |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 96 | RUN git clone ssh://mcp-jenkins@gerrit.mcp.mirantis.com:29418/packaging/sources/tempest && \ |
sandriichenko | 3b17b48 | 2018-03-20 20:29:31 +0200 | [diff] [blame] | 97 | pushd tempest; git checkout $TEMPEST_TAG; \ |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 98 | pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \ |
| 99 | pip install . ; popd; |
| 100 | |
sandriichenko | 7ec3217 | 2018-03-19 17:21:21 +0200 | [diff] [blame] | 101 | RUN pip install junitxml |
Maksym Shalamov | 6f5e8d9 | 2018-04-12 18:19:09 +0300 | [diff] [blame] | 102 | # Patch junitxml library to include skipped tests in the test report totals header |
| 103 | COPY bin/patches/junitxml_init.patch /tmp/junitxml_init.patch |
| 104 | RUN patch /usr/local/lib/python2.7/dist-packages/junitxml/__init__.py /tmp/junitxml_init.patch |
sandriichenko | 7ec3217 | 2018-03-19 17:21:21 +0200 | [diff] [blame] | 105 | |
Maksym Shalamov | 98189f5 | 2018-04-24 13:36:26 +0300 | [diff] [blame] | 106 | # Patch os_testr library to fix issue ralated with tempest black-list option |
| 107 | COPY bin/patches/regex_builder.patch /tmp/regex_builder.patch |
| 108 | RUN patch /usr/local/lib/python2.7/dist-packages/os_testr/regex_builder.py /tmp/regex_builder.patch |
| 109 | |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 110 | # Cleanup. |
| 111 | RUN apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 \ |
| 112 | ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc |
| 113 | RUN apt-get -y autoremove; apt-get -y clean; |
| 114 | RUN rm -rf /root/.cache |
| 115 | RUN rm -rf /var/lib/apt/lists/* |
sandriichenko | 3ac92e9 | 2018-10-30 15:04:55 +0000 | [diff] [blame] | 116 | RUN rm -rf /root/.ssh |
sandriichenko | 3a043ca | 2018-06-15 11:08:36 +0300 | [diff] [blame] | 117 | |
| 118 | RUN echo "BUILD_TIMESTAMP=$(date '+%Y-%m-%d-%H-%M-%S' -u)" > /etc/build_timestamp |
| 119 | |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 120 | # |
| 121 | COPY bin/entrypoint.sh /usr/bin/entrypoint.sh |
sandriichenko | 7ec3217 | 2018-03-19 17:21:21 +0200 | [diff] [blame] | 122 | COPY bin/run_tempest.sh /usr/bin/run-tempest |
ibumarskov | 48ca209 | 2018-10-18 13:49:17 +0400 | [diff] [blame] | 123 | COPY bin/opencontrail/policy.json /etc/opencontrail/policy.json |
sandriichenko | 7ec3217 | 2018-03-19 17:21:21 +0200 | [diff] [blame] | 124 | |
| 125 | ENV LOG_DIR='/root/tempest' |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 126 | |
Maksym Shalamov | 98189f5 | 2018-04-24 13:36:26 +0300 | [diff] [blame] | 127 | COPY bin/skiplists /var/lib/tempest/skiplists |
| 128 | |
azvyagintsev | f19ddc8 | 2018-02-20 18:39:32 +0200 | [diff] [blame] | 129 | WORKDIR /var/lib/tempest/ |
| 130 | ENTRYPOINT ["/usr/bin/entrypoint.sh"] |
| 131 | |
| 132 | # Build |
Maksym Shalamov | 8d89b89 | 2018-09-03 13:50:48 +0300 | [diff] [blame] | 133 | # docker build -t docker-ci-tempest:$(date "+%Y_%m_%d_%H_%M_%S") . |