From 5ff6eaedfbce94cdec546b2b01ead11db3413d64 Mon Sep 17 00:00:00 2001 From: hyokeun Date: Thu, 27 Apr 2017 14:07:24 +0900 Subject: [PATCH] Use separate mic.conf file for each build 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 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/job_imager.py b/job_imager.py index 99647b8..954c1fe 100755 --- a/job_imager.py +++ b/job_imager.py @@ -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 -- 2.7.4