Use separate mic.conf file for each build 55/127355/2
authorhyokeun <hyokeun.jeon@samsung.com>
Thu, 27 Apr 2017 05:07:24 +0000 (14:07 +0900)
committerHyokeun Jeon <hyokeun.jeon@samsung.com>
Thu, 27 Apr 2017 05:13:13 +0000 (05:13 +0000)
By default, /var/tmp/mic/ will be used for mic tool.
If we run multiple mic on the same machine, this shared working directory lead to problem.
Fix: Use separate working directory controlled by configuration.
$ sudo mic cr auto -c { conf file } ...

Change-Id: I4bd7f1ed44e843134e7e7c517d285534c93839bf

job_imager.py

index 99647b8..954c1fe 100755 (executable)
@@ -277,8 +277,15 @@ def main():
         if not os.path.exists(cache):
             os.makedirs(cache)
 
-        mic_cmd = "sudo /usr/bin/mic cr auto %s --release %s -o %s -k %s "\
-                  '--logfile=%s' % (ksf, build_id, outdir, cache, log)
+        # Use separate mic.conf file for each thread.
+        if os.getenv('MIC_WORK_DIR') and os.getenv('MIC_CONF_FILE'):
+            mic_conf_file = os.getenv('MIC_CONF_FILE')
+            print 'Set mic conf file: %s' % mic_conf_file
+            mic_cmd = "sudo /usr/bin/mic cr auto -c %s %s --release %s -o %s -k %s "\
+                      '--logfile=%s' % (mic_conf_file, ksf, build_id, outdir, cache, log)
+        else:
+            mic_cmd = "sudo /usr/bin/mic cr auto %s --release %s -o %s -k %s "\
+                      '--logfile=%s' % (ksf, build_id, outdir, cache, log)
 
         sys.stdout.flush()
         print 'starting mic to create image: %s' % mic_cmd