diff --git a/charts/compute-utility/templates/bin/_start.sh.tpl b/charts/compute-utility/templates/bin/_start.sh.tpl index a1c9a2f4..5e47a13d 100644 --- a/charts/compute-utility/templates/bin/_start.sh.tpl +++ b/charts/compute-utility/templates/bin/_start.sh.tpl @@ -15,16 +15,6 @@ limitations under the License. set -ex sed -i 's/$PrivDropToUser syslog/$PrivDropToUser nobody/' /etc/rsyslog.conf /etc/init.d/rsyslog start -{{/* -These lines will disable extra handler, extra formatter, extra level to the -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/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 # for readiness probe touch /tmp/done diff --git a/images/compute-utility/Dockerfile.ubuntu_bionic b/images/compute-utility/Dockerfile.ubuntu_bionic index 15cfe519..7c2666b4 100755 --- a/images/compute-utility/Dockerfile.ubuntu_bionic +++ b/images/compute-utility/Dockerfile.ubuntu_bionic @@ -25,9 +25,6 @@ RUN set -xe \ iperf \ jq \ moreutils \ - python3 \ - python3-pip \ - python3-oslo.rootwrap \ radosgw \ rsyslog \ s3cmd \ @@ -35,15 +32,26 @@ RUN set -xe \ sudo \ wget \ xz-utils \ + python3.6 \ + python3-pip \ + && pip3 install \ + oslo.rootwrap==5.8.0 \ && apt-get remove --purge -y wget apt-transport-https \ && apt-get autoremove -y \ - && apt-get clean && rm -rf /var/lib/apt/lists/* \ + && apt-get clean \ && TMP_DIR=$(mktemp --directory) \ && cd ${TMP_DIR} \ && curl -sSLO https://dl.k8s.io/v${KUBE_VERSION}/kubernetes-client-linux-amd64.tar.gz \ && tar --strip-components=1 -zxvf kubernetes-client-linux-amd64.tar.gz \ && mv ${TMP_DIR}/client/bin/kubectl /usr/bin/kubectl \ && chmod +x /usr/bin/kubectl \ - && rm -rf ${TMP_DIR} + && rm -rf \ + ${TMP_DIR} \ + /var/lib/apt/lists/* + +RUN sed -i "/rootwrap_logger.setLevel/s/.*/#&/" /usr/local/lib/python3.6/dist-packages/oslo_rootwrap/wrapper.py \ + && sed -i "/handler.setFormatter/s/.*/#&/" /usr/local/lib/python3.6/dist-packages/oslo_rootwrap/wrapper.py \ + && sed -i "/os.path.basename/s/.*/#&/" /usr/local/lib/python3.6/dist-packages/oslo_rootwrap/wrapper.py \ + && sed -i "/rootwrap_logger.addHandler/s/.*/#&/" /usr/local/lib/python3.6/dist-packages/oslo_rootwrap/wrapper.py CMD ["/bin/bash"]