From 4530eea7f84446c85b4e04b7cf369c190a947c5d Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 23 Jun 2017 12:45:38 -0700 Subject: [PATCH] Docker image updates for integration tests. (#26054) * Sort packages to install. * Add python-argparse to centos6 docker image. * Add gcc and python dev lib to docker images. * Add python cryptography to docker images. * Add coverage using pip instead of OS packages. * Update old pip versions in docker images. * Exclude */pyshared/* from coverage reporting. --- .coveragerc | 1 + test/utils/docker/centos6/Dockerfile | 4 ++-- test/utils/docker/centos7/Dockerfile | 4 ++-- test/utils/docker/fedora24/Dockerfile | 6 +++--- test/utils/docker/fedora25/Dockerfile | 8 +++++--- test/utils/docker/opensuse42.1/Dockerfile | 3 +-- test/utils/docker/opensuse42.2/Dockerfile | 4 ++-- test/utils/docker/ubuntu1204/Dockerfile | 5 +++-- test/utils/docker/ubuntu1404/Dockerfile | 8 ++++++-- test/utils/docker/ubuntu1604/Dockerfile | 6 ++++-- test/utils/docker/ubuntu1604py3/Dockerfile | 6 ++++-- 11 files changed, 33 insertions(+), 22 deletions(-) diff --git a/.coveragerc b/.coveragerc index f205885c9c9..c8283bab61f 100644 --- a/.coveragerc +++ b/.coveragerc @@ -21,4 +21,5 @@ omit = */python*/dist-packages/* */python*/site-packages/* */python*/distutils/* + */pyshared/* */pytest diff --git a/test/utils/docker/centos6/Dockerfile b/test/utils/docker/centos6/Dockerfile index 6b754ac589e..5bfae387bbd 100644 --- a/test/utils/docker/centos6/Dockerfile +++ b/test/utils/docker/centos6/Dockerfile @@ -19,7 +19,7 @@ RUN yum clean all && \ openssh-clients \ openssh-server \ openssl-devel \ - python-coverage \ + python-argparse \ python-devel \ python-httplib2 \ python-jinja2 \ @@ -56,6 +56,6 @@ RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip install junit-xml +RUN pip install coverage junit-xml ENV container=docker CMD ["/sbin/init"] diff --git a/test/utils/docker/centos7/Dockerfile b/test/utils/docker/centos7/Dockerfile index 922da6eeb37..f4056c38f12 100644 --- a/test/utils/docker/centos7/Dockerfile +++ b/test/utils/docker/centos7/Dockerfile @@ -29,7 +29,7 @@ RUN yum clean all && \ openssh-clients \ openssh-server \ openssl-devel \ - python-coverage \ + python-cryptography \ python-devel \ python-httplib2 \ python-jinja2 \ @@ -63,6 +63,6 @@ RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip install junit-xml +RUN pip install coverage junit-xml ENV container=docker CMD ["/usr/sbin/init"] diff --git a/test/utils/docker/fedora24/Dockerfile b/test/utils/docker/fedora24/Dockerfile index 82306f3d714..de51b664bd5 100644 --- a/test/utils/docker/fedora24/Dockerfile +++ b/test/utils/docker/fedora24/Dockerfile @@ -35,8 +35,7 @@ RUN dnf clean all && \ openssh-server \ openssl-devel \ procps \ - python2-dnf \ - python-coverage \ + python-cryptography \ python-devel \ python-httplib2 \ python-jinja2 \ @@ -49,6 +48,7 @@ RUN dnf clean all && \ python-pip \ python-setuptools \ python-virtualenv \ + python2-dnf \ PyYAML \ rpm-build \ rubygems \ @@ -72,6 +72,6 @@ RUN ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip install junit-xml +RUN pip install coverage junit-xml ENV container=docker CMD ["/usr/sbin/init"] diff --git a/test/utils/docker/fedora25/Dockerfile b/test/utils/docker/fedora25/Dockerfile index dd83ff56feb..a807c6ddf83 100644 --- a/test/utils/docker/fedora25/Dockerfile +++ b/test/utils/docker/fedora25/Dockerfile @@ -17,6 +17,7 @@ RUN dnf clean all && \ dbus-python \ file \ findutils \ + gcc \ git \ glibc-locale-source \ iproute \ @@ -30,8 +31,8 @@ RUN dnf clean all && \ openssh-server \ openssl-devel \ procps \ - python2-dnf \ - python-coverage \ + python-cryptography \ + python-devel \ python-httplib2 \ python-jinja2 \ python-keyczar \ @@ -43,6 +44,7 @@ RUN dnf clean all && \ python-pip \ python-setuptools \ python-virtualenv \ + python2-dnf \ PyYAML \ rpm-build \ rubygems \ @@ -66,6 +68,6 @@ RUN ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip install junit-xml +RUN pip install coverage junit-xml ENV container=docker CMD ["/usr/sbin/init"] diff --git a/test/utils/docker/opensuse42.1/Dockerfile b/test/utils/docker/opensuse42.1/Dockerfile index 82fe949711d..519e2604f9c 100644 --- a/test/utils/docker/opensuse42.1/Dockerfile +++ b/test/utils/docker/opensuse42.1/Dockerfile @@ -20,7 +20,6 @@ RUN zypper --non-interactive --gpg-auto-import-keys refresh && \ mercurial \ openssh \ postgresql-server \ - python-coverage \ python-cryptography \ python-devel \ python-httplib2 \ @@ -72,6 +71,6 @@ RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done # explicitly enable the service, opensuse default to disabled services RUN systemctl enable sshd.service -RUN pip install junit-xml +RUN pip install coverage junit-xml ENV container=docker CMD ["/sbin/init"] diff --git a/test/utils/docker/opensuse42.2/Dockerfile b/test/utils/docker/opensuse42.2/Dockerfile index 14784c0500b..fd013d6673b 100644 --- a/test/utils/docker/opensuse42.2/Dockerfile +++ b/test/utils/docker/opensuse42.2/Dockerfile @@ -20,8 +20,8 @@ RUN zypper --non-interactive --gpg-auto-import-keys refresh && \ mercurial \ openssh \ postgresql-server \ - python-coverage \ python-cryptography \ + python-devel \ python-httplib2 \ python-jinja2 \ python-keyczar \ @@ -71,6 +71,6 @@ RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done # explicitly enable the service, opensuse default to disabled services RUN systemctl enable sshd.service -RUN pip install junit-xml +RUN pip install coverage junit-xml ENV container=docker CMD ["/sbin/init"] diff --git a/test/utils/docker/ubuntu1204/Dockerfile b/test/utils/docker/ubuntu1204/Dockerfile index 706940a7f98..a8c7a6db73f 100644 --- a/test/utils/docker/ubuntu1204/Dockerfile +++ b/test/utils/docker/ubuntu1204/Dockerfile @@ -26,7 +26,6 @@ RUN apt-get update -y && \ mysql-server \ openssh-client \ openssh-server \ - python-coverage \ python-dev \ python-httplib2 \ python-jinja2 \ @@ -55,6 +54,7 @@ RUN apt-get update -y && \ apt-get clean RUN pip install --upgrade pycrypto cryptography + # helpful things taken from the ubuntu-upstart Dockerfile: # https://github.com/tianon/dockerfiles/blob/4d24a12b54b75b3e0904d8a285900d88d3326361/sbin-init/ubuntu/upstart/14.04/Dockerfile ADD init-fake.conf /etc/init/fake-container-events.conf @@ -91,6 +91,7 @@ RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done VOLUME /sys/fs/cgroup /run/lock /run /tmp -RUN pip install junit-xml +RUN pip install pip --upgrade +RUN pip install coverage junit-xml ENV container=docker CMD ["/sbin/init"] diff --git a/test/utils/docker/ubuntu1404/Dockerfile b/test/utils/docker/ubuntu1404/Dockerfile index 5db28ee7f61..4bad078763e 100644 --- a/test/utils/docker/ubuntu1404/Dockerfile +++ b/test/utils/docker/ubuntu1404/Dockerfile @@ -15,6 +15,7 @@ RUN apt-get update -y && \ dpkg-dev \ fakeroot \ gawk \ + gcc \ git \ libffi-dev \ libssl-dev \ @@ -25,7 +26,7 @@ RUN apt-get update -y && \ mysql-server \ openssh-client \ openssh-server \ - python-coverage \ + python-dev \ python-httplib2 \ python-jinja2 \ python-keyczar \ @@ -51,6 +52,8 @@ RUN apt-get update -y && \ && \ apt-get clean +RUN pip install --upgrade pycrypto cryptography + # helpful things taken from the ubuntu-upstart Dockerfile: # https://github.com/tianon/dockerfiles/blob/4d24a12b54b75b3e0904d8a285900d88d3326361/sbin-init/ubuntu/upstart/14.04/Dockerfile ADD init-fake.conf /etc/init/fake-container-events.conf @@ -87,6 +90,7 @@ RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done VOLUME /sys/fs/cgroup /run/lock /run /tmp -RUN pip install junit-xml +RUN pip install pip --upgrade +RUN pip install coverage junit-xml ENV container=docker CMD ["/sbin/init"] diff --git a/test/utils/docker/ubuntu1604/Dockerfile b/test/utils/docker/ubuntu1604/Dockerfile index e7e1ebd6ef9..f4825b37230 100644 --- a/test/utils/docker/ubuntu1604/Dockerfile +++ b/test/utils/docker/ubuntu1604/Dockerfile @@ -15,6 +15,7 @@ RUN apt-get update -y && \ dpkg-dev \ fakeroot \ gawk \ + gcc \ git \ iproute2 \ libffi-dev \ @@ -27,7 +28,8 @@ RUN apt-get update -y && \ mysql-server \ openssh-client \ openssh-server \ - python-coverage \ + python-cryptography \ + python-dev \ python-dbus \ python-httplib2 \ python-jinja2 \ @@ -64,6 +66,6 @@ RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done VOLUME /sys/fs/cgroup /run/lock /run /tmp -RUN pip install junit-xml +RUN pip install coverage junit-xml ENV container=docker CMD ["/sbin/init"] diff --git a/test/utils/docker/ubuntu1604py3/Dockerfile b/test/utils/docker/ubuntu1604py3/Dockerfile index bdab631ca75..98715f924da 100644 --- a/test/utils/docker/ubuntu1604py3/Dockerfile +++ b/test/utils/docker/ubuntu1604py3/Dockerfile @@ -13,6 +13,7 @@ RUN apt-get update -y && \ dpkg-dev \ fakeroot \ gawk \ + gcc \ git \ iproute2 \ libffi-dev \ @@ -24,7 +25,8 @@ RUN apt-get update -y && \ mysql-server \ openssh-client \ openssh-server \ - python3-coverage \ + python3-cryptography \ + python3-dev \ python3-dbus \ python3-httplib2 \ python3-jinja2 \ @@ -60,6 +62,6 @@ RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done VOLUME /sys/fs/cgroup /run/lock /run /tmp -RUN pip3 install junit-xml python3-keyczar +RUN pip3 install coverage junit-xml python3-keyczar ENV container=docker CMD ["/sbin/init"]