Browse Source

Merge branch 'PR493' into development

tfb 12 years ago
parent
commit
88edf2074d

+ 22 - 0
play-scala/benchmark_config

@@ -22,6 +22,28 @@
       "display_name": "play-scala",
       "display_name": "play-scala",
       "notes": "",
       "notes": "",
       "versus": "netty"
       "versus": "netty"
+    },
+    "windows-default": {
+      "setup_file": "setup",
+      "json_url": "/json",
+      "db_url": "/db",
+      "query_url": "/db?queries=",
+      "fortune_url": "/fortunes",
+      "update_url": "/update?queries=",
+      "port": 9000,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "MySQL",
+      "framework": "play-scala",
+      "language": "Scala",
+      "orm": "Full",
+      "platform": "Netty",
+      "webserver": "None",
+      "os": "Windows",
+      "database_os": "Linux",
+      "display_name": "play-scala",
+      "notes": "",
+      "versus": "netty"
     }
     }
   }]
   }]
 }
 }

+ 24 - 3
play-scala/setup.py

@@ -1,12 +1,33 @@
 import setup_util
 import setup_util
 import subprocess
 import subprocess
+import os
 
 
 def start(args):
 def start(args):
+  kill_running_process() # Kill the running process and delete the 
+                         # RUNNING_PID file (if any). With any luck no 
+                         # new process has picked up the same PID.
+
+  play_cmd = "play"
+  if args.os.lower() == "windows":
+    play_cmd = "play.bat"
+  
   setup_util.replace_text("play-scala/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
   setup_util.replace_text("play-scala/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")
-  subprocess.Popen(["play","start"], stdin=subprocess.PIPE, cwd="play-scala")
+  subprocess.Popen([play_cmd,"start"], stdin=subprocess.PIPE, cwd="play-scala")
   return 0
   return 0
 
 
 def stop():
 def stop():
-  p = subprocess.Popen(["play","stop"], cwd="play-scala")
-  p.communicate()
+  kill_running_process()  
   return 0
   return 0
+
+def kill_running_process():
+  try:
+    with open("./play-scala/RUNNING_PID") as f:
+      pid = int(f.read())
+      os.kill(pid, 9)
+  except:
+  	pass
+
+  try:
+    os.remove("play-scala/RUNNING_PID")
+  except OSError:
+    pass  

+ 6 - 2
toolset/setup/windows/installer-bootstrap.ps1

@@ -30,8 +30,12 @@ $env:Path += ";C:\Git\bin"; [Environment]::SetEnvironmentVariable("Path", $env:P
 Write-Host "Removing git installation files...`n"
 Write-Host "Removing git installation files...`n"
 Remove-Item -Recurse -Force $basedir
 Remove-Item -Recurse -Force $basedir
 
 
-Write-Host "Downloading FrameworkBenchmarks from git...`n"
-&$git "clone" $repo $basedir | Out-Host
+if (-not (Test-Path $basedir))
+{
+    Write-Host "Downloading FrameworkBenchmarks from git...`n"
+    &$git "clone" $repo $basedir | Out-Host
+}
+
 
 
 Write-Host "`nLaunching installer...`n"
 Write-Host "`nLaunching installer...`n"
 Set-ExecutionPolicy -ExecutionPolicy Bypass -ErrorAction 'SilentlyContinue'
 Set-ExecutionPolicy -ExecutionPolicy Bypass -ErrorAction 'SilentlyContinue'

+ 22 - 0
toolset/setup/windows/installer.ps1

@@ -21,6 +21,9 @@ $ant_installer_file       = "$ant_version-bin.zip"
 $maven_version            = "apache-maven-3.0.5"
 $maven_version            = "apache-maven-3.0.5"
 $maven_installer_file     = "$maven_version-bin.zip"
 $maven_installer_file     = "$maven_version-bin.zip"
 $maven_installer_path     = "maven-3/3.0.5/binaries/$maven_installer_file"
 $maven_installer_path     = "maven-3/3.0.5/binaries/$maven_installer_file"
+$scala_version            = "2.10.2"
+$play_version             = "2.2.0"
+$play_installer_file      = "play-$play_version.zip"
 $mercurial_installer_file = "mercurial-2.6.1-x64.msi"
 $mercurial_installer_file = "mercurial-2.6.1-x64.msi"
 $cygwin_installer_file    = "setup-x86_64.exe"
 $cygwin_installer_file    = "setup-x86_64.exe"
 
 
@@ -42,6 +45,12 @@ function GetMd5FileHash($fileName) {
     $sb.ToString()
     $sb.ToString()
 }
 }
 
 
+#
+# Chocolatey package manager
+#
+Write-Host "Installing Chocolatey package manager"
+Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
+
 #
 #
 # ASP.NET
 # ASP.NET
 #
 #
@@ -280,6 +289,19 @@ $maven_dir = "C:\Java\maven"
 Move-Item "$workdir\$maven_version" $maven_dir
 Move-Item "$workdir\$maven_version" $maven_dir
 $env:Path += ";$maven_dir\bin"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
 $env:Path += ";$maven_dir\bin"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
 
 
+# scala
+cinst scala -version $scala_version
+
+# play
+$play_url = "http://downloads.typesafe.com/play/$play_version/$play_installer_file"
+$play_local = "$workdir\$play_installer_file"
+$play_dir = "C:\Java\play"
+(New-Object System.Net.WebClient).DownloadFile($play_url, $play_local)
+[System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null
+[System.IO.Compression.ZipFile]::ExtractToDirectory($play_local, $workdir) | Out-Null
+Move-Item "$workdir\play-$play_version" $play_dir
+$env:Path += ";$play_dir"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
+
 #
 #
 # Firewall
 # Firewall
 #
 #