Enable pre-caching of snaps in a classic chroot

Bug #1646881 reported by Dan Watkins
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-images
New
Undecided
Unassigned
snapd
Incomplete
Low
Unassigned
livecd-rootfs (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

We have been asked to pre-cache certain snaps in to images that we publish to Certified Public Cloud partners, to (potentially) reduce the amount of download required to get started using snaps.

We build the images using an un-booted chroot, so we would need to be able to do this without a running systemd/snapd.

Tags: cpc
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm marking this as confirmed/low. Please escalate if this is still a requirement.

affects: snappy → snapd
Changed in snapd:
status: New → Triaged
importance: Undecided → Low
Zygmunt Krynicki (zyga)
Changed in snapd:
status: Triaged → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

This is critcal for adoption of snaps in installer media and all the cloud images, and was expected to be delivered this cycle.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

We have seeded snaps, but we also need pre-verified snaps such that first boot seeding/verification (the time consuming stages) are skipped.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Ok, taking on IRC.

I'm now not sure if this ticket is about being able to pre-seed snaps (which we can do now)

vs

pre-seed snaps being fast to be useful (ie. pre-verified for fast first-boot experience).

I guee reporter / CPC should clarify.

Changed in snapd:
status: Confirmed → Incomplete
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Or is it meant to be "the idea that some snaps would install quickly because we would ship the .snap on the image, just uninstalled until explicitly asked for (not via seeding)"

Revision history for this message
Dan Watkins (oddbloke) wrote :

This was filed with #5 as the intent. AFAIK, there is no priority on this.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

So one can do this today by:

"""
Populating /var/lib/snapd/cache, with a filename equal to the hex of the sha3 sum of the file
"""

I guess if we really want to implement this, changes are needed to the snap-tool in the livecd-rootfs.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

14:38:41 <Chipaca> xnox: so, the cache will remove any snaps from the cache if there are more than 5 files in the cache that are not used elsewhere
14:38:56 <Chipaca> it determines the 'used elsewhere' thing by looking at the hard link count
14:39:17 <xnox> Chipaca: we could hard link them into seed directory, without mentioning them in the seed.yaml

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

The answer is:
base64.urlsafe_b64encode(binascii.unhexlify(s))

where s, is the sha3 header responce from the store, which is available to the snap-tool.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
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.