Skip to contentSkip to conversation

autobuild-run: store summary if not uploading

PATCH New Arnout Vandecappelle (Essensium/Mind) 2 participants 2 messages Jan 15, 2019 – Aug 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 autobuild-run: store summary if not uploading

When using autobuild-run for testing local changes, the results will not be uploaded. However, the tarballs are very inconvenient for processing the results (which is obviously needed for testing local changes).

Setting up a database to store build results like on a.b.o is overkill for most cases. Collecting all results in a single file is also a little bit complicated, since it would have to be protected against concurrent updates from the different instances. Therefore, simply create a "summary" file in addition to the results tarball.

The summary file contains only the information that is readily available
already: result and reason. Submitter is not relevant for the local testing use case. arch, libc and static are extracted by the a.b.o PHP scripts so they are not readily available, so they are not included. If such information is needed for some use case, it is probably better to set up a local instance of the a.b.o server and database anyway.

---
 scripts/autobuild-run | 4 ++++
 1 file changed, 4 insertions(+)
scripts/autobuild-run +4 -0
index 77272f5..c3b51bc 100755
@@ -617,6 +617,10 @@ def send_results(result, **kwargs):
             sha1 = hashlib.sha1(f.read()).hexdigest()
         resultfilename = "instance-%d-%s.tar.bz2" % (kwargs['instance'], sha1)
         os.rename(os.path.join(outputdir, "results.tar.bz2"), resultfilename)
+        summaryfilename = "instance-%d-%s.summary" % (kwargs['instance'], sha1)
+        reason = get_failure_reason() or ("",)
+        with open(summaryfilename, 'wt') as f:
+            f.write("%d,%s\n" % (result, ','.join(reason)))
         log_write(log, "INFO: results saved as %s" % resultfilename)
 
 def run_instance(**kwargs):
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 autobuild-run: store summary if not uploading

Hello,

scripts/autobuild-run def send_results(result, **kwargs): · line 623

Quoted 12 lines · On Tue, 15 Jan 2019 22:37:24 +0100 "Arnout Vandecappelle (Essensium/Mind)"…
scripts/autobuild-run +4 -0
index 77272f5..c3b51bc 100755
@@ -617,6 +617,10 @@ def send_results(result, **kwargs):
             sha1 = hashlib.sha1(f.read()).hexdigest()
         resultfilename = "instance-%d-%s.tar.bz2" % (kwargs['instance'], sha1)
         os.rename(os.path.join(outputdir, "results.tar.bz2"), resultfilename)
+        summaryfilename = "instance-%d-%s.summary" % (kwargs['instance'], sha1)
+        reason = get_failure_reason() or ("",)
+        with open(summaryfilename, 'wt') as f:
+            f.write("%d,%s\n" % (result, ','.join(reason)))

The code changed a bit around this (kwargs has been replaced by class members, the reason is already in a "reason" variable, so no need to call get_failure_reason() again, etc.). I fixed this up, and applied.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com