Mantic Cloud-Images on amd64 Fail To Preseed Snaps

Bug #2027826 reported by John Chittum
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-images
Fix Released
Undecided
Simon Poirier
livecd-rootfs (Ubuntu)
Invalid
Critical
Unassigned

Bug Description

Starting on June 19th, Mantic Cloud Images (in development) on amd64 are failing to pre-seed snaps provided in Seeds. This is observable by taking any Mantic Cloud Server (not minimal) image and checking if `lxd` is installed.

Troubleshooting steps so far:

1. using `ubuntu-bartender`[0] and local checkouts, I bisected `livecd-rootfs`, starting from commits before June 19th. Unfortunately, due to various other build issues, I was not able to successfully find a commit. Commits <= tag 2.849 fail to build, and commits after fail to have snaps preseeded. More work can be done here to find a successfully building commit (I did not go a back through the entire history, only to tag 2.848)

2. I attempted a revert of tag 2.890 specific code, which landed around the time failures to pre-seed began. Reverting that specific code did not result in fixing the issue.

3. a build and check of the log at `lb_chroot_cache save` will show the issue. in a successful build, the apt cache is updated and snaps are preseeded.

[0] https://github.com/ubuntu-bartenders/ubuntu-old-fashioned

Revision history for this message
Dan Bungert (dbungert) wrote :

In my test, with a revert of livecd-rootfs to before my CHANNEL changes (equivalent of ver 2.849), I see the same results on amd64 (no snaps).

A fix in livecd-rootfs may well be necessary, but I wonder if there isn't also something else going on.

Revision history for this message
Dan Bungert (dbungert) wrote :
Revision history for this message
Dan Bungert (dbungert) wrote :

@John - would you expect lxd to be part of the cloud-image.snaps germinate output?

In this log, with some set -x, https://launchpadlibrarian.net/677345865/buildlog_ubuntu_mantic_amd64_test_BUILDING.txt.gz

config/seeded-snaps appears to be empty. But looking at the seed git history I don't see why this would have changed? I'm confused.

Revision history for this message
Dan Bungert (dbungert) wrote :

I'm not sure what's going on with the build failures when using bartender, I wasn't testing in that way.

As for why the cpc builds stopped on the 19th, I do suspect it was my changes, but Łukasz followed up shortly after with a fix, so I'm not sure why the builds stopped since then.

For LXD being seeded or not, I traced this to livecd-rootfs 2.837.

* passing build log - lxd seeded - with livecd-rootfs 2.836 equivalent + some "set -x"
https://launchpad.net/~dbungert/+livefs/ubuntu/mantic/test/+build/467075/+files/buildlog_ubuntu_mantic_amd64_test_BUILDING.txt.gz

* failing build log - lxd not seeded - with livecd-rootfs 2.837 equivalent + "set -x"
https://launchpad.net/~dbungert/+livefs/ubuntu/mantic/test/+build/467080/+files/buildlog_ubuntu_mantic_amd64_test_BUILDING.txt.gz

As a result of that change, there is a difference in which seed is considered (old considered server, new considered cloud-image), but that difference sounds more correct so I don't want to just revert 2.837.

So for the lxd part of this, I suspect the answer is to seed the lxd snap in cloud-image, but that sounds like a cpc team call.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Re: [Bug 2027826] Re: Mantic Cloud-Images on amd64 Fail To Preseed Snaps

On Sun, 16 Jul 2023 at 03:15, Dan Bungert <email address hidden>
wrote:

> As a result of that change, there is a difference in which seed is
> considered (old considered server, new considered cloud-image), but that
> difference sounds more correct so I don't want to just revert 2.837.
>

Yeah no let's not revert that change please.

> So for the lxd part of this, I suspect the answer is to seed the lxd
> snap in cloud-image, but that sounds like a cpc team call.
>

Alternatively the ubuntu-cpc project could add_task both server and
cloud-image (the cloud-image seed includes ubuntu-server so cloud images
get all the _packages_ from the server seed, but not of course the snaps.
This is a mess, yes).

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
Revision history for this message
John Chittum (jchittum) wrote :

So it sounds like the "correct" move may be to add snaps directly to `cloud-image` seed. It seems the breaking issue is that while a snap can be included in a seed, and germinate does the proper thing, a _metapackage_ produced from a seed does not reference any snaps.

so any snap listed in `server` should also be in `cloud-image` seed, otherwise the snaps will not get populated by germinate.

Simon Poirier (simpoir)
Changed in cloud-images:
assignee: nobody → Simon Poirier (simpoir)
Revision history for this message
Steve Langasek (vorlon) wrote :

On Mon, Jul 24, 2023 at 03:06:15PM -0000, John Chittum wrote:
> So it sounds like the "correct" move may be to add snaps directly to
> `cloud-image` seed.

I think calling 'add_task install cloud-image server' from livecd-rootfs is
better than duplicating the list of snaps between the seeds.

> It seems the breaking issue is that while a snap can
> be included in a seed, and germinate does the proper thing, a
> _metapackage_ produced from a seed does not reference any snaps.

Correct, although by definition "add_task" does not refer to a metapackage,
it refers to a "task". And there is currently no cloud-image metapackage in
the archive.

The cloud-image seed currently refers to the ubuntu-server package as part
of the seed, which is how add_task pulls it in. If we changed the seed pod
to declare the cloud-image seed has a dependency on the server seed, would
that be enough to make the current livecd-rootfs implementation follow it
for snaps?

Revision history for this message
John Chittum (jchittum) wrote :

> The cloud-image seed currently refers to the ubuntu-server package as part
> of the seed, which is how add_task pulls it in. If we changed the seed pod
> to declare the cloud-image seed has a dependency on the server seed, would
> that be enough to make the current livecd-rootfs implementation follow it
> for snaps?

pardon my ignorance, but is that done in the STRUCTURE file? right now we have (snippet)

```
server: standard
server-cloud-minimal:
server-minimal: server-cloud-minimal
server-raspi: server raspi-common
server-ship-live: server-minimal
cloud-image: standard
cloud-minimal: server-cloud-minimal
```

So we'd add the dependency thusly?

```
cloud-image: standard server
```

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

daily lxd images are using a removed kernel.

daily cpc images are not updated because of this bug.

yet livecd-rootfs changes continue to be uploaded and released.

This is not ok, setting block-proposed-mantic on this bug report, to prevent livecd-rootfs migrating with more changes piled onto it, unless this bug is resolved.

tags: added: block-proposed-mantic
Changed in livecd-rootfs (Ubuntu):
importance: Undecided → Critical
tags: added: rls-mm-incoming
tags: removed: rls-mm-incoming
Revision history for this message
Steve Langasek (vorlon) wrote :

> pardon my ignorance, but is that done in the STRUCTURE file?

That was what I had in mind, but the implementation says:

> def getTaskSeeds(task_headers, seedname):
> """Return the list of seeds used to generate a task from this seed.
>
> The list of packages in this task comes from this seed plus any
> other seeds listed in a Task-Seeds header.

So I've committed a change to add Task-Seeds: server to the cloud-image seed.

> setting block-proposed-mantic on this bug report, to prevent livecd-rootfs
> migrating with more changes piled onto it, unless this bug is resolved.

Not an appropriate use of the tag. The tag is for preventing regressions from entering the release pocket. It is not a "stop the line" marker when you want to escalate that a team should prioritize fixing a particular issue, and it also does not mean we will revert any of the already-staged changes in mantic-proposed.

Anyway, the proper fix for this looks to not be in the livecd-rootfs code at all. I'm starting a test build now with the seed change and will report back on the bug.

tags: added: rls-mm-incoming
removed: block-proposed-mantic
Revision history for this message
Steve Langasek (vorlon) wrote :

oh wait, I can't start a test build. Asking CPC to.

Revision history for this message
Simon Poirier (simpoir) wrote :

> pardon my ignorance, but is that done in the STRUCTURE file?
> So we'd add the dependency thusly?
>
> cloud-image: standard server

negative. The structure from germinate output appears completely ignored (except checking its presence) by add_task, and seeds appear to only be expanded if added explicitly. The cloud-image seed depends on ubuntu-server so happens to have most of the seed (minus the snaps) without previously having it added explicitly.

For fixing the current issue, adding the server task where we add cloud-image would do the trick (we almost do it for all archs; see linked branch)

For the longer term, I think it would make sense to actually walk the germinate structure and recursively add tasks. I've tested that but I'm unsure of the implications of such a change, apart from also having minimized point to cloud-minimal instead of cloud-image.

Changed in cloud-images:
status: New → In Progress
Revision history for this message
Simon Poirier (simpoir) wrote :

ACK the seed change does fix the issue for server images, but also breaks minimal (which now has snaps). We'll need to fix those separately.

Simon Poirier (simpoir)
Changed in cloud-images:
status: In Progress → Fix Released
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

On Thu, 27 Jul 2023 at 03:55, Steve Langasek <email address hidden>
wrote:

> > pardon my ignorance, but is that done in the STRUCTURE file?
>
> That was what I had in mind, but the implementation says:
>

Yeah, the STRUCTURE file is actually kind of the opposite of a dependency:
if STRUCTURE says seed2: seed1 then the package list for seed2 will not
include any packages that are in seed1! The use case for this is package
pools on ISOs, for example the declaration

server-ship-live: server-minimal

Means that we do not end up with any packages in the pool that are always
going to be installed in the target system anyway.

I had forgotten / failed to find the task-seed header which was one of the
reasons I hadn't gotten around to replying to this bug!

This is all a big mess yes.

Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

It looks like the change in -proposed is failing autopkgtest which may be preventing other packages from releasing right now[0].

Seems related to minimal builds (as Simon pointed out). Is this being worked on? I don't see a bug for it.

[0] - https://autopkgtest.ubuntu.com/packages/l/livecd-rootfs/mantic/amd64

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I uploaded a change that might have helped but apparently it didn't (see the 23.10.5 upload). I'm looking at it now (and am quite confused!)

Steve Langasek (vorlon)
Changed in livecd-rootfs (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Mitchell Dzurick (mitchdz) wrote :

Thanks for taking a look at the new failures! I don't know much about livecd-rootfs right now, but just wanted to make sure the impact on packages in -proposed is known.

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.