Bug 968804

Summary: beaker-provision image cache assumes images never change
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: lab controllerAssignee: Amit Saha <asaha>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.12CC: aigao, asaha, bpeck, dcallagh, ebaak, jingwang, llim, qwan, rmancy
Target Milestone: 0.15   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-03 02:30:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2013-05-30 02:44:50 UTC
The beaker-provision daemon has an optional image cache (IMAGE_CACHE=True) which keeps the 20 most recently used initrd+kernel images in /var/lib/tftpboot/cached-images. It was originally intended for the case where distros were imported from a slow or distant mirror, and re-fetching images frequently would be a waste of time and bandwidth.

The cache makes the assumption that images in a distro tree will never change, and so it makes no attempt to revalidate them when it reuses a cached image. However there are some cases where a distro tree *can* change in place, for example the Fedora development tree.

The cache was never enabled in our production Beaker instance, and I'm not aware of any other sites that are using it either. So it might be possible to just remove the cache support entirely.

Comment 1 Dan Callaghan 2013-05-30 02:55:40 UTC
Steps to reproduce:
1. Set IMAGE_CACHE=True in /etc/beaker/labcontroller.conf
2. Provision a distro tree on box.example.com
3. Observe that /var/lib/tftpboot/images/box.example.com/{initrd,vmlinuz} are created and also hard-linked under /var/lib/tftpboot/cached-images/
4. Wait for the images to change on the distro mirror
5. Provision the distro tree again
6. Observe that /var/lib/tftpboot/images/box.example.com/{initrd,vmlinuz} are the same files as before and have not been updated

Comment 3 Amit Saha 2013-08-12 04:18:31 UTC
(In reply to Dan Callaghan from comment #0)
> The beaker-provision daemon has an optional image cache (IMAGE_CACHE=True)
> which keeps the 20 most recently used initrd+kernel images in
> /var/lib/tftpboot/cached-images. It was originally intended for the case
> where distros were imported from a slow or distant mirror, and re-fetching
> images frequently would be a waste of time and bandwidth.
> 
> The cache makes the assumption that images in a distro tree will never
> change, and so it makes no attempt to revalidate them when it reuses a
> cached image. However there are some cases where a distro tree *can* change
> in place, for example the Fedora development tree.
> 
> The cache was never enabled in our production Beaker instance, and I'm not
> aware of any other sites that are using it either. So it might be possible
> to just remove the cache support entirely.

The cache support will be removed entirely.

Comment 4 Amit Saha 2013-08-12 05:32:33 UTC
On gerrit: http://gerrit.beaker-project.org/#/c/2158/

Comment 8 Nick Coghlan 2013-10-03 02:30:04 UTC
Beaker 0.15 has been released.