git source type bloats images

Bug #1657109 reported by Paul Bourke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Invalid
Wishlist
Unassigned

Bug Description

When building source type images from git locations, the '.git' directory from the repo is included in the tarball which bloats the size of the images.

E.g. for nova-base, the image built from tarballs is ~846.1 MB, whereas the same from git is 1.134 GB.

This could be as simple as excluding the .git directory when creating the tarball, however pbr requires this to install the package.

Another solution is to use COPY rather than ADD to skip extracting the tarball into the image, so that it can be extracted, installed, and then removed as part of a single layer during build. This is also not great though as the .git dir does not compress well in a lot of cases.

A solution I've tested that works well is to use 'python setup.py sdist' to create the tarball that gets ADDed to the image. With this, the size of an image created from a git repo is almost identical to that of the tarball build type.

description: updated
Revision history for this message
Steven Dake (sdake) wrote :

Why not just run python setup.py sdist on the host prior to ADD and ADD the source distribution in the container rather then a tarball of the git repository? I think this would work for any type of URI. It does require host processing when building images (which I think the workaround you suggested already does) but would remove git from the base images entirely which would be another win.

Regards
-steve

Changed in kolla:
status: New → Triaged
importance: Undecided → Low
Changed in kolla:
status: Triaged → In Progress
importance: Low → Wishlist
assignee: nobody → Paul Bourke (pauldbourke)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on kolla (master)

Change abandoned by Paul Bourke (pbourke) (<email address hidden>) on branch: master
Review: https://review.openstack.org/421252

Mark Goddard (mgoddard)
Changed in kolla:
status: In Progress → Triaged
assignee: Paul Bourke (pauldbourke) → nobody
Revision history for this message
Michal Nasiadka (mnasiadka) wrote :

I don't think that's valid anymore.

Changed in kolla:
status: Triaged → Invalid
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.