Browse Source

Got jester working

msmith-techempower 10 years ago
parent
commit
7f05a6670d

+ 2 - 0
frameworks/Nimrod/jester/bash_profile.sh

@@ -1 +1,3 @@
 export JESTER_PATH=${IROOT}/jester
+export NIMROD_HOME=${IROOT}/nimrod
+export NGINX_HOME=${IROOT}/nginx

+ 0 - 30
frameworks/Nimrod/jester/setup.py

@@ -1,30 +0,0 @@
-import subprocess
-import sys
-import setup_util
-import os
-from os.path import expanduser
-
-home = expanduser("~")
-
-def start(args, logfile, errfile):
-  subprocess.check_call("nim c -d:release --path:$JESTER_PATH hello.nim", shell=True, cwd="jester", stderr=errfile, stdout=logfile)
-  subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c $TROOT/config/nginx.conf", shell=True, stderr=errfile, stdout=logfile)
-  
-  for i in range(0, 8):
-    subprocess.Popen("./hello 900" + str(i), shell=True, cwd="jester", stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True, stderr=errfile, stdout=logfile)
-
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'hello' in line:
-      try:
-        pid = int(line.split(None, 2)[1])
-        os.kill(pid, 15)
-      except OSError:
-        pass
-
-  return 0

+ 11 - 0
frameworks/Nimrod/jester/setup.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+${NIMROD_HOME}/bin/nim c -d:release --path:$JESTER_PATH hello.nim
+${NGINX_HOME}/sbin/nginx -c $TROOT/config/nginx.conf
+
+current=9000
+end=9008
+while [ $current -lt $end ]; do
+  ./hello $current &
+  let current=current+1
+done

+ 1 - 0
frameworks/Nimrod/nawak/bash_profile.sh

@@ -1 +1,2 @@
 export NAWAK_PATH=${IROOT}/nawak
+export NIMROD_HOME=${IROOT}/nimrod

+ 5 - 4
toolset/benchmark/framework_test.py

@@ -217,10 +217,11 @@ class FrameworkTest:
     with open('temp', 'r') as errout:
       # Read out temp error output in its entirety
       body = errout.read()
-      # Log it to the user.
-      logging.error(body)
-      # Log it to our err.txt file
-      err.write(body)
+      if len(body) > 0:
+        # Log it to the user.
+        logging.error(body)
+        # Log it to our err.txt file
+        err.write(body)
     # We are done with our temp file - delete it
     os.remove('temp')
     os.chdir(previousDir)

+ 7 - 3
toolset/setup/linux/frameworks/nawak.sh

@@ -1,12 +1,16 @@
 #!/bin/bash
 
-RETCODE=$(fw_exists nawak)
+RETCODE=$(fw_exists ${IROOT}/nawak.installed)
 [ ! "$RETCODE" == 0 ] || { return 0; }
 
+fw_depends nimrod
+
 git clone git://github.com/idlewan/nawak.git nawak
 cd nawak
 # version 0.3.0 (2014-11-02)
 git checkout b34b0b5077541ae9671957452a70e2578894d3a8
 
-nimble update
-nimble install
+${IROOT}/nimrod/bin/nimble update
+${IROOT}/nimrod/bin/nimble install
+
+touch ${IROOT}/nawak.installed