From c8afd0480bccd0370e8c3c532ecd03ead62e1428 Mon Sep 17 00:00:00 2001 From: Prateek Dodda Date: Thu, 5 Dec 2019 12:41:54 -0600 Subject: [PATCH] Openstack UC python and Ubuntu upgrade. This Patchset updated Ubuntu to Bionic and Python from 2.0 to 3.0. Change-Id: Ia87bcb06a2544ed456bf7efebf151e53efe64711 --- .../templates/bin/_start.sh.tpl | 11 ++---- .../utility/_openstack-utility-rootwrap.tpl | 2 +- charts/openstack-utility/values.yaml | 2 +- .../Dockerfile.ubuntu_bionic | 31 +++++++++++++++ .../Dockerfile.ubuntu_xenial | 38 ------------------- zuul.d/openstack-utility.yaml | 2 +- 6 files changed, 38 insertions(+), 48 deletions(-) create mode 100755 images/openstack-utility/Dockerfile.ubuntu_bionic delete mode 100755 images/openstack-utility/Dockerfile.ubuntu_xenial diff --git a/charts/openstack-utility/templates/bin/_start.sh.tpl b/charts/openstack-utility/templates/bin/_start.sh.tpl index 0a1624ff..f53b32d0 100644 --- a/charts/openstack-utility/templates/bin/_start.sh.tpl +++ b/charts/openstack-utility/templates/bin/_start.sh.tpl @@ -23,10 +23,7 @@ root logger by oslo-rootwrap module, imported in _openstack-utility-rootwrap.tpl These lines will get rid of duplicate logs, generated because of the formatter attached by oslo-rootwrap. */}} -sed -i "/rootwrap_logger.setLevel/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py -sed -i "/handler.setFormatter/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py -sed -i "/os.path.basename/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py -sed -i "/rootwrap_logger.addHandler/s/.*/#&/" /usr/lib/python2.7/dist-packages/oslo_rootwrap/wrapper.py - - - +sed -i "/rootwrap_logger.setLevel/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py +sed -i "/handler.setFormatter/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py +sed -i "/os.path.basename/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py +sed -i "/rootwrap_logger.addHandler/s/.*/#&/" /usr/lib/python3/dist-packages/oslo_rootwrap/wrapper.py diff --git a/charts/openstack-utility/templates/bin/utility/_openstack-utility-rootwrap.tpl b/charts/openstack-utility/templates/bin/utility/_openstack-utility-rootwrap.tpl index 3796ed8d..295615ef 100644 --- a/charts/openstack-utility/templates/bin/utility/_openstack-utility-rootwrap.tpl +++ b/charts/openstack-utility/templates/bin/utility/_openstack-utility-rootwrap.tpl @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 {{/* Copyright 2019 The Openstack-Helm Authors. diff --git a/charts/openstack-utility/values.yaml b/charts/openstack-utility/values.yaml index a8fd8ad5..1a066c78 100644 --- a/charts/openstack-utility/values.yaml +++ b/charts/openstack-utility/values.yaml @@ -12,7 +12,7 @@ release_group: null images: pull_policy: IfNotPresent tags: - openstack_utility: 'quay.io/airshipit/porthole-openstack-utility:latest-ubuntu_xenial' + openstack_utility: 'quay.io/airshipit/porthole-openstack-utility:latest-ubuntu_bionic' image_repo_sync: docker.io/docker:18.09.02 local_registry: active: false diff --git a/images/openstack-utility/Dockerfile.ubuntu_bionic b/images/openstack-utility/Dockerfile.ubuntu_bionic new file mode 100755 index 00000000..589133d3 --- /dev/null +++ b/images/openstack-utility/Dockerfile.ubuntu_bionic @@ -0,0 +1,31 @@ +ARG FROM=docker.io/ubuntu:bionic +FROM ${FROM} + +LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \ + org.opencontainers.image.url='https://airshipit.org' \ + org.opencontainers.image.documentation='https://opendev.org/airship/porthole' \ + org.opencontainers.image.source='https://opendev.org/airship/porthole' \ + org.opencontainers.image.vendor='The Airship Authors' \ + org.opencontainers.image.licenses='Apache-2.0' + +ARG DEBIAN_FRONTEND=noninteractive + +RUN set -xe && \ + sed -i '/nobody/d' /etc/passwd && \ + echo "nobody:x:65534:65534:nobody:/nonexistent:/bin/bash" >> /etc/passwd && \ + apt-get update && \ + apt-get install -y \ + bash \ + rsyslog \ + python3 \ + python3-pip \ + python3-oslo.rootwrap \ + python3-openstackclient \ + python3-glanceclient \ + python3-novaclient \ + python3-neutronclient \ + python3-cinderclient && \ + apt-get clean -y && \ + rm -rf /var/lib/apt/lists/* + +CMD ["/bin/bash"] diff --git a/images/openstack-utility/Dockerfile.ubuntu_xenial b/images/openstack-utility/Dockerfile.ubuntu_xenial deleted file mode 100755 index 4ce213ab..00000000 --- a/images/openstack-utility/Dockerfile.ubuntu_xenial +++ /dev/null @@ -1,38 +0,0 @@ -ARG FROM=docker.io/ubuntu:xenial -FROM ${FROM} - -LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \ - org.opencontainers.image.url='https://airshipit.org' \ - org.opencontainers.image.documentation='https://opendev.org/airship/porthole' \ - org.opencontainers.image.source='https://opendev.org/airship/porthole' \ - org.opencontainers.image.vendor='The Airship Authors' \ - org.opencontainers.image.licenses='Apache-2.0' - -RUN set -xe \ - && echo '#!/bin/sh' > /usr/sbin/policy-rc.d \ - && echo 'exit 101' >> /usr/sbin/policy-rc.d \ - && chmod +x /usr/sbin/policy-rc.d \ - && sed -i '/nobody/d' /etc/passwd \ - && echo "nobody:x:65534:65534:nobody:/nonexistent:/bin/bash" >> /etc/passwd \ - && dpkg-divert --local --rename --add /sbin/initctl \ - && cp -a /usr/sbin/policy-rc.d /sbin/initctl \ - && sed -i 's/^exit.*/exit 0/' /sbin/initctl \ - && apt-get update \ - && apt-get install -y \ - bash\ - moreutils \ - sudo \ - rsyslog \ - x11-apps \ - python-oslo.rootwrap \ - python-openstackclient \ - python3-oslo.rootwrap \ - python3-openstackclient \ - python3-glanceclient \ - python3-novaclient \ - python3-neutronclient \ - python3-cinderclient \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -CMD ["/bin/bash"] diff --git a/zuul.d/openstack-utility.yaml b/zuul.d/openstack-utility.yaml index 364a545e..29138dea 100644 --- a/zuul.d/openstack-utility.yaml +++ b/zuul.d/openstack-utility.yaml @@ -17,7 +17,7 @@ parent: &parent airship-porthole-images vars: image_name: &image_name porthole-openstack-utility - distro_suffix: &distro_suffix ubuntu_xenial + distro_suffix: &distro_suffix ubuntu_bionic files: - ^charts/openstack-utility/.*$ - ^images/openstack-utility/.*$