CentOS base images have a layer with unnecessary /var/yum/cache

Bug #1850036 reported by Mark Goddard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Undecided
Radosław Piliszek

Bug Description

Since https://review.opendev.org/#/c/682600/, the following lines result in /var/yum/cache being present in one of the layers of the base image:

RUN {{ macros.install_packages(base_centos_yum_repo_packages | customizable("centos_yum_repo_packages"), chain=True, clean=False) }} \
{% for repo in base_centos_yum_repos_to_disable | customizable('centos_yum_repos_to_disable') -%}
    && yum-config-manager --disable {{ repo }} \
{% endfor -%}
{% for key in base_centos_yum_repo_keys | customizable('centos_yum_repo_keys') -%}
    && rpm --import {{ key }} \
{% endfor -%}
    && /bin/true

{% block base_centos_repo_overrides_post_yum %}{% endblock %}

RUN {{ macros.rpm_security_update(clean_package_cache) }}

This is because is it not cleaned in the first RUN statement. This adds 76MB to the image. Also, using two separate RUNs which results in an extra 23MB due to updates to /var/lib/rpm/Packages.

Found via https://github.com/wagoodman/dive.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

Fix proposed to branch: master
Review: https://review.opendev.org/691512

Changed in kolla:
assignee: nobody → Mark Goddard (mgoddard)
status: New → In Progress
Revision history for this message
Radosław Piliszek (yoctozepto) wrote :

Ah, yeah. Missed the layering aspect. Good catch.

We should really think about the build-from-outside approach in the long run.

Changed in kolla:
assignee: Mark Goddard (mgoddard) → Radosław Piliszek (yoctozepto)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.opendev.org/691512
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=fe00a87ec8e6257ad1724b342b70811c03117b58
Submitter: Zuul
Branch: master

commit fe00a87ec8e6257ad1724b342b70811c03117b58
Author: Mark Goddard <email address hidden>
Date: Sun Oct 27 11:43:01 2019 +0000

    Remove /var/yum/cache from CentOS base image

    Since https://review.opendev.org/#/c/682600/, the following lines result
    in /var/yum/cache being present in one of the layers of the base image:

    RUN {{ macros.install_packages(base_centos_yum_repo_packages |
            customizable("centos_yum_repo_packages"), chain=True,
            clean=False) }} \
    {% for repo in base_centos_yum_repos_to_disable |
        customizable('centos_yum_repos_to_disable') -%}
            && yum-config-manager --disable {{ repo }} \
    {% endfor -%}
    {% for key in base_centos_yum_repo_keys |
        customizable('centos_yum_repo_keys') -%}
            && rpm --import {{ key }} \
    {% endfor -%}
        && /bin/true

    {% block base_centos_repo_overrides_post_yum %}{% endblock %}

    RUN {{ macros.rpm_security_update(clean_package_cache) }}

    This is because it is not cleaned in the first RUN statement. This adds
    76MB to the image. Also, using two separate RUNs which results in an
    extra 23MB due to updates to /var/lib/rpm/Packages.

    Found via https://github.com/wagoodman/dive.

    Change-Id: I0302ee1dfc10a2b7df127ac6a7764a84b1d74a33
    Closes-Bug: #1850036

Changed in kolla:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla 9.0.0.0rc1

This issue was fixed in the openstack/kolla 9.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.