ubuntu-image needs to provide a manifest for the contents of an image

Bug #1680574 reported by Steve Langasek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Image
Fix Released
High
Łukasz Zemczak

Bug Description

To find out which versions of snaps were included in a particular build of an ubuntu-core image, I must:

 - download the image
 - kpartx -a
 - mount /dev/mapper/loop1p2
 - poke around in /var/lib/snapd/snaps

Other images we publish to cdimage.ubuntu.com have manifest files, to tell us at a glance what's in the box. We need ubuntu-image to do the same.

Steve Langasek (vorlon)
Changed in ubuntu-image:
importance: Undecided → High
Revision history for this message
Barry Warsaw (barry) wrote :

$ ubuntu-image -w /tmp/wd pc-amd64.assertion
$ ls /tmp/wd/root/system-data/var/lib/snapd/snaps/
core_1636.snap pc-kernel_60.snap

So that seems like the information you're asking for. I guess a file listing of that directory would be the manifest you want, right? Should we just add a -m/--manifest argument which names a file into which we would write these snap file names?

Changed in ubuntu-image:
milestone: none → 1.1
Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1680574] Re: ubuntu-image needs to provide a manifest for the contents of an image

On Thu, Apr 06, 2017 at 07:26:46PM -0000, Barry Warsaw wrote:
> $ ubuntu-image -w /tmp/wd pc-amd64.assertion
> $ ls /tmp/wd/root/system-data/var/lib/snapd/snaps/
> core_1636.snap pc-kernel_60.snap

> So that seems like the information you're asking for. I guess a file
> listing of that directory would be the manifest you want, right?

That would suffice. It might be nice to do some basic transformations here,
to make the manifest tabular - à la
<http://cdimage.ubuntu.com/ubuntu-base/daily/current/zesty-base-amd64.manifest>.

> Should we just add a -m/--manifest argument which names a file into which
> we would write these snap file names?

I think I would prefer it be written by default to the output dir under a
fixed name (and if not using -O, to write it out as <foo>.manifest alongside
<foo>.img). It's a cheap enough thing to create, and common enough to want,
that I think we should just do it as the sensible default thing instead of
requiring the user to ask for it. If they don't want it, it's a pretty
cheap file to clean up.

Revision history for this message
Barry Warsaw (barry) wrote :

On Apr 07, 2017, at 12:37 AM, Steve Langasek wrote:

>That would suffice. It might be nice to do some basic transformations here,
>to make the manifest tabular - à la

Is this file primarily for human or machine consumption?

>I think I would prefer it be written by default to the output dir under a
>fixed name (and if not using -O, to write it out as <foo>.manifest alongside
><foo>.img). It's a cheap enough thing to create, and common enough to want,
>that I think we should just do it as the sensible default thing instead of
>requiring the user to ask for it. If they don't want it, it's a pretty
>cheap file to clean up.

We can do that. Let's be careful though because the file won't contain a
complete manifest of the image, but only a manifest of the snaps. .svm seems
to be unused-ish (snap version manifest).

https://en.wikipedia.org/wiki/List_of_filename_extensions_(S%E2%80%93Z)#S

% mimetype foo.svm
foo.svm:

Barry Warsaw (barry)
Changed in ubuntu-image:
assignee: nobody → Barry Warsaw (barry)
status: New → In Progress
Revision history for this message
Barry Warsaw (barry) wrote :

Something else to consider: since there's only one rootfs defined, and the snaps will be in that partition, maybe we should just write a single file called 'snap.manifest'

Revision history for this message
Barry Warsaw (barry) wrote :

And I suppose it should look in rootfs/system-data/var/lib/snapd/seeds (which looks like a superset of var/lib/snapd/snaps)?

Revision history for this message
Barry Warsaw (barry) wrote :

How about something to this effect?

$ ubuntu-image -O /tmp/out pc-amd64-model.assertion
$ ls /tmp/out
pc.img seed.manifest snaps.manifest
$ cat /tmp/out/seed.manifest
core 1640
pc 19
pc-kernel 60
$ cat /tmp/out/snaps.manifest
core 1640
pc-kernel 60

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Let me try to pick it up this week.

Changed in ubuntu-image:
assignee: Barry Warsaw (barry) → Łukasz Zemczak (sil2100)
Revision history for this message
Steve Langasek (vorlon) wrote :

On Fri, Apr 07, 2017 at 01:40:10PM -0000, Barry Warsaw wrote:
> On Apr 07, 2017, at 12:37 AM, Steve Langasek wrote:

> >That would suffice. It might be nice to do some basic transformations here,
> >to make the manifest tabular - à la

> Is this file primarily for human or machine consumption?

Human. It would e.g. be published alongside images on cdimage.ubuntu.com,
so we can easily inspect contents of a given image.

On Fri, Apr 07, 2017 at 09:57:16PM -0000, Barry Warsaw wrote:
> How about something to this effect?

> $ ubuntu-image -O /tmp/out pc-amd64-model.assertion
> $ ls /tmp/out
> pc.img seed.manifest snaps.manifest
> $ cat /tmp/out/seed.manifest
> core 1640
> pc 19
> pc-kernel 60
> $ cat /tmp/out/snaps.manifest
> core 1640
> pc-kernel 60

That seems pretty reasonable to me.

Changed in ubuntu-image:
status: In Progress → Fix Committed
Changed in ubuntu-image:
status: Fix Committed → Fix Released
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.