-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: ubuntu-image 2.0 compatibility fixes #11073
Conversation
We actually want EXTRA_FUNDAMENTAL to be word split as it may contain multiple arguments, see a related failure when preparing core 20: + mv core20.snap /home/image/core20.snap + EXTRA_FUNDAMENTAL='--extra-snaps /home/image/pc-kernel_*.snap --snap /home/image/core20.snap' + /snap/bin/ubuntu-image snap -w /home/image /home/image/pc.model --channel edge '--extra-snaps /home/image/pc-kernel_*.snap --snap /home/image/core20.snap' --extra-snaps /home/image/snapd_2.53.2+git628.g35bb479-dirty_amd64.snap --output /home/image/core20-amd64.img Error: unknown flag `extra-snaps /home/image/pc-kernel_*.snap --snap /home/image/core20.snap' ----- Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Codecov Report
@@ Coverage Diff @@
## master #11073 +/- ##
==========================================
- Coverage 78.37% 78.35% -0.02%
==========================================
Files 922 923 +1
Lines 105128 105335 +207
==========================================
+ Hits 82389 82537 +148
- Misses 17609 17659 +50
- Partials 5130 5139 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tx
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but AIUI we also still want ubuntu-image 1.11 because the new go based one is not working with uc18 at least for some reason
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
seems some tests are still unhappy, this PR is still using candidate which is 2.0 AIUI |
Yes, that's intended, a fix using latest/stable landed in master. This branch reverts back to candidate and add bits for compatibility |
ah okay thanks for clarifying I was confused if this branch was meant to fix master or not |
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
We also need to run nested tests with the new ubuntu-image, some of these will fail as discussed, since ubuntu-image will not be built with the fakestore test keys built into it. The suggestion for now was just to rebuild the ubuntu-image snap for these tests in order to inject the keys. |
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
this one looks like it's intentional |
And someone in the forum had a similar problem? https://forum.snapcraft.io/t/cannot-build-image-error-preparing-image-cannot-override-channels-add-devmode-snaps-local-snaps-or-extra-snaps-with-a-model-of-grade-higher-than-dangerous/27836 |
FWIW I suspect the problem with ubuntu-image is because it was not built with testkeys, thus assertions signed by testrootorg/developer1 would be rejected. |
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
I've pushed patches that build ubuntu-image from Go source with |
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, only concern I have is following main git branch which is probably as close as we can get to following the "bleeding edge" of ubuntu-image, but I think it's probably fine for now and we can think about a better risk management strategy for ubuntu-image later on (maybe we could download/install the snap from beta/candidate and check what git commit that was built with and use that as our base?)
spread.yaml
Outdated
( | ||
export GO111MODULE=off | ||
# use go get so that ubuntu-image is built with current snapd sources | ||
go get github.com/canonical/ubuntu-image/cmd/ubuntu-image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be nice to fetch a specific tag/branch/etc rather than just pulling straight from main, but not sure what is appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are tags which correspond to ubuntu-image package versions, eg. 2.1+22.04ubuntu2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I saw those, they are not great in that we would need to keep constantly bumping them I think given the tags are for the development release and it seems unlikely there will be constant SRU's for the package into jammy after it's released given that there is the snap and most people will consume it through the snap I think.
ca-certificates were outdated on those hosts, thus go getting ubuntu-image failed https certificate checks failed Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Turns out we cannot universally use ubuntu-image built directly from Go, as it runs |
Since the host mkfs.ext4 is too old and does not support -d option. Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
There may be byte differences in size, so use swapon --show which uses rounded numbers in the output. Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
97f9f8b
to
355ed0e
Compare
# use swapon as it rounds up the numbers nicely | ||
retry -n 60 --wait 1 bash -c "swapon --show | MATCH '\s+file\s+200M\s'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this related to ubuntu-image ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for some reason there were byte size changes here (204796 -> 204784, 3 pages?). I suspect this can be caused by a different fs configuration, as looking at /usr/bin/mkswapfile the could should do the right and create 200MB sized file using fallocate and then runs mkswap on that. OTOH swapon --show correctly reports 200M size in both cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm interesting, but sure makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, wondering why the swap changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, added a minor question.
if os.query is-core16; then | ||
# the new ubuntu-image expects mkfs to support -d option, which was not | ||
# supported yet by the version of mkfs that shipped with Ubuntu 16.04 | ||
snap install ubuntu-image --channel="$UBUNTU_IMAGE_SNAP_CHANNEL" --classic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should define (and export) the UBUNTU_IMAGE
variable at this point, since we currently define it in two places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would have to be a separate helper in one of the scripts, just exporting it here would not make it availble in other shell fragments. OTOH maybe we could pull a trick and symlink to the right one, but that sounds like a followup material anyway.
We actually want EXTRA_FUNDAMENTAL to be word split as it may contain multiple
arguments, see a related failure when preparing core 20: