TDB2: make SAMBA use tdb1 again for the moment.
[sfrench/samba-autobuild/.git] / script / autobuild.py
1 #!/usr/bin/env python
2 # run tests on all Samba subprojects and push to a git tree on success
3 # Copyright Andrew Tridgell 2010
4 # released under GNU GPL v3 or later
5
6 from subprocess import call, check_call,Popen, PIPE
7 import os, tarfile, sys, time
8 from optparse import OptionParser
9 import smtplib
10 from email.mime.text import MIMEText
11 from distutils.sysconfig import get_python_lib
12
13 samba_master = os.getenv('SAMBA_MASTER', 'git://git.samba.org/samba.git')
14 samba_master_ssh = os.getenv('SAMBA_MASTER_SSH', 'git+ssh://git.samba.org/data/git/samba.git')
15
16 cleanup_list = []
17
18 builddirs = {
19     "samba3"  : "source3",
20     "samba4"  : ".",
21     "samba4-libs"  : ".",
22     "ldb"     : "lib/ldb",
23     "tdb"     : "lib/tdb",
24     "talloc"  : "lib/talloc",
25     "replace" : "lib/replace",
26     "tevent"  : "lib/tevent",
27     "pidl"    : "pidl",
28     "pass"    : ".",
29     "fail"    : ".",
30     "retry"   : "."
31     }
32
33 defaulttasks = [ "samba3", "samba4", "samba4-libs", "ldb", "tdb", "talloc", "replace", "tevent", "pidl" ]
34
35 tasks = {
36     "samba3" : [ ("autogen", "./autogen.sh", "text/plain"),
37                  ("configure", "./configure.developer ${PREFIX}", "text/plain"),
38                  ("make basics", "make basics", "text/plain"),
39                  # we split 'make -j 4', 'make bin/smbtorture4' and 'make -j 4 everything'
40                  # because it makes it much easier to find errors.
41                  ("make", "make -j 4", "text/plain"), # don't use too many processes
42                  ("make bin/smbtorture4", "make -j 4 bin/smbtorture4", "text/plain"),
43                  ("make everything", "make -j 4 everything", "text/plain"),
44                  ("install", "make install", "text/plain"),
45                  ("test", "TDB_NO_FSYNC=1 make test FAIL_IMMEDIATELY=1", "text/plain"),
46                  ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
47                  ("clean", "make clean", "text/plain") ],
48
49     # We have 'test' before 'install' because, 'test' should work without 'install'
50     "samba4" : [ ("configure", "./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab", "text/plain"),
51                  ("make", "make -j", "text/plain"),
52                  ("test", "TDB_NO_FSYNC=1 make test FAIL_IMMEDIATELY=1", "text/plain"),
53                  ("install", "make install", "text/plain"),
54                  ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
55                  ("clean", "make clean", "text/plain") ],
56
57     "samba4-libs" : [ ("talloc-configure", "cd lib/talloc && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
58                       ("talloc-make", "cd lib/talloc && make -j", "text/plain"),
59                       ("talloc-install", "cd lib/talloc && make install", "text/plain"),
60
61                       ("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
62                       ("tdb-make", "cd lib/tdb && make -j", "text/plain"),
63                       ("tdb-install", "cd lib/tdb && make install", "text/plain"),
64
65                       ("tevent-configure", "cd lib/tevent && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
66                       ("tevent-make", "cd lib/tevent && make -j", "text/plain"),
67                       ("tevent-install", "cd lib/tevent && make install", "text/plain"),
68
69                       ("ldb-configure", "cd lib/ldb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
70                       ("ldb-make", "cd lib/ldb && make -j", "text/plain"),
71                       ("ldb-install", "cd lib/ldb && make install", "text/plain"),
72
73                       ("configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=!talloc,!tdb,!pytdb,!ldb,!pyldb,!tevent,!pytevent --abi-check --enable-debug -C ${PREFIX}", "text/plain"),
74                       ("make", "make -j", "text/plain"),
75                       ("install", "make install", "text/plain")],
76
77     "ldb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
78               ("make", "make -j", "text/plain"),
79               ("install", "make install", "text/plain"),
80               ("test", "TDB_NO_FSYNC=1 make test", "text/plain"),
81               ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
82               ("distcheck", "make distcheck", "text/plain"),
83               ("clean", "make clean", "text/plain") ],
84
85     # We don't use TDB_NO_FSYNC=1 here, because we want to test the transaction code
86     "tdb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
87               ("make", "make -j", "text/plain"),
88               ("install", "make install", "text/plain"),
89               ("test", "make test", "text/plain"),
90               ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
91               ("distcheck", "make distcheck", "text/plain"),
92               ("clean", "make clean", "text/plain") ],
93
94     "talloc" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
95                  ("make", "make -j", "text/plain"),
96                  ("install", "make install", "text/plain"),
97                  ("test", "make test", "text/plain"),
98                  ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
99                  ("distcheck", "make distcheck", "text/plain"),
100                  ("clean", "make clean", "text/plain") ],
101
102     "replace" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
103                   ("make", "make -j", "text/plain"),
104                   ("install", "make install", "text/plain"),
105                   ("test", "make test", "text/plain"),
106                   ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
107                   ("distcheck", "make distcheck", "text/plain"),
108                   ("clean", "make clean", "text/plain") ],
109
110     "tevent" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"),
111                  ("make", "make -j", "text/plain"),
112                  ("install", "make install", "text/plain"),
113                  ("test", "make test", "text/plain"),
114                  ("check-clean-tree", "../../script/clean-source-tree.sh", "text/plain"),
115                  ("distcheck", "make distcheck", "text/plain"),
116                  ("clean", "make clean", "text/plain") ],
117
118     "pidl" : [ ("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}", "text/plain"),
119                ("touch", "touch *.yp", "text/plain"),
120                ("make", "make", "text/plain"),
121                ("test", "make test", "text/plain"),
122                ("install", "make install", "text/plain"),
123                ("check-clean-tree", "../script/clean-source-tree.sh", "text/plain"),
124                ("clean", "make clean", "text/plain") ],
125
126     # these are useful for debugging autobuild
127     'pass' : [ ("pass", 'echo passing && /bin/true', "text/plain") ],
128     'fail' : [ ("fail", 'echo failing && /bin/false', "text/plain") ]
129 }
130
131 retry_task = [ ( "retry",
132                  '''set -e
133                 git remote add -t master master %s
134                 git fetch master
135                 while :; do
136                   sleep 60
137                   git describe master/master > old_master.desc
138                   git fetch master
139                   git describe master/master > master.desc
140                   diff old_master.desc master.desc
141                 done
142                ''' % samba_master, "test/plain" ) ]
143
144 def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True):
145     if show is None:
146         show = options.verbose
147     if show:
148         print("Running: '%s' in '%s'" % (cmd, dir))
149     if output:
150         return Popen([cmd], shell=True, stdout=PIPE, cwd=dir).communicate()[0]
151     elif checkfail:
152         return check_call(cmd, shell=True, cwd=dir)
153     else:
154         return call(cmd, shell=True, cwd=dir)
155
156
157 class builder(object):
158     '''handle build of one directory'''
159
160     def __init__(self, name, sequence):
161         self.name = name
162         self.dir = builddirs[name]
163
164         self.tag = self.name.replace('/', '_')
165         self.sequence = sequence
166         self.next = 0
167         self.stdout_path = "%s/%s.stdout" % (gitroot, self.tag)
168         self.stderr_path = "%s/%s.stderr" % (gitroot, self.tag)
169         if options.verbose:
170             print("stdout for %s in %s" % (self.name, self.stdout_path))
171             print("stderr for %s in %s" % (self.name, self.stderr_path))
172         run_cmd("rm -f %s %s" % (self.stdout_path, self.stderr_path))
173         self.stdout = open(self.stdout_path, 'w')
174         self.stderr = open(self.stderr_path, 'w')
175         self.stdin  = open("/dev/null", 'r')
176         self.sdir = "%s/%s" % (testbase, self.tag)
177         self.prefix = "%s/prefix/%s" % (testbase, self.tag)
178         run_cmd("rm -rf %s" % self.sdir)
179         cleanup_list.append(self.sdir)
180         cleanup_list.append(self.prefix)
181         os.makedirs(self.sdir)
182         run_cmd("rm -rf %s" % self.sdir)
183         run_cmd("git clone --shared %s %s" % (test_master, self.sdir), dir=test_master, show=True)
184         self.start_next()
185
186     def start_next(self):
187         if self.next == len(self.sequence):
188             print '%s: Completed OK' % self.name
189             self.done = True
190             return
191         (self.stage, self.cmd, self.output_mime_type) = self.sequence[self.next]
192         self.cmd = self.cmd.replace("${PYTHON_PREFIX}", get_python_lib(standard_lib=1, prefix=self.prefix))
193         self.cmd = self.cmd.replace("${PREFIX}", "--prefix=%s" % self.prefix)
194         self.cmd = self.cmd.replace("${PREFIX_DIR}", "%s" % self.prefix)
195 #        if self.output_mime_type == "text/x-subunit":
196 #            self.cmd += " | %s --immediate" % (os.path.join(os.path.dirname(__file__), "selftest/format-subunit"))
197         print '%s: [%s] Running %s' % (self.name, self.stage, self.cmd)
198         cwd = os.getcwd()
199         os.chdir("%s/%s" % (self.sdir, self.dir))
200         self.proc = Popen(self.cmd, shell=True,
201                           stdout=self.stdout, stderr=self.stderr, stdin=self.stdin)
202         os.chdir(cwd)
203         self.next += 1
204
205
206 class buildlist(object):
207     '''handle build of multiple directories'''
208
209     def __init__(self, tasklist, tasknames):
210         global tasks
211         self.tlist = []
212         self.tail_proc = None
213         self.retry = None
214         if tasknames == []:
215             tasknames = defaulttasks
216         for n in tasknames:
217             b = builder(n, tasks[n])
218             self.tlist.append(b)
219         if options.retry:
220             self.retry = builder('retry', retry_task)
221             self.need_retry = False
222
223     def kill_kids(self):
224         if self.tail_proc is not None:
225             self.tail_proc.terminate()
226             self.tail_proc.wait()
227             self.tail_proc = None
228         if self.retry is not None:
229             self.retry.proc.terminate()
230             self.retry.proc.wait()
231             self.retry = None
232         for b in self.tlist:
233             if b.proc is not None:
234                 run_cmd("killbysubdir %s > /dev/null 2>&1" % b.sdir, checkfail=False)
235                 b.proc.terminate()
236                 b.proc.wait()
237                 b.proc = None
238
239     def wait_one(self):
240         while True:
241             none_running = True
242             for b in self.tlist:
243                 if b.proc is None:
244                     continue
245                 none_running = False
246                 b.status = b.proc.poll()
247                 if b.status is None:
248                     continue
249                 b.proc = None
250                 return b
251             if options.retry:
252                 ret = self.retry.proc.poll()
253                 if ret is not None:
254                     self.need_retry = True
255                     self.retry = None
256                     return None
257             if none_running:
258                 return None
259             time.sleep(0.1)
260
261     def run(self):
262         while True:
263             b = self.wait_one()
264             if options.retry and self.need_retry:
265                 self.kill_kids()
266                 print("retry needed")
267                 return (0, None, None, None, "retry")
268             if b is None:
269                 break
270             if os.WIFSIGNALED(b.status) or os.WEXITSTATUS(b.status) != 0:
271                 self.kill_kids()
272                 return (b.status, b.name, b.stage, b.tag, "%s: [%s] failed '%s' with status %d" % (b.name, b.stage, b.cmd, b.status))
273             b.start_next()
274         self.kill_kids()
275         return (0, None, None, None, "All OK")
276
277     def tarlogs(self, fname):
278         tar = tarfile.open(fname, "w:gz")
279         for b in self.tlist:
280             tar.add(b.stdout_path, arcname="%s.stdout" % b.tag)
281             tar.add(b.stderr_path, arcname="%s.stderr" % b.tag)
282         if os.path.exists("autobuild.log"):
283             tar.add("autobuild.log")
284         tar.close()
285
286     def remove_logs(self):
287         for b in self.tlist:
288             os.unlink(b.stdout_path)
289             os.unlink(b.stderr_path)
290
291     def start_tail(self):
292         cwd = os.getcwd()
293         cmd = "tail -f *.stdout *.stderr"
294         os.chdir(gitroot)
295         self.tail_proc = Popen(cmd, shell=True)
296         os.chdir(cwd)
297
298
299 def cleanup():
300     if options.nocleanup:
301         return
302     print("Cleaning up ....")
303     for d in cleanup_list:
304         run_cmd("rm -rf %s" % d)
305
306
307 def find_git_root():
308     '''get to the top of the git repo'''
309     p=os.getcwd()
310     while p != '/':
311         if os.path.isdir(os.path.join(p, ".git")):
312             return p
313         p = os.path.abspath(os.path.join(p, '..'))
314     return None
315
316
317 def daemonize(logfile):
318     pid = os.fork()
319     if pid == 0: # Parent
320         os.setsid()
321         pid = os.fork()
322         if pid != 0: # Actual daemon
323             os._exit(0)
324     else: # Grandparent
325         os._exit(0)
326
327     import resource      # Resource usage information.
328     maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
329     if maxfd == resource.RLIM_INFINITY:
330         maxfd = 1024 # Rough guess at maximum number of open file descriptors.
331     for fd in range(0, maxfd):
332         try:
333             os.close(fd)
334         except OSError:
335             pass
336     os.open(logfile, os.O_RDWR | os.O_CREAT)
337     os.dup2(0, 1)
338     os.dup2(0, 2)
339
340 def write_pidfile(fname):
341     '''write a pid file, cleanup on exit'''
342     f = open(fname, mode='w')
343     f.write("%u\n" % os.getpid())
344     f.close()
345
346
347 def rebase_tree(url):
348     print("Rebasing on %s" % url)
349     run_cmd("git describe HEAD", show=True, dir=test_master)
350     run_cmd("git remote add -t master master %s" % url, show=True, dir=test_master)
351     run_cmd("git fetch master", show=True, dir=test_master)
352     if options.fix_whitespace:
353         run_cmd("git rebase --whitespace=fix master/master", show=True, dir=test_master)
354     else:
355         run_cmd("git rebase master/master", show=True, dir=test_master)
356     diff = run_cmd("git --no-pager diff HEAD master/master", dir=test_master, output=True)
357     if diff == '':
358         print("No differences between HEAD and master/master - exiting")
359         sys.exit(0)
360     run_cmd("git describe master/master", show=True, dir=test_master)
361     run_cmd("git describe HEAD", show=True, dir=test_master)
362     run_cmd("git --no-pager diff --stat HEAD master/master", show=True, dir=test_master)
363
364 def push_to(url):
365     print("Pushing to %s" % url)
366     if options.mark:
367         run_cmd("git config --replace-all core.editor script/commit_mark.sh", dir=test_master)
368         run_cmd("git commit --amend -c HEAD", dir=test_master)
369         # the notes method doesn't work yet, as metze hasn't allowed refs/notes/* in master
370         # run_cmd("EDITOR=script/commit_mark.sh git notes edit HEAD", dir=test_master)
371     run_cmd("git remote add -t master pushto %s" % url, show=True, dir=test_master)
372     run_cmd("git push pushto +HEAD:master", show=True, dir=test_master)
373
374 def_testbase = os.getenv("AUTOBUILD_TESTBASE", "/memdisk/%s" % os.getenv('USER'))
375
376 parser = OptionParser()
377 parser.add_option("", "--tail", help="show output while running", default=False, action="store_true")
378 parser.add_option("", "--keeplogs", help="keep logs", default=False, action="store_true")
379 parser.add_option("", "--nocleanup", help="don't remove test tree", default=False, action="store_true")
380 parser.add_option("", "--testbase", help="base directory to run tests in (default %s)" % def_testbase,
381                   default=def_testbase)
382 parser.add_option("", "--passcmd", help="command to run on success", default=None)
383 parser.add_option("", "--verbose", help="show all commands as they are run",
384                   default=False, action="store_true")
385 parser.add_option("", "--rebase", help="rebase on the given tree before testing",
386                   default=None, type='str')
387 parser.add_option("", "--rebase-master", help="rebase on %s before testing" % samba_master,
388                   default=False, action='store_true')
389 parser.add_option("", "--pushto", help="push to a git url on success",
390                   default=None, type='str')
391 parser.add_option("", "--push-master", help="push to %s on success" % samba_master_ssh,
392                   default=False, action='store_true')
393 parser.add_option("", "--mark", help="add a Tested-By signoff before pushing",
394                   default=False, action="store_true")
395 parser.add_option("", "--fix-whitespace", help="fix whitespace on rebase",
396                   default=False, action="store_true")
397 parser.add_option("", "--retry", help="automatically retry if master changes",
398                   default=False, action="store_true")
399 parser.add_option("", "--email", help="send email to the given address on failure",
400                   type='str', default=None)
401 parser.add_option("", "--always-email", help="always send email, even on success",
402                   action="store_true")
403 parser.add_option("", "--daemon", help="daemonize after initial setup",
404                   action="store_true")
405
406
407 def email_failure(status, failed_task, failed_stage, failed_tag, errstr):
408     '''send an email to options.email about the failure'''
409     user = os.getenv("USER")
410     text = '''
411 Dear Developer,
412
413 Your autobuild failed when trying to test %s with the following error:
414    %s
415
416 the autobuild has been abandoned. Please fix the error and resubmit.
417
418 A summary of the autobuild process is here:
419
420   http://git.samba.org/%s/samba-autobuild/autobuild.log
421 ''' % (failed_task, errstr, user)
422     
423     if failed_task != 'rebase':
424         text += '''
425 You can see logs of the failed task here:
426
427   http://git.samba.org/%s/samba-autobuild/%s.stdout
428   http://git.samba.org/%s/samba-autobuild/%s.stderr
429
430 or you can get full logs of all tasks in this job here:
431
432   http://git.samba.org/%s/samba-autobuild/logs.tar.gz
433
434 The top commit for the tree that was built was:
435
436 %s
437
438 ''' % (user, failed_tag, user, failed_tag, user, top_commit_msg)
439     msg = MIMEText(text)
440     msg['Subject'] = 'autobuild failure for task %s during %s' % (failed_task, failed_stage)
441     msg['From'] = 'autobuild@samba.org'
442     msg['To'] = options.email
443
444     s = smtplib.SMTP()
445     s.connect()
446     s.sendmail(msg['From'], [msg['To']], msg.as_string())
447     s.quit()
448
449 def email_success():
450     '''send an email to options.email about a successful build'''
451     user = os.getenv("USER")
452     text = '''
453 Dear Developer,
454
455 Your autobuild has succeeded.
456
457 '''
458
459     if options.keeplogs:
460         text += '''
461
462 you can get full logs of all tasks in this job here:
463
464   http://git.samba.org/%s/samba-autobuild/logs.tar.gz
465
466 ''' % user
467
468     text += '''
469 The top commit for the tree that was built was:
470
471 %s
472 ''' % top_commit_msg
473
474     msg = MIMEText(text)
475     msg['Subject'] = 'autobuild success'
476     msg['From'] = 'autobuild@samba.org'
477     msg['To'] = options.email
478
479     s = smtplib.SMTP()
480     s.connect()
481     s.sendmail(msg['From'], [msg['To']], msg.as_string())
482     s.quit()
483
484
485 (options, args) = parser.parse_args()
486
487 if options.retry:
488     if not options.rebase_master and options.rebase is None:
489         raise Exception('You can only use --retry if you also rebase')
490
491 testbase = "%s/b%u" % (options.testbase, os.getpid())
492 test_master = "%s/master" % testbase
493
494 gitroot = find_git_root()
495 if gitroot is None:
496     raise Exception("Failed to find git root")
497
498 # get the top commit message, for emails
499 top_commit_msg = run_cmd("git log -1", dir=gitroot, output=True)
500
501 try:
502     os.makedirs(testbase)
503 except Exception, reason:
504     raise Exception("Unable to create %s : %s" % (testbase, reason))
505 cleanup_list.append(testbase)
506
507 if options.daemon:
508     logfile = os.path.join(testbase, "log")
509     print "Forking into the background, writing progress to %s" % logfile
510     daemonize(logfile)
511
512 write_pidfile(gitroot + "/autobuild.pid")
513
514 while True:
515     try:
516         run_cmd("rm -rf %s" % test_master)
517         cleanup_list.append(test_master)
518         run_cmd("git clone --shared %s %s" % (gitroot, test_master), show=True, dir=gitroot)
519     except Exception:
520         cleanup()
521         raise
522
523     try:
524         try:
525             if options.rebase is not None:
526                 rebase_tree(options.rebase)
527             elif options.rebase_master:
528                 rebase_tree(samba_master)
529         except Exception:
530             cleanup_list.append(gitroot + "/autobuild.pid")
531             cleanup()
532             email_failure(-1, 'rebase', 'rebase', 'rebase', 'rebase on master failed')
533             sys.exit(1)
534         blist = buildlist(tasks, args)
535         if options.tail:
536             blist.start_tail()
537         (status, failed_task, failed_stage, failed_tag, errstr) = blist.run()
538         if status != 0 or errstr != "retry":
539             break
540         cleanup()
541     except Exception:
542         cleanup()
543         raise
544
545 cleanup_list.append(gitroot + "/autobuild.pid")
546
547 blist.kill_kids()
548 if options.tail:
549     print("waiting for tail to flush")
550     time.sleep(1)
551
552 if status == 0:
553     print errstr
554     if options.passcmd is not None:
555         print("Running passcmd: %s" % options.passcmd)
556         run_cmd(options.passcmd, dir=test_master)
557     if options.pushto is not None:
558         push_to(options.pushto)
559     elif options.push_master:
560         push_to(samba_master_ssh)
561     if options.keeplogs:
562         blist.tarlogs("logs.tar.gz")
563         print("Logs in logs.tar.gz")
564     if options.always_email:
565         email_success()
566     blist.remove_logs()
567     cleanup()
568     print(errstr)
569     sys.exit(0)
570
571 # something failed, gather a tar of the logs
572 blist.tarlogs("logs.tar.gz")
573
574 if options.email is not None:
575     email_failure(status, failed_task, failed_stage, failed_tag, errstr)
576
577 cleanup()
578 print(errstr)
579 print("Logs in logs.tar.gz")
580 sys.exit(status)