From c39ec60d485739ddcf164172e1f510f7825b9913 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 22 Aug 2013 22:14:41 -0700 Subject: [PATCH] queue: only bootstrap new checkouts Until we figure out why bootstrap is getting stuck like this: 9851 pts/7 S 0:03 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs 2075 pts/7 Z 0:00 \_ [git] 2112 pts/7 Z 0:00 \_ [git] 2138 pts/7 Z 0:00 \_ [bootstrap] 9852 pts/7 S 0:03 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs 2153 pts/7 Z 0:00 \_ [git] 2177 pts/7 Z 0:00 \_ [git] 2264 pts/7 Z 0:00 \_ [bootstrap] 9853 pts/7 S 0:03 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs 2141 pts/7 Z 0:00 \_ [git] 2276 pts/7 Z 0:00 \_ [git] 2305 pts/7 Z 0:00 \_ [bootstrap] 9854 pts/7 S 0:03 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs 7448 pts/7 Z 0:00 \_ [git] 7449 pts/7 Z 0:00 \_ [git] 7450 pts/7 Z 0:00 \_ [bootstrap] 7452 pts/7 Z 0:00 \_ [teuthology-resu] 9855 pts/7 S 0:01 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs 7712 pts/7 Z 0:00 \_ [git] 7713 pts/7 Z 0:00 \_ [git] 7714 pts/7 Z 0:00 \_ [bootstrap] 7716 pts/7 Z 0:00 \_ [teuthology-resu] 9856 pts/7 S 0:03 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs 2316 pts/7 Z 0:00 \_ [bootstrap] 9857 pts/7 S 0:03 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs 2340 pts/7 Z 0:00 \_ [bootstrap] 9858 pts/7 S 0:01 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs 23188 pts/7 Z 0:00 \_ [bootstrap] 9859 pts/7 S 0:03 /home/teuthworker/teuthology-master/virtualenv/bin/python ./teuthology-master/virtualenv/bin/teuthology-worker -v --archive-dir /var/lib/teuthworker/archive --tube plana --log-dir /var/lib/teuthworker/archive/worker_logs Signed-off-by: Sage Weil --- teuthology/queue.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/teuthology/queue.py b/teuthology/queue.py index bdb1c85ad1db6..220420ce82663 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -98,17 +98,19 @@ describe. One job is run at a time. subprocess.Popen(('git', 'clone', '--branch', teuthology_branch, teuthology_git_upstream, teuth_path), cwd=os.getenv("HOME")) + + log.info("Bootstrapping %s", teuth_path) + # This magic makes the bootstrap script not attempt to clobber an + # existing virtualenv. + env = os.environ.copy() + env['NO_CLOBBER'] = '1' + subprocess.Popen(('./bootstrap'), cwd=teuth_path, env=env) else: log.info("Pulling %s from upstream", teuthology_branch) subprocess.Popen(('git', 'fetch', teuthology_branch), cwd=teuth_path) subprocess.Popen(('git', 'reset', '--hard', 'origin/%s' % teuthology_branch), cwd=teuth_path) - log.info("Bootstrapping %s", teuth_path) - # This magic makes the bootstrap script not attempt to clobber an - # existing virtualenv. - env = os.environ.copy() - env['NO_CLOBBER'] = '1' - subprocess.Popen(('./bootstrap'), cwd=teuth_path, env=env) + teuth_bin_path = os.path.join(teuth_path, 'virtualenv', 'bin') if not os.path.isdir(teuth_bin_path): raise RuntimeError('Teuthology branch %s not found at %s' % -- 2.39.5