aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/bldcontrol/management/commands/runbuilds.py
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2015-09-11 13:57:29 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-18 09:04:24 +0100
commit5697bbcc88edad85891f66d28b8803a9c9d27ff2 (patch)
tree6877cd5c2d34e86df7372b4d130c02bc73b3d9b2 /lib/toaster/bldcontrol/management/commands/runbuilds.py
parent20609eebee0d2318806cf81913e7ce6dc1005507 (diff)
downloadbitbake-contrib-5697bbcc88edad85891f66d28b8803a9c9d27ff2.tar.gz
toaster: Avoid unnecessary local to local copy of cooker log
The cooker log is copied from its original (bitbake) location to an artifact directory chosen by the user (chosen when checksettings.py runs as part of the managed mode; it's one of the annoying questions you're asked at startup). The copy happens as part of the runbuilds script run, which is started in a loop from the toaster startup script in managed mode. When a user requests the log for a build via toaster, they are getting the log which has been copied to the artifact directory, not the original bitbake log. This works for the managed case, where the runbuilds command is running in a loop and copying log files for completed builds to the artifact directory. However, in analysis mode, there are two problems: 1. checksettings isn't run, so the artifacts directory isn't set. toaster is then unable to figure out where the log files should have been copied to. 2. The log files aren't copied to the artifacts directory anyway, as runbuilds isn't running in analysis mode. To fix this, just point the user to the local bitbake log file in its original location. This avoids the copy step, and means we can remove a whole question from the toaster startup sequence, as we no longer need an artifact directory. The only downside to this is that it's not appropriate for remote bitbake servers. We will need to revisit this and possibly reinstate the copy step once we have to reconcile local and remote builds and make their logs available in the same way. [YOCTO #8209] Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/bldcontrol/management/commands/runbuilds.py')
-rw-r--r--lib/toaster/bldcontrol/management/commands/runbuilds.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/lib/toaster/bldcontrol/management/commands/runbuilds.py b/lib/toaster/bldcontrol/management/commands/runbuilds.py
index c3e9b74c0..718e1441d 100644
--- a/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -77,31 +77,11 @@ class Command(NoArgsCommand):
bec.be.save()
def archive(self):
- ''' archives data from the builds '''
- artifact_storage_dir = ToasterSetting.objects.get(name="ARTIFACTS_STORAGE_DIR").value
for br in BuildRequest.objects.filter(state = BuildRequest.REQ_ARCHIVE):
- # save cooker log
if br.build == None:
br.state = BuildRequest.REQ_FAILED
- br.save()
- continue
- build_artifact_storage_dir = os.path.join(artifact_storage_dir, "%d" % br.build.pk)
- try:
- os.makedirs(build_artifact_storage_dir)
- except OSError as ose:
- if "File exists" in str(ose):
- pass
- else:
- raise ose
-
- file_name = os.path.join(build_artifact_storage_dir, "cooker_log.txt")
- try:
- with open(file_name, "w") as f:
- f.write(br.environment.get_artifact(br.build.cooker_log_path).read())
- except IOError:
- os.unlink(file_name)
-
- br.state = BuildRequest.REQ_COMPLETED
+ else:
+ br.state = BuildRequest.REQ_COMPLETED
br.save()
def cleanup(self):