Merge ~rafaeldtinoco/ubuntu/+source/cloud-utils:lp1835124 into ubuntu/+source/cloud-utils:ubuntu/disco-devel

Proposed by Rafael David Tinoco
Status: Merged
Merged at revision: b26a5aa7736d4e64c19f66fa563a12808b1c4ebd
Proposed branch: ~rafaeldtinoco/ubuntu/+source/cloud-utils:lp1835124
Merge into: ubuntu/+source/cloud-utils:ubuntu/disco-devel
Diff against target: 200 lines (+168/-0)
5 files modified
debian/changelog (+8/-0)
debian/patches/lp1810857-fix-spelling-error-in-ec2metadata-reservation-id.patch (+33/-0)
debian/patches/lp1835124-growpart-fix-bug-when-file-image-ends-in-a-digit.patch (+53/-0)
debian/patches/lp1836593-fix-race-condition-in-test-growpart.patch (+71/-0)
debian/patches/series (+3/-0)
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Canonical Server Pending
Review via email: mp+370194@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Scott,

I thought these 3 fixes, being straightforward, could be in Disco, at least, as well.

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

@Rafael,

Summary: This is fine, and I have some comments inline below.

Details.
The process you've used here is perfectly acceptable ('B' below). Please forgive my long winded response.

There are basically two paths that ubuntu server team has taken for packaging source management, and I think each are valid.
 A. upstream maintained packaging branches (lp:cloud-utils branches)
  )
 B. git-ubuntu: Ubuntu maintained packaging branches (lp:ubuntu/cloud-utils).

For cloud-init and curtin, the server team has been using 'A' and has tools to
ease that management documented at
https://github.com/CanonicalLtd/uss-tableflip/blob/master/doc/ubuntu_release_process.md
. Please read that doc. 'A' has to allow for uploads that are
done via 'B', so there is a way to "import" uploads to upstream packaging
branches that were done via 'B'. For 'B', an process like 'A' is just unknown
and results in a new imported version by the importer, just as if you'd done an
upload "by hand" to the archive.

Within 'A' there There are basically two options listed there for doing SRU patches. I generally prefer "new upstream snapshot" path as it makes maintenance much simpler. I think that doing a "new upstream snapshot" back into ubuntu/disco should be acceptable to SRU team, changes should be reviewed on merit of change rather than arbitrary numbers or whether or not something was released as a source tarball.

The snapshot backport works *really* well as it has all the metadata from
upstream git to make it "just work" and the tool 'new-upstream-snapshot' knows
enough about Ubuntu packaging to get version numbers and such right.

I think this process works well for packages who consider Ubuntu a "first class citizen". The difference is basically that in this case, upstream (lp:cloud-utils) maintains its *own* packaging branches and does package development on those branches. The ubuntu source (lp:ubuntu/cloud-utils) is just treated as artifacts.

What I suggest is this:
 * cloud-utils use 'A' for ubuntu/devel. The process is just really straight
   forward and the kinks worked out in cloud-init and curtin. If there are uploads outside of cloud-utils then we need to import them into cloud-utils
ubuntu/devel branch.
 * cloud-utils use 'B' for SRUs (as you've done here). At this point that means cloud-utils upstream
   will just be unaware entirely of anything ubuntu line of development other
   than the ubuntu/devel.

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

For your 'debian/patches' files, I think I'd prefer to just use 'git format patch -1 HASH' of the commit you're cherry-picking.

In my understanding, that is a valid dep-3 format.

It also makes it easier, and then you don't have to worry about people nit picking your choice to use bit.ly ;)

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Scott,

Tks a lot for this clarification, really useful. I'll read uss-tableflip. I confess that's new to me and it makes total sense everything you said.

About DEP-3 format, sure. First time I use bit.ly, the http patch pointer was huge =). Let me re-push this to you then.

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

this looks good.

The only comment I have is on the names of your patches/ files.
I think i might have just left them as git wrote them. Again... doing that means you don't have to defend "why did you do that", as you can just blame the author of the patch when they wrote the subject line.

You can fix that, or not.

Do you need me to sponsor upload this?

review: Approve
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Well, since the Subject: inside patches are intact, so you can always find upstream patch if needed, and you don't mind that much, I'd rather point the LP being fixed in the patch name. Of course, like always, those type of things are peculiar to each pkg maintainer and/or sponsor and we usually comply on their request.

If you're good, yes, please, could you sponsor it for me ?

Thanks a lot!

Rafael

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

@Rafael,

I just uploaded b26a5aa7736d4e64c19f66fa563a12808b1c4ebd as upload/0.31-0ubuntu1.1.

Email says:
 [ubuntu/disco-proposed] cloud-utils 0.31-0ubuntu1.1 (Waiting for approval)

I do not know what is the process or if there is one
for me to request a push of a tag for to usd-import-team.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I verified that what was uploaded matches b26a5aa7736d4e64c19f66fa563a12808b1c4ebd, and am pushing an upload tag for it:

$ git push pkg upload/0.31-0ubuntu1.1
Enumerating objects: 26, done.
Counting objects: 100% (26/26), done.
Delta compression using up to 2 threads
Compressing objects: 100% (23/23), done.
Writing objects: 100% (23/23), 4.57 KiB | 1.14 MiB/s, done.
Total 23 (delta 13), reused 0 (delta 0)
To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/cloud-utils
 * [new tag] upload/0.31-0ubuntu1.1 -> upload/0.31-0ubuntu1.1

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Alright, I changed public bug to contain proper SRU template. This only needs sponsoring and the upload for me to verify the SRU before the migration. Thx for the review!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 0054615..80d02dd 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+cloud-utils (0.31-0ubuntu1.1) disco; urgency=medium
7+
8+ * fix race condition in test-growpart teardown seen on ppc64el (LP: #1836593)
9+ * growpart: fix bug when file image ends in a digit (LP: #1835124)
10+ * fix spelling error in ec2metadata (LP: #1810857)
11+
12+ -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Wed, 17 Jul 2019 11:14:34 -0300
13+
14 cloud-utils (0.31-0ubuntu1) disco; urgency=medium
15
16 * debian/tests/control: add test growpart-start-matches-size.
17diff --git a/debian/patches/lp1810857-fix-spelling-error-in-ec2metadata-reservation-id.patch b/debian/patches/lp1810857-fix-spelling-error-in-ec2metadata-reservation-id.patch
18new file mode 100644
19index 0000000..e736e82
20--- /dev/null
21+++ b/debian/patches/lp1810857-fix-spelling-error-in-ec2metadata-reservation-id.patch
22@@ -0,0 +1,33 @@
23+From 7adb670f6a3ac76cedc97ceb5e2c801253864614 Mon Sep 17 00:00:00 2001
24+From: Scott Moser <smoser@brickies.net>
25+Date: Tue, 8 Jan 2019 09:28:54 -0500
26+Subject: [PATCH] Fix spelling error in ec2metadata (--reserveration-id).
27+
28+This just makes ec2metadata correctly take:
29+ --reservation-id
30+rather than the broken
31+ --reserveration-id
32+
33+Thanks to Daniel Serodio for noticing and reporting the bug.
34+
35+LP: #1810857
36+---
37+ bin/ec2metadata | 2 +-
38+ 1 file changed, 1 insertion(+), 1 deletion(-)
39+
40+diff --git a/bin/ec2metadata b/bin/ec2metadata
41+index 9b4b06d..01a42d7 100755
42+--- a/bin/ec2metadata
43++++ b/bin/ec2metadata
44+@@ -86,7 +86,7 @@ METAOPTS = ['ami-id', 'ami-launch-index', 'ami-manifest-path',
45+ 'instance-action', 'instance-id', 'instance-type',
46+ 'local-hostname', 'local-ipv4', 'kernel-id', 'mac',
47+ 'profile', 'product-codes', 'public-hostname', 'public-ipv4',
48+- 'public-keys', 'ramdisk-id', 'reserveration-id', 'security-groups',
49++ 'public-keys', 'ramdisk-id', 'reservation-id', 'security-groups',
50+ 'user-data']
51+
52+ binstdout = os.fdopen(sys.stdout.fileno(), 'wb')
53+--
54+2.22.0
55+
56diff --git a/debian/patches/lp1835124-growpart-fix-bug-when-file-image-ends-in-a-digit.patch b/debian/patches/lp1835124-growpart-fix-bug-when-file-image-ends-in-a-digit.patch
57new file mode 100644
58index 0000000..8b95fdd
59--- /dev/null
60+++ b/debian/patches/lp1835124-growpart-fix-bug-when-file-image-ends-in-a-digit.patch
61@@ -0,0 +1,53 @@
62+From fadd07fed6600764b375ed706e14696a6259c5c7 Mon Sep 17 00:00:00 2001
63+From: Scott Moser <smoser@brickies.net>
64+Date: Wed, 10 Jul 2019 12:20:23 -0400
65+Subject: [PATCH] growpart: Fix bug when file image ends in a digit.
66+
67+If the input to growpart was a file that ended in a digit (my.disk0)
68+then growing partition would fail because sfdisk output will
69+uses a 'p' to delimit the filename and partition name.
70+
71+The fix here is safe/dumb at the cost of a bit of verbosity.
72+
73+LP: #1835124
74+---
75+ bin/growpart | 23 +++++++++++++++--------
76+ 1 file changed, 15 insertions(+), 8 deletions(-)
77+
78+diff --git a/bin/growpart b/bin/growpart
79+index 446f63b..33d27f1 100755
80+--- a/bin/growpart
81++++ b/bin/growpart
82+@@ -264,14 +264,21 @@ resize_sfdisk() {
83+ fail "sed failed on dump output"
84+
85+ dpart="${DISK}${PART}" # disk and partition number
86+- if [ -b "${DISK}p${PART}" -a "${DISK%[0-9]}" != "${DISK}" ]; then
87+- # for block devices that end in a number (/dev/nbd0)
88+- # the partition is "<name>p<partition_number>" (/dev/nbd0p1)
89+- dpart="${DISK}p${PART}"
90+- elif [ "${DISK#/dev/loop[0-9]}" != "${DISK}" ]; then
91+- # for /dev/loop devices, sfdisk output will be <name>p<number>
92+- # format also, even though there is not a device there.
93+- dpart="${DISK}p${PART}"
94++ if [ -b "$DISK" ]; then
95++ if [ -b "${DISK}p${PART}" -a "${DISK%[0-9]}" != "${DISK}" ]; then
96++ # for block devices that end in a number (/dev/nbd0)
97++ # the partition is "<name>p<partition_number>" (/dev/nbd0p1)
98++ dpart="${DISK}p${PART}"
99++ elif [ "${DISK#/dev/loop[0-9]}" != "${DISK}" ]; then
100++ # for /dev/loop devices, sfdisk output will be <name>p<number>
101++ # format also, even though there is not a device there.
102++ dpart="${DISK}p${PART}"
103++ fi
104++ else
105++ case "$DISK" in
106++ # sfdisk for files ending in digit to <disk>p<num>.
107++ *[0-9]) dpart="${DISK}p${PART}";;
108++ esac
109+ fi
110+
111+ pt_start=$(awk '$1 == pt { print $4 }' "pt=${dpart}" <"${dump_mod}") &&
112+--
113+2.22.0
114+
115diff --git a/debian/patches/lp1836593-fix-race-condition-in-test-growpart.patch b/debian/patches/lp1836593-fix-race-condition-in-test-growpart.patch
116new file mode 100644
117index 0000000..04cd429
118--- /dev/null
119+++ b/debian/patches/lp1836593-fix-race-condition-in-test-growpart.patch
120@@ -0,0 +1,71 @@
121+From 51ef36d2281a38a65111995718e8ab85178438e5 Mon Sep 17 00:00:00 2001
122+From: Scott Moser <smoser@brickies.net>
123+Date: Mon, 15 Jul 2019 10:24:47 -0400
124+Subject: [PATCH] Fix race condition in test-growpart teardown seen on ppc64el.
125+
126+The test case 'test-growpart' seemed to have a race condition that
127+would sometimes be seen on the Ubuntu autopkg builder infrastructure.
128+The failure was only seen on ppc64el.
129+
130+The fix here is to use 'udevadm settle' liberally in teardown.
131+I have admittedly not thought this completely through as to what
132+*could* cause this scenario, and 'udevadm settle' often has the same
133+effect as 'sleep 1'. That said, this is just in testcase teardown
134+so there is no harm in making it work even if this is not the fully
135+"proper" fix.
136+
137+Also here is removal of code that was not used in test-growpart-fsimage.
138+There, MP and LODEV were never set, so the removed cleanup would
139+never run.
140+
141+LP: #1836593
142+---
143+ test/test-growpart | 8 +++++++-
144+ test/test-growpart-fsimage | 6 ------
145+ 2 files changed, 7 insertions(+), 7 deletions(-)
146+
147+diff --git a/test/test-growpart b/test/test-growpart
148+index e00b639..6df4b89 100755
149+--- a/test/test-growpart
150++++ b/test/test-growpart
151+@@ -25,13 +25,19 @@ clearparts() {
152+ echo "delpart $LODEV $part"
153+ delpart $LODEV $part
154+ done
155++ udevadm settle
156+ }
157+ cleanup() {
158+- [ -z "$MP" ] || { echo "unmount $MP"; umount "$MP"; }
159++ if [ -z "$MP" ]; then
160++ echo "unmount $MP";
161++ umount "$MP";
162++ udevadm settle
163++ fi
164+ if [ -n "$LODEV" ]; then
165+ clearparts "$LODEV"
166+ echo "losetup --detach $LODEV";
167+ losetup --detach "$LODEV";
168++ udevadm settle
169+ fi
170+ [ ! -d "${TEMP_D}" ] || rm -Rf "${TEMP_D}"
171+ }
172+diff --git a/test/test-growpart-fsimage b/test/test-growpart-fsimage
173+index 39e123c..7d35e73 100755
174+--- a/test/test-growpart-fsimage
175++++ b/test/test-growpart-fsimage
176+@@ -12,12 +12,6 @@ rq() {
177+ }
178+
179+ cleanup() {
180+- [ -z "$MP" ] || { echo "unmount $MP"; umount "$MP"; }
181+- if [ -n "$LODEV" ]; then
182+- clearparts "$LODEV"
183+- echo "losetup --detach $LODEV";
184+- losetup --detach "$LODEV";
185+- fi
186+ [ ! -d "${TEMP_D}" ] || rm -Rf "${TEMP_D}"
187+ }
188+ TEMP_D=$(mktemp -d ${TMPDIR:-/tmp}/${0##*/}.XXXXXX)
189+--
190+2.22.0
191+
192diff --git a/debian/patches/series b/debian/patches/series
193new file mode 100644
194index 0000000..d6f2064
195--- /dev/null
196+++ b/debian/patches/series
197@@ -0,0 +1,3 @@
198+lp1810857-fix-spelling-error-in-ec2metadata-reservation-id.patch
199+lp1835124-growpart-fix-bug-when-file-image-ends-in-a-digit.patch
200+lp1836593-fix-race-condition-in-test-growpart.patch

Subscribers

People subscribed via source and target branches