]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
container: stop deleting python generated files 61733/head
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 8 Feb 2025 20:03:32 +0000 (15:03 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 8 Feb 2025 20:08:50 +0000 (15:08 -0500)
Stop deleting the python generated files (pyc, pyo) that RPM packages
have installed. At some point in the misty past someone thought it would
be a good idea to remove these. This practice got carried over to the
new in-tree Containerfile. IMO this is probably due to a thought to save
space, but if that's the case then the RPMs should not be carrying them
either. Plus, not having them is going to slow python down as it needs
to compile every py file that gets loaded. Let's be consistent: if the
RPMs have pyc and pyo files then they should be in the image - if
they're bad or too big they should not be in the RPMs either, right?

This has the pleasant side effect of making `rpm -Va` inside the image
happier.

Fixes: https://tracker.ceph.com/issues/69869
Signed-off-by: John Mulligan <jmulligan@redhat.com>
container/Containerfile

index 5fe9880267add039a483b94257dba8ca57fb31ce..de4a82cac38460558f34a8b9d388830ac35ca556 100644 (file)
@@ -211,8 +211,6 @@ RUN set -ex && \
     rm -f /var/lib/rpm/__db* && \
     # remove unnecessary files with big impact
     rm -rf /etc/selinux /usr/share/selinux && \
-    # don't keep compiled python binaries
-    find / -xdev \( -name "*.pyc" -o -name "*.pyo" \) -delete && \
     rm -f /etc/yum.repos.d/{ceph,ganesha,tcmu-runner,ceph-iscsi}.repo
 
 # Verify that the packages installed haven't been accidentally cleaned, then