Browse Source

Updated Erlang frameworks

msmith-techempower 10 years ago
parent
commit
7d2069163e

+ 3 - 0
frameworks/Erlang/cowboy/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export REBAR_HOME=$IROOT/rebar

+ 0 - 21
frameworks/Erlang/cowboy/setup_erlang.py

@@ -1,21 +0,0 @@
-import subprocess
-import sys
-import setup_util
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("cowboy/src/hello_world_app.erl", "\"benchmarkdbpass\", \".*\", 3306", "\"benchmarkdbpass\", \"" + args.database_host + "\", 3306")
-
-  try:
-    subprocess.check_call("rm -rf deps/*", shell=True, cwd="cowboy", stderr=errfile, stdout=logfile)
-    subprocess.check_call("$IROOT/rebar/rebar get-deps", shell=True, cwd="cowboy", stderr=errfile, stdout=logfile)
-    subprocess.check_call("$IROOT/rebar/rebar compile", shell=True, cwd="cowboy", stderr=errfile, stdout=logfile)
-    subprocess.check_call("erl -pa ebin deps/*/ebin +sbwt very_long +swt very_low -s hello_world -noshell -detached", shell=True, cwd="cowboy", stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1
-def stop(logfile, errfile):
-  try:
-    subprocess.check_call("killall beam.smp", shell=True, cwd="/usr/bin")
-    return 0
-  except subprocess.CalledProcessError:
-    return 1

+ 8 - 0
frameworks/Erlang/cowboy/setup_erlang.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+sed -i 's|"benchmarkdbpass", ".*", 3306"|"benchmarkdbpass", "'"${DBHOST}"'", 3306"|g' src/hello_world_app.erl
+
+rm -rf deps/*
+$REBAR_HOME/rebar get-deps
+$REBAR_HOME/rebar compile
+erl -pa ebin deps/*/ebin +sbwt very_long +swt very_low -s hello_world -noshell -detached

+ 3 - 0
frameworks/Erlang/elli/bash_profile.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+
+export REBAR_HOME=$IROOT/rebar

+ 0 - 22
frameworks/Erlang/elli/setup_erlang.py

@@ -1,22 +0,0 @@
-import subprocess
-import sys
-import setup_util
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("elli/src/elli_bench_sup.erl", "\"benchmarkdbpass\", \".*\", 3306", "\"benchmarkdbpass\", \"" + args.database_host + "\", 3306")
-  
-  try:
-    subprocess.check_call("rm -rf deps/*", shell=True, cwd="elli", stderr=errfile, stdout=logfile)
-    subprocess.check_call("$IROOT/rebar/rebar get-deps", shell=True, cwd="elli", stderr=errfile, stdout=logfile)
-    subprocess.check_call("$IROOT/rebar/rebar compile", shell=True, cwd="elli", stderr=errfile, stdout=logfile)
-    # adding +K true seemed to actually slow performance
-    subprocess.check_call("erl -pa ebin deps/*/ebin +sbwt very_long +swt very_low -s elli_bench -noshell -detached", shell=True, cwd="elli", stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1
-def stop(logfile, errfile):
-  try:
-    subprocess.check_call("killall beam.smp", shell=True, cwd="/usr/bin", stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1

+ 8 - 0
frameworks/Erlang/elli/setup_erlang.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+sed -i 's|"benchmarkdbpass", ".*", 3306"|"benchmarkdbpass", "'"${DBHOST}"'", 3306"|g' src/elli_bench_sup.erl
+
+rm -rf deps/*
+$REBAR_HOME/rebar get-deps
+$REBAR_HOME/rebar compile
+erl -pa ebin deps/*/ebin +sbwt very_long +swt very_low -s elli_bench -noshell -detached

+ 1 - 1
toolset/setup/linux/installer.py

@@ -156,7 +156,7 @@ class Installer:
       command = "yes yes | " + command
       command = "yes yes | " + command
         
         
     rel_cwd = setup_util.path_relative_to_root(cwd)
     rel_cwd = setup_util.path_relative_to_root(cwd)
-    print("INSTALL: %s (cwd=$FWROOT%s)" % (command, rel_cwd))
+    print("INSTALL: %s (cwd=$FWROOT/%s)" % (command, rel_cwd))
 
 
     while attempt <= max_attempts:
     while attempt <= max_attempts:
       error_message = ""
       error_message = ""