[zorg] r311120 - Files for deploying to lnt.llvm.org

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 13:26:33 PDT 2017


Author: cmatthews
Date: Thu Aug 17 13:26:33 2017
New Revision: 311120

URL: http://llvm.org/viewvc/llvm-project?rev=311120&view=rev
Log:
Files for deploying to lnt.llvm.org

Added:
    zorg/trunk/llvm-lnt/
    zorg/trunk/llvm-lnt/blacklist
    zorg/trunk/llvm-lnt/fabfile.py
    zorg/trunk/llvm-lnt/kill_zombies.py   (with props)

Added: zorg/trunk/llvm-lnt/blacklist
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvm-lnt/blacklist?rev=311120&view=auto
==============================================================================
--- zorg/trunk/llvm-lnt/blacklist (added)
+++ zorg/trunk/llvm-lnt/blacklist Thu Aug 17 13:26:33 2017
@@ -0,0 +1,47 @@
+nts\..*O3.*.code_size
+nts\..*Os.*.code_size
+nts\..*O0.*.code_size
+nts\..*Oz.*\.compile_time
+nts\..*\.execution_time
+nts\..*.SingleSource/.*
+nts\..*.MultiSource/Applications/aha/.*
+nts\..*.MultiSource/Applications/ALAC/.*
+nts\..*.MultiSource/Applications/d/make_dparser.*
+nts\..*.MultiSource/Applications/hbd/hbd.*
+nts\..*.MultiSource/Applications/hexxagon/hexxagon.*
+nts\..*.MultiSource/Applications/JM/ldecod/ldecod.*
+nts\..*.MultiSource/Applications/lambda-0.1.3/lambda.*
+nts\..*.MultiSource/Applications/lua/lua.*
+nts\..*.MultiSource/Applications/minisat/minisat.*
+nts\..*.MultiSource/Applications/oggenc/oggenc.*
+nts\..*.MultiSource/Applications/sgefa/sgefa.*
+nts\..*.MultiSource/Applications/SIBsim4/SIBsim4.*
+nts\..*.MultiSource/Applications/siod/siod.*
+nts\..*.MultiSource/Applications/spiff/spiff.*
+nts\..*.MultiSource/Applications/viterbi/viterbi.*
+nts\..*.MultiSource/Benchmarks/ASCI_Purple/SMG2000/smg2000.*
+nts\..*.MultiSource/Benchmarks/ASC_Sequoia/.*
+nts\..*.MultiSource/Benchmarks/BitBench/.*
+nts\..*.MultiSource/Benchmarks/Fhourstones.*
+nts\..*.MultiSource/Benchmarks/FreeBench/.*
+nts\..*.MultiSource/Benchmarks/llubenchmark/.*
+nts\..*.MultiSource/Benchmarks/MallocBench/.*
+nts\..*.MultiSource/Benchmarks/McCat/.*
+nts\..*.MultiSource/Benchmarks/mediabench/.*
+nts\..*.MultiSource/Benchmarks/MiBench/automotive.*
+nts\..*.MultiSource/Benchmarks/MiBench/consumer-jpeg/consumer-jpeg.*
+nts\..*.MultiSource/Benchmarks/MiBench/consumer-lame/consumer-lame.*
+nts\..*.MultiSource/Benchmarks/MiBench/network-.*
+nts\..*.MultiSource/Benchmarks/MiBench/security-.*
+nts\..*.MultiSource/Benchmarks/MiBench/telecomm-.*
+nts\..*.MultiSource/Benchmarks/nbench/nbench.*
+nts\..*.MultiSource/Benchmarks/NPB-serial/is/is.*
+nts\..*.MultiSource/Benchmarks/Olden/.*
+nts\..*.MultiSource/Benchmarks/PAQ8p/paq8p.*
+nts\..*.MultiSource/Benchmarks/Prolangs-C.*
+nts\..*.MultiSource/Benchmarks/Ptrdist/.*
+nts\..*.MultiSource/Benchmarks/SciMark2-C/.*
+nts\..*.MultiSource/Benchmarks/sim/.*
+nts\..*.MultiSource/Benchmarks/Trimaran/.*
+nts\..*.MultiSource/Benchmarks/TSVC/.*
+nts\..*.MultiSource/Benchmarks/VersaBench/.*

Added: zorg/trunk/llvm-lnt/fabfile.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvm-lnt/fabfile.py?rev=311120&view=auto
==============================================================================
--- zorg/trunk/llvm-lnt/fabfile.py (added)
+++ zorg/trunk/llvm-lnt/fabfile.py Thu Aug 17 13:26:33 2017
@@ -0,0 +1,95 @@
+""" Script to control the deployment of LNT to Google Cloud Instance.
+
+
+"""
+
+import os
+from os.path import expanduser
+
+from fabric.api import env, cd, task, run, put
+from fabric.api import sudo
+
+here = os.path.dirname(os.path.realpath(__file__))
+
+home = expanduser("~")
+
+env.use_ssh_config = True
+
+# The remote LNT venv location.
+LNT_VENV = "/srv/lnt/sandbox"
+
+# Prefix a command with this to get to the venv.
+IN_VENV = "source " + LNT_VENV + "/bin/activate; "
+
+
+def in_venv(command):
+    """Run the command inside the LNT venv."""
+    return IN_VENV + command
+
+
+# The remote location of the LNT repo checkout.
+LNT_PATH = "/srv/lnt/src/lnt/"
+LNT_CONF_PATH = "/srv/lnt/install"
+
+
+ at task
+def update():
+    """Update the svn repo, then reinstall LNT."""
+    with cd(LNT_PATH):
+        with cd(LNT_PATH + "/docs/"):
+            sudo('rm -rf _build')
+        with cd(LNT_PATH + "/lnt/server/ui/static"):
+            sudo('rm -rf docs')
+            sudo('git checkout docs')
+
+        sudo("git pull --rebase")
+        run("git log -1 --pretty=%B")
+        with cd(LNT_PATH + "/docs/"):
+            sudo(in_venv("make"))
+        sudo(IN_VENV + "python setup.py install --server")
+
+    put(here + "/blacklist", "/tmp/blacklist")
+    sudo("mv /tmp/blacklist /srv/lnt/install/blacklist")
+    put(here + "/kill_zombies.py", "/tmp/kill_zombies.py")
+    sudo("mv /tmp/kill_zombies.py /etc/cron.hourly/kill_zombies")
+    sudo("chmod +x /etc/cron.hourly/kill_zombies")
+
+    service_restart()
+
+
+ at task
+def log():
+    sudo('tail -n 500 /srv/lnt/install/lnt.log')
+
+
+ at task
+def ps():
+    sudo('ps auxxxf | grep gunicorn')
+
+
+ at task
+def df():
+    sudo('df -h')
+
+
+ at task
+def kill_zombies():
+    import re
+    out = sudo("ps auxxxf")
+    stranded = re.compile(r"^lnt\s+(?P<pid>\d+).*00\sgunicorn:\swork")
+    pids = []
+    for line in out.split('\n'):
+        m = stranded.match(line)
+        if m:
+            pid = m.groupdict()['pid']
+            pids.append(pid)
+        else:
+            print ">", line
+    for pid in pids:
+        sudo("kill -9 {}".format(pid))
+
+
+ at task
+def service_restart():
+    """Restarting LNT service with Launchctl"""
+    sudo("systemctl restart gunicorn")

Added: zorg/trunk/llvm-lnt/kill_zombies.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvm-lnt/kill_zombies.py?rev=311120&view=auto
==============================================================================
--- zorg/trunk/llvm-lnt/kill_zombies.py (added)
+++ zorg/trunk/llvm-lnt/kill_zombies.py Thu Aug 17 13:26:33 2017
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+"""
+Kill all the Zombie Gunicon processes.
+
+"""
+import re
+import subprocess
+
+out = subprocess.check_output(["ps", "auxxxf"])
+
+stranded = re.compile(r"^lnt\s+(?P<pid>\d+).*00\sgunicorn:\swork")
+pids = []
+for line in out.split('\n'):
+    m = stranded.match(line)
+    if m:
+        pid = m.groupdict()['pid']
+        pids.append(pid)
+    else:
+        print ">", line
+
+if not pids:
+    print "No PIDs to kill."
+
+for pid in pids:
+    print subprocess.check_output(["kill", "-9", "{}".format(pid)])

Propchange: zorg/trunk/llvm-lnt/kill_zombies.py
------------------------------------------------------------------------------
    svn:executable = *




More information about the llvm-commits mailing list