Merge autopkgtest-cloud:lxd-container into autopkgtest-cloud:master

Proposed by Brian Murray
Status: Merged
Merged at revision: 28e832540283c75f9370ec9b927b69427f6fcd36
Proposed branch: autopkgtest-cloud:lxd-container
Merge into: autopkgtest-cloud:master
Diff against target: 78 lines (+13/-4)
1 file modified
dev-tools/stats.py (+13/-4)
Reviewer Review Type Date Requested Status
Skia Approve
Tim Andersson Abstain
Review via email: mp+468815@code.launchpad.net

Description of the change

Early in the oracular development cycle we had some tests that were supposed to run on oracular (armhf) but ended up running in noble containers. I modified stats.py to collect the container on which the test ran and this seems like it might (but hopefully not!) be useful in the future.

To post a comment you must log in.
Revision history for this message
Tim Andersson (andersson123) wrote :

I'll let skia take this one since stats.py is his baby

review: Abstain
Revision history for this message
Skia (hyask) wrote :

Looking good. I would have called everything `lxd_image`, as per https://documentation.ubuntu.com/lxd/en/stable-5.0/howto/instances_create/
When you launch an instance (that we sometimes call container), you need to specify an image, and this is what we get from the command line.
I won't block on that though, but feel free to change if you want, or merge as is.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/dev-tools/stats.py b/dev-tools/stats.py
2index 743e7a6..43aa039 100755
3--- a/dev-tools/stats.py
4+++ b/dev-tools/stats.py
5@@ -37,6 +37,7 @@ class Run:
6 self.log_lines = None
7 self.host = None
8 self.datacenter = None
9+ self.lxd_image = None
10 self.first_boot_time = None
11 self.boot_attempts = None
12
13@@ -52,6 +53,7 @@ class Run:
14 "boot_attempts": self.boot_attempts,
15 "host": self.host,
16 "datacenter": self.datacenter,
17+ "lxd_image": self.lxd_image,
18 }
19
20 def log_url(self):
21@@ -90,6 +92,7 @@ class Run:
22 - number of reboots
23 - number of nova retries
24 - datacenter
25+ - lxd_image if running on armhf
26 """
27 self.download_log()
28 self.extract_host()
29@@ -118,7 +121,9 @@ class Run:
30 logging.debug(e)
31
32 datacenter_pattern = re.compile(r"@(.*)\.secgroup ")
33- lxd_remote_pattern = re.compile(r"lxd-armhf-(\d*\.\d*\.\d*\.\d*):")
34+ lxd_remote_and_image_pattern = re.compile(
35+ r"lxd-armhf-(\d*\.\d*\.\d*\.\d*):(.*)"
36+ )
37
38 def extract_datacenter(self):
39 try:
40@@ -129,9 +134,10 @@ class Run:
41 in l
42 ]
43 if self.arch == "armhf":
44- m = self.lxd_remote_pattern.search(lines[0])
45+ m = self.lxd_remote_and_image_pattern.search(lines[0])
46 if m:
47 self.datacenter = m.group(1)
48+ self.lxd_image = m.group(2)
49 else:
50 m = self.datacenter_pattern.search(lines[0])
51 if m:
52@@ -176,6 +182,7 @@ def get_stats(db_con, since_days_ago, until_days_ago, limit):
53 " first_boot_time INTEGER, "
54 " boot_attempts INTEGER, "
55 " datacenter CHAR[10],"
56+ " lxd_image CHAR[10],"
57 " host CHAR[10],"
58 " PRIMARY KEY(uuid))"
59 )
60@@ -222,14 +229,16 @@ def get_stats(db_con, since_days_ago, until_days_ago, limit):
61 first_boot_time,
62 boot_attempts,
63 host,
64- datacenter
65+ datacenter,
66+ lxd_image
67 )
68 VALUES (
69 :uuid,
70 :first_boot_time,
71 :boot_attempts,
72 :host,
73- :datacenter
74+ :datacenter,
75+ :lxd_image
76 )""",
77 r.as_row_dict(),
78 )

Subscribers

People subscribed via source and target branches