GlanceMirror item filters are hardcoded

Bug #1339842 reported by Mike McCracken
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
simplestreams
Fix Released
Undecided
Unassigned
simplestreams (Ubuntu)
Fix Released
High
Unassigned

Bug Description

[Impact]
The GlanceMirror class has a hard-coded filter for items to be
downloaded.

Anyone using it directly or via the script in
tools/sstream-mirror-glance to load images into an openstack cloud
will end up with a large number of images, at least one for each of
the available release series, and only x86_64 or amd64.

It is likely that users will want to be able to limit the images they
download to just one release, and may want to be able to download
images for other architectures, such as arm*.

The attached diff simply exposes the existing filter mechanism as a
config option, using the previous hardcoded values as defaults.

This config option is used (currently it is just ignored by the
published simplestreams code) in an charm that is released on the
charm store for trusty, 'glance-simplestreams-sync'. Users of
OpenStack on Trusty are likely to want the option to control image
downloads via that charm.

[Test Case]

In an openstack cloud, with proper openstack env vars (OS_USERNAME,
OS_PASSWORD, OS_REGION etc), run the sstream-mirror-glance tool to
download images locally:

from the source tree top directory,

PYTHONPATH=. tools/sstream-mirror-glance --max=1 -v -v -v --output-dir \
images/ --cloud-name test_cloud --content-id test_content \
--keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
http://cloud-images.ubuntu.com/releases/ streams/v1/index.json

verify that it downloads many images. This may take a while. If you
like, you can just check that it will download an image for an old
series like raring or quantal.

Clean up after it by removing the images/ directory.

Then with the update applied, from the source tree top dir:

PYTHONPATH=. tools/sstream-mirror-glance --max=1 -v -v -v --output-dir \
images/ --cloud-name test_cloud --content-id test_content \
--keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
--item-filter="release=trusty" --item-filter="arch=arm64" \
http://cloud-images.ubuntu.com/releases/ streams/v1/index.json

and verify that it downloads only one matching image, trusty on arm64.

[Regression Potential]

This has very limited regression potential, because anyone relying on
the existing behavior will still get it because the previous behavior
is retained via defaults.

Related branches

Mike McCracken (mikemc)
Changed in simplestreams:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in simplestreams (Ubuntu):
status: New → Confirmed
tags: added: cloud-installer
Changed in simplestreams (Ubuntu):
importance: Undecided → Critical
importance: Critical → High
Revision history for this message
Mike McCracken (mikemc) wrote :

The debdiff posted above is against current source from trusty, 0.1.0~bzr341-0ubuntu1.

Mike McCracken (mikemc)
description: updated
description: updated
Revision history for this message
Adam Stokes (adam-stokes) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Hello Mike, or anyone else affected,

Accepted simplestreams into trusty-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/simplestreams/0.1.0~bzr341-0ubuntu2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Mathew Hodson (mhodson)
Changed in simplestreams (Ubuntu):
status: Confirmed → Fix Committed
Mike McCracken (mikemc)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package simplestreams - 0.1.0~bzr341-0ubuntu2

---------------
simplestreams (0.1.0~bzr341-0ubuntu2) trusty-proposed; urgency=medium

  * debian/patches/1-add-item-filter-to-glancemirror.patch: add
    filter support, expose in sstream-mirror-glance (LP: #1339842)
 -- Michael McCracken <email address hidden> Fri, 11 Jul 2014 13:01:54 -0700

Changed in simplestreams (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for simplestreams has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Scott Moser (smoser) wrote :

it seems that this likely caused bug 1353724

Revision history for this message
Scott Moser (smoser) wrote : Fixed in simplestreams version 0.1.0.

This bug is believed to be fixed in simplestreams in version 0.1.0. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in simplestreams:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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