From 8d8c3e7158b06455b31a2317b90cae4488ab59a0 Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Tue, 22 Oct 2019 11:20:14 -0500 Subject: [PATCH] Change image to use python 3 This patch set updates the Dockerfile to use python3 and pip3 instead for all ubuntu images. Change-Id: I20a6f1a28b2adadd66d42907bbec977c28f5a044 Signed-off-by: Tin Lam --- ceph-config-helper/Dockerfile.ubuntu_xenial | 12 ++++++------ ceph-daemon/Dockerfile.ubuntu_xenial | 10 +++++----- mariadb/Dockerfile.ubuntu_xenial | 8 ++++---- openvswitch/Dockerfile.ubuntu_bionic-dpdk | 6 +++--- tempest/Dockerfile.opensuse_15 | 8 ++++---- tempest/Dockerfile.ubuntu_xenial | 19 ++++++++++--------- 6 files changed, 32 insertions(+), 31 deletions(-) diff --git a/ceph-config-helper/Dockerfile.ubuntu_xenial b/ceph-config-helper/Dockerfile.ubuntu_xenial index f3c4de26..8225c176 100644 --- a/ceph-config-helper/Dockerfile.ubuntu_xenial +++ b/ceph-config-helper/Dockerfile.ubuntu_xenial @@ -14,7 +14,7 @@ RUN set -ex ;\ export DEBIAN_FRONTEND=noninteractive ;\ apt-get update ;\ apt-get dist-upgrade -y ;\ - apt-get install -y apt-transport-https ca-certificates ;\ + apt-get install --no-install-recommends -y apt-transport-https ca-certificates ;\ apt-key add /etc/apt/ceph-${CEPH_RELEASE}.key ;\ rm -f /etc/apt/ceph-${CEPH_RELEASE}.key ;\ echo deb ${CEPH_REPO} ${DISTRO_CODENAME} main | tee /etc/apt/sources.list.d/ceph.list ;\ @@ -26,11 +26,11 @@ RUN set -ex ;\ ceph \ curl \ gcc \ - python \ - python-dev \ + python3 \ + python3-dev \ jq ;\ - curl -sSL https://bootstrap.pypa.io/get-pip.py | python ;\ - pip --no-cache-dir install --upgrade \ + curl -sSL https://bootstrap.pypa.io/get-pip.py | python3 ;\ + pip3 --no-cache-dir install --upgrade \ crush \ rgwadmin \ six \ @@ -42,6 +42,6 @@ RUN set -ex ;\ chmod +x /usr/bin/kubectl ;\ rm -rf ${TMP_DIR} ;\ apt-get purge -y --auto-remove \ - python-dev \ + python3-dev \ gcc ;\ rm -rf /var/lib/apt/lists/* diff --git a/ceph-daemon/Dockerfile.ubuntu_xenial b/ceph-daemon/Dockerfile.ubuntu_xenial index 968f9aef..73f987fb 100644 --- a/ceph-daemon/Dockerfile.ubuntu_xenial +++ b/ceph-daemon/Dockerfile.ubuntu_xenial @@ -47,13 +47,13 @@ RUN set -ex ;\ curl \ gcc \ gdb \ - python \ - python-dev \ + python3 \ + python3-dev \ uuid-runtime \ jq \ alien ;\ - curl -sSL https://bootstrap.pypa.io/get-pip.py | python ;\ - pip --no-cache-dir install --upgrade \ + curl -sSL https://bootstrap.pypa.io/get-pip.py | python3 ;\ + pip3 --no-cache-dir install --upgrade \ six \ python-openstackclient \ python-swiftclient ;\ @@ -73,7 +73,7 @@ RUN set -ex ;\ mkdir -p /etc/confd/templates ;\ rm -rf ${TMP_DIR} ;\ apt-get purge -y --auto-remove \ - python-dev \ + python3-dev \ gcc ;\ rm -rf /var/lib/apt/lists/* ;\ rm -rf /usr/share/doc/ ;\ diff --git a/mariadb/Dockerfile.ubuntu_xenial b/mariadb/Dockerfile.ubuntu_xenial index d73dc634..38a13bb8 100644 --- a/mariadb/Dockerfile.ubuntu_xenial +++ b/mariadb/Dockerfile.ubuntu_xenial @@ -5,11 +5,11 @@ RUN set -ex ;\ apt-get update ;\ apt-get upgrade -y ;\ apt-get install -y --no-install-recommends \ - python-pip ;\ - pip --no-cache-dir install --upgrade pip ;\ + python3-pip ;\ + pip3 --no-cache-dir install --upgrade pip ;\ hash -r ;\ - pip --no-cache-dir install --upgrade setuptools ;\ - pip --no-cache-dir install --upgrade \ + pip3 --no-cache-dir install --upgrade setuptools ;\ + pip3 --no-cache-dir install --upgrade \ configparser \ iso8601 \ kubernetes ;\ diff --git a/openvswitch/Dockerfile.ubuntu_bionic-dpdk b/openvswitch/Dockerfile.ubuntu_bionic-dpdk index 129c7589..7c2eba46 100644 --- a/openvswitch/Dockerfile.ubuntu_bionic-dpdk +++ b/openvswitch/Dockerfile.ubuntu_bionic-dpdk @@ -116,7 +116,7 @@ RUN set -ex;\ apt-get install -y openvswitch-switch-dpdk ;\ update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk ;\ fi ;\ - apt-get install -y iproute2 tcpdump conntrack ;\ - apt-get install -y python python-dev python-pip ;\ - pip install ovs netifaces ;\ + apt-get install --no-install-recommends -y iproute2 tcpdump conntrack ;\ + apt-get install --no-install-recommends -y python3 python3-dev python3-pip python3-setuptools ;\ + pip3 --no-cache-dir install ovs netifaces ;\ rm -rf /var/lib/apt/lists/* ;\ diff --git a/tempest/Dockerfile.opensuse_15 b/tempest/Dockerfile.opensuse_15 index 0b0d209c..a0a5a0cb 100644 --- a/tempest/Dockerfile.opensuse_15 +++ b/tempest/Dockerfile.opensuse_15 @@ -13,8 +13,8 @@ RUN set -ex ;\ zypper --non-interactive refresh ;\ zypper --non-interactive up -y ;\ zypper --non-interactive install -y openstack-tempest \ - python-cinder-tempest-plugin \ - python-heat-tempest-plugin \ - python-keystone-tempest-plugin \ - python-neutron-tempest-plugin ;\ + python3-cinder-tempest-plugin \ + python3-heat-tempest-plugin \ + python3-keystone-tempest-plugin \ + python3-neutron-tempest-plugin ;\ zypper --non-interactive clean -a diff --git a/tempest/Dockerfile.ubuntu_xenial b/tempest/Dockerfile.ubuntu_xenial index 2a3e3c8f..b6e13066 100644 --- a/tempest/Dockerfile.ubuntu_xenial +++ b/tempest/Dockerfile.ubuntu_xenial @@ -6,19 +6,20 @@ RUN set -ex ;\ apt-get upgrade -y ;\ apt-get install netbase -y ;\ apt-get install --no-install-recommends -y \ - python-dev \ + python3-dev \ build-essential \ - python-pip \ + python3-pip \ + libssl-dev \ git ;\ git clone https://git.openstack.org/openstack/tempest ;\ git clone https://git.openstack.org/openstack/cinder-tempest-plugin ;\ git clone https://git.openstack.org/openstack/heat-tempest-plugin ;\ git clone https://git.openstack.org/openstack/keystone-tempest-plugin ;\ git clone https://git.openstack.org/openstack/neutron-tempest-plugin ;\ - pip install -U setuptools ;\ - pip install wheel ;\ - pip install -e tempest/ \ - cinder-tempest-plugin/ \ - heat-tempest-plugin/ \ - keystone-tempest-plugin/ \ - neutron-tempest-plugin/ ;\ + pip3 install -U setuptools ;\ + pip3 install wheel ;\ + pip3 install -e tempest/ \ + cinder-tempest-plugin/ \ + heat-tempest-plugin/ \ + keystone-tempest-plugin/ \ + neutron-tempest-plugin/ ;\