Browse Source

Port mono tests to docker (#3448)

Michael Hixson 7 years ago
parent
commit
510f09f224
37 changed files with 159 additions and 217 deletions
  1. 5 7
      .travis.yml
  2. 0 6
      frameworks/CSharp/aspnet/.gitignore
  3. 7 0
      frameworks/CSharp/aspnet/aspnet-base.dockerfile
  4. 2 0
      frameworks/CSharp/aspnet/aspnet-mono-jsonnet.dockerfile
  5. 2 0
      frameworks/CSharp/aspnet/aspnet-mono-mysql-entityframework.dockerfile
  6. 2 0
      frameworks/CSharp/aspnet/aspnet-mono-mysql-raw.dockerfile
  7. 2 0
      frameworks/CSharp/aspnet/aspnet-mono-servicestack.dockerfile
  8. 2 0
      frameworks/CSharp/aspnet/aspnet.dockerfile
  9. 0 5
      frameworks/CSharp/aspnet/benchmark_config.json
  10. 10 15
      frameworks/CSharp/aspnet/run.sh
  11. 0 5
      frameworks/CSharp/aspnet/setup_mongodb.sh
  12. 0 5
      frameworks/CSharp/aspnet/setup_mysql.sh
  13. 0 5
      frameworks/CSharp/aspnet/setup_postgresql.sh
  14. 0 8
      frameworks/CSharp/evhttp-sharp/.gitignore
  15. 0 1
      frameworks/CSharp/evhttp-sharp/benchmark_config.json
  16. 11 0
      frameworks/CSharp/evhttp-sharp/evhttp-sharp.dockerfile
  17. 0 13
      frameworks/CSharp/evhttp-sharp/setup.sh
  18. 0 8
      frameworks/CSharp/nancy/.gitignore
  19. 0 1
      frameworks/CSharp/nancy/benchmark_config.json
  20. 9 0
      frameworks/CSharp/nancy/nancy.dockerfile
  21. 1 1
      frameworks/CSharp/nancy/nginx.conf
  22. 25 0
      frameworks/CSharp/nancy/run.sh
  23. 0 36
      frameworks/CSharp/nancy/setup_nginx.sh
  24. 4 4
      frameworks/CSharp/nancy/src/Web.config
  25. 0 9
      frameworks/CSharp/revenj/.gitignore
  26. 1 1
      frameworks/CSharp/revenj/Revenj.Http.exe.config
  27. 0 1
      frameworks/CSharp/revenj/benchmark_config.json
  28. 0 3
      frameworks/CSharp/revenj/install.sh
  29. 32 0
      frameworks/CSharp/revenj/revenj.dockerfile
  30. 0 35
      frameworks/CSharp/revenj/setup.sh
  31. 0 13
      frameworks/CSharp/servicestack/.gitignore
  32. 0 1
      frameworks/CSharp/servicestack/benchmark_config.json
  33. 1 1
      frameworks/CSharp/servicestack/nginx.conf
  34. 25 0
      frameworks/CSharp/servicestack/run.sh
  35. 12 0
      frameworks/CSharp/servicestack/servicestack.dockerfile
  36. 0 33
      frameworks/CSharp/servicestack/setup_nginx.sh
  37. 6 0
      toolset/setup/docker/systools/mono.dockerfile

+ 5 - 7
.travis.yml

@@ -12,14 +12,12 @@ python:
 env:
 env:
   matrix:
   matrix:
      - "TESTLANG=C"
      - "TESTLANG=C"
-    # - "TESTDIR=CSharp/aspnet"
+     - "TESTDIR=CSharp/aspnet"
      - "TESTDIR=CSharp/aspnetcore"
      - "TESTDIR=CSharp/aspnetcore"
-    # ## - "TESTDIR=CSharp/aspnet-stripped"
-    # - "TESTDIR=CSharp/evhttp-sharp"
-    # ## - "TESTDIR=CSharp/HttpListener"
-    # - "TESTDIR=CSharp/nancy"
-    # - "TESTDIR=CSharp/revenj"
-    # - "TESTDIR=CSharp/servicestack"
+     - "TESTDIR=CSharp/evhttp-sharp"
+     - "TESTDIR=CSharp/nancy"
+     - "TESTDIR=CSharp/revenj"
+     - "TESTDIR=CSharp/servicestack"
     # - "TESTDIR=C++/cppcms"
     # - "TESTDIR=C++/cppcms"
     # - "TESTDIR=C++/ffead-cpp"
     # - "TESTDIR=C++/ffead-cpp"
     # - "TESTDIR=C++/cpoll_cppsp"
     # - "TESTDIR=C++/cpoll_cppsp"

+ 0 - 6
frameworks/CSharp/aspnet/.gitignore

@@ -1,6 +0,0 @@
-*.user
-*.suo
-*/bin/*
-*/obj/*
-*/packages/*
-nginx.upstream.conf

+ 7 - 0
frameworks/CSharp/aspnet/aspnet-base.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/mono:latest
+
+ADD ./ /aspnet
+WORKDIR /aspnet
+
+RUN xbuild src/Benchmarks.build.proj /t:Clean
+RUN xbuild src/Benchmarks.build.proj /t:Build

+ 2 - 0
frameworks/CSharp/aspnet/aspnet-mono-jsonnet.dockerfile

@@ -0,0 +1,2 @@
+FROM tfb/aspnet-base:latest
+CMD bash run.sh

+ 2 - 0
frameworks/CSharp/aspnet/aspnet-mono-mysql-entityframework.dockerfile

@@ -0,0 +1,2 @@
+FROM tfb/aspnet-base:latest
+CMD bash run.sh

+ 2 - 0
frameworks/CSharp/aspnet/aspnet-mono-mysql-raw.dockerfile

@@ -0,0 +1,2 @@
+FROM tfb/aspnet-base:latest
+CMD bash run.sh

+ 2 - 0
frameworks/CSharp/aspnet/aspnet-mono-servicestack.dockerfile

@@ -0,0 +1,2 @@
+FROM tfb/aspnet-base:latest
+CMD bash run.sh

+ 2 - 0
frameworks/CSharp/aspnet/aspnet.dockerfile

@@ -0,0 +1,2 @@
+FROM tfb/aspnet-base:latest
+CMD bash run.sh

+ 0 - 5
frameworks/CSharp/aspnet/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "aspnet",
   "framework": "aspnet",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup_nginx",
       "json_url": "/json/default",
       "json_url": "/json/default",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,
@@ -22,7 +21,6 @@
       "versus": "aspnet-mono"
       "versus": "aspnet-mono"
     },
     },
     "mono-jsonnet": {
     "mono-jsonnet": {
-      "setup_file": "setup_nginx",
       "json_url": "/json/jsonnet",
       "json_url": "/json/jsonnet",
       "port": 8080,
       "port": 8080,
       "approach": "Realistic",
       "approach": "Realistic",
@@ -41,7 +39,6 @@
       "versus": "aspnet-mono"
       "versus": "aspnet-mono"
     },
     },
     "mono-servicestack": {
     "mono-servicestack": {
-      "setup_file": "setup_nginx",
       "json_url": "/json/servicestack",
       "json_url": "/json/servicestack",
       "port": 8080,
       "port": 8080,
       "approach": "Realistic",
       "approach": "Realistic",
@@ -60,7 +57,6 @@
       "versus": "aspnet-mono"
       "versus": "aspnet-mono"
     },
     },
     "mono-mysql-raw": {
     "mono-mysql-raw": {
-      "setup_file": "setup_mysql",
       "json_url": "/json/default",
       "json_url": "/json/default",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "db_url": "/ado/mysql",
       "db_url": "/ado/mysql",
@@ -84,7 +80,6 @@
       "versus": "aspnet"
       "versus": "aspnet"
     },
     },
     "mono-mysql-entityframework": {
     "mono-mysql-entityframework": {
-      "setup_file": "setup_mysql",
       "db_url": "/entityframework/mysql",
       "db_url": "/entityframework/mysql",
       "query_url": "/entityframework/mysql?queries=",
       "query_url": "/entityframework/mysql?queries=",
       "fortune_url": "/entityframework/mysql/fortunes",
       "fortune_url": "/entityframework/mysql/fortunes",

+ 10 - 15
frameworks/CSharp/aspnet/setup_nginx.sh → frameworks/CSharp/aspnet/run.sh

@@ -1,30 +1,25 @@
 #!/bin/bash
 #!/bin/bash
 
 
-fw_depends nginx mono
-
-# extra cleaning
-rm -rf src/bin src/obj
-rm -rf /tmp/nuget
-
-xbuild src/Benchmarks.build.proj /t:Clean
-xbuild src/Benchmarks.build.proj /t:Build
-
 # one fastcgi instance for each thread
 # one fastcgi instance for each thread
 # load balanced by nginx
 # load balanced by nginx
 port_start=9001
 port_start=9001
 port_end=$(($port_start+$CPU_COUNT))
 port_end=$(($port_start+$CPU_COUNT))
 
 
+# To debug, use --printlog --verbose --loglevels=All
+for port in $(seq $port_start $port_end); do
+	MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:/aspnet/src --socket=tcp:127.0.0.1:$port &
+done
+
+sleep 5s
+
 # nginx
 # nginx
 conf="upstream mono {\n"
 conf="upstream mono {\n"
 for port in $(seq $port_start $port_end); do
 for port in $(seq $port_start $port_end); do
   conf+="\tserver 127.0.0.1:${port};\n"
   conf+="\tserver 127.0.0.1:${port};\n"
 done
 done
 conf+="}"
 conf+="}"
-echo -e $conf > $TROOT/nginx.upstream.conf
 
 
-nginx -c $TROOT/nginx.conf -g "worker_processes ${CPU_COUNT};"
+echo -e $conf > nginx.upstream.conf
+nginx -c /aspnet/nginx.conf -g "worker_processes ${CPU_COUNT};"
 
 
-# To debug, use --printlog --verbose --loglevels=All
-for port in $(seq $port_start $port_end); do
-  fastcgi-mono-server4 --applications=/:$TROOT/src --socket=tcp:127.0.0.1:$port &
-done
+wait

+ 0 - 5
frameworks/CSharp/aspnet/setup_mongodb.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends mongodb
-
-source ./setup_nginx.sh

+ 0 - 5
frameworks/CSharp/aspnet/setup_mysql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql
-
-source ./setup_nginx.sh

+ 0 - 5
frameworks/CSharp/aspnet/setup_postgresql.sh

@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql
-
-source ./setup_nginx.sh

+ 0 - 8
frameworks/CSharp/evhttp-sharp/.gitignore

@@ -1,8 +0,0 @@
-*.user
-*.suo
-*/bin/*
-*/obj/*
-obj/
-[Bb]in
-[Dd]ebug*/
-[Rr]elease*/

+ 0 - 1
frameworks/CSharp/evhttp-sharp/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "evhttp-sharp",
   "framework": "evhttp-sharp",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup",
       "json_url": "/",
       "json_url": "/",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8085,
       "port": 8085,

+ 11 - 0
frameworks/CSharp/evhttp-sharp/evhttp-sharp.dockerfile

@@ -0,0 +1,11 @@
+FROM tfb/mono:latest
+
+ADD ./ /evhttp
+WORKDIR /evhttp
+
+RUN xbuild src/EvHttpSharpBenchmark.csproj /t:Clean
+RUN xbuild src/EvHttpSharpBenchmark.csproj /p:Configuration=Release
+
+ENV MONO_GC_PARAMS nursery-size=64m
+
+CMD mono -O=all src/bin/Release/EvHttpSharpBenchmark.exe 127.0.0.1 8085 ${CPU_COUNT}

+ 0 - 13
frameworks/CSharp/evhttp-sharp/setup.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends mono
-
-#extra cleaning
-rm -rf src/bin src/obj
-
-xbuild src/EvHttpSharpBenchmark.csproj /t:Clean
-xbuild src/EvHttpSharpBenchmark.csproj /p:Configuration=Release
-
-export MONO_GC_PARAMS=nursery-size=64m
-
-mono -O=all $TROOT/src/bin/Release/EvHttpSharpBenchmark.exe 127.0.0.1 8085 $CPU_COUNT &

+ 0 - 8
frameworks/CSharp/nancy/.gitignore

@@ -1,8 +0,0 @@
-*.user
-*.suo
-*/bin/*
-*/obj/*
-obj/
-[Bb]in
-[Dd]ebug*/
-[Rr]elease*/

+ 0 - 1
frameworks/CSharp/nancy/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "nancy",
   "framework": "nancy",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup_nginx",
       "plaintext_url":"/plaintext",
       "plaintext_url":"/plaintext",
       "json_url": "/json",
       "json_url": "/json",
       "db_url": "/db",
       "db_url": "/db",

+ 9 - 0
frameworks/CSharp/nancy/nancy.dockerfile

@@ -0,0 +1,9 @@
+FROM tfb/mono:latest
+
+ADD ./ /nancy
+WORKDIR /nancy
+
+RUN xbuild src/NancyBenchmark.csproj /t:Clean
+RUN xbuild src/NancyBenchmark.csproj /p:Configuration=Release
+
+CMD bash run.sh

+ 1 - 1
frameworks/CSharp/nancy/nginx.conf

@@ -19,7 +19,7 @@ http {
 
 
         location / {
         location / {
             fastcgi_pass mono;
             fastcgi_pass mono;
-            include nginx.osenv.conf; # read os env from this file
+            include /nginx/conf/fastcgi_params;
             fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
             fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
         }
         }
     }
     }

+ 25 - 0
frameworks/CSharp/nancy/run.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# one fastcgi instance for each thread
+# load balanced by nginx
+port_start=9001
+port_end=$(($port_start+$CPU_COUNT))
+
+# To debug, use --printlog --verbose --loglevels=All
+for port in $(seq $port_start $port_end); do
+	MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:/nancy/src --socket=tcp:127.0.0.1:$port &
+done
+
+sleep 5s
+
+# nginx
+conf="upstream mono {\n"
+for port in $(seq $port_start $port_end); do
+  conf+="\tserver 127.0.0.1:${port};\n"
+done
+conf+="}"
+
+echo -e $conf > nginx.upstream.conf
+nginx -c /nancy/nginx.conf -g "worker_processes ${CPU_COUNT};"
+
+wait

+ 0 - 36
frameworks/CSharp/nancy/setup_nginx.sh

@@ -1,36 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql nginx mono
-
-sed -i 's|localhost|'"${DBHOST}"'|g' src/Web.config
-sed -i 's|include /usr/local/nginx/conf/fastcgi_params;|include '"${NGINX_HOME}"'/conf/fastcgi_params;|g' nginx.conf
-
-# build
-rm -rf src/bin src/obj
-xbuild src/NancyBenchmark.csproj /t:Clean
-xbuild src/NancyBenchmark.csproj /p:Configuration=Release
-
-# nginx
-port_start=9001
-port_end=$((${port_start}+${CPU_COUNT}))
-conf="upstream mono {\n"
-for port in $(seq ${port_start} $port_end); do
-  conf+="\tserver 127.0.0.1:${port};\n"
-done
-conf+="}"
-
-# Store path of fastcgi_params dynamically in a file called "nginx.osenv.conf". 
-# The reason why I do this is Ngix "include" cannot recognize variables. (Well known issue of Nginx)
-# To use OS Environment at ngix.conf 3rd party library or perl module is needed
-# Current approach is one trick to solve the problem without utilize those 3rd party libraries.
-echo "include $IROOT/nginx/conf/fastcgi_params;" > $TROOT/nginx.osenv.conf
-
-
-echo -e $conf > $TROOT/nginx.upstream.conf
-${NGINX_HOME}/sbin/nginx -c $TROOT/nginx.conf -g "worker_processes '"${CPU_COUNT}"';"
-
-# Start fastcgi for each thread
-# To debug, use --printlog --verbose --loglevels=All
-for port in $(seq ${port_start} $port_end); do
-  MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:$TROOT/src --socket=tcp:127.0.0.1:$port &
-done

+ 4 - 4
frameworks/CSharp/nancy/src/Web.config

@@ -1,9 +1,9 @@
 <?xml version="1.0"?>
 <?xml version="1.0"?>
 <configuration>
 <configuration>
   <appSettings>
   <appSettings>
-    <add key="ConnectionString.MySQL" value="server=localhost;user id=benchmarkdbuser;password=benchmarkdbpass;database=hello_world"/>
-    <add key="ConnectionString.PostgreSQL" value="server=localhost;user id=benchmarkdbuser;password=benchmarkdbpass;database=hello_world"/>
-    <add key="ConnectionString.MongoDB" value="mongodb://localhost"/>
+    <add key="ConnectionString.MySQL" value="server=TFB-database;user id=benchmarkdbuser;password=benchmarkdbpass;database=hello_world"/>
+    <add key="ConnectionString.PostgreSQL" value="server=TFB-database;user id=benchmarkdbuser;password=benchmarkdbpass;database=hello_world"/>
+    <add key="ConnectionString.MongoDB" value="mongodb://TFB-database"/>
   </appSettings>
   </appSettings>
   <system.web>
   <system.web>
     <customErrors mode="Off"/>
     <customErrors mode="Off"/>
@@ -29,4 +29,4 @@
       </dependentAssembly>
       </dependentAssembly>
     </assemblyBinding>
     </assemblyBinding>
   </runtime>
   </runtime>
-</configuration>
+</configuration>

+ 0 - 9
frameworks/CSharp/revenj/.gitignore

@@ -1,9 +0,0 @@
-*.user
-*.suo
-*.jar
-*.zip
-dsl-compiler.*
-*/bin/*
-*/obj/*
-exe/
-tmp/

+ 1 - 1
frameworks/CSharp/revenj/Revenj.Http.exe.config

@@ -6,7 +6,7 @@
   <appSettings>
   <appSettings>
     <add key="PluginsPath" value="." />
     <add key="PluginsPath" value="." />
     <add key="ServerAssembly" value="ServerModel.dll"/>
     <add key="ServerAssembly" value="ServerModel.dll"/>
-    <add key="ConnectionString" value="server=localhost;port=5432;database=hello_world;user=benchmarkdbuser;password=benchmarkdbpass" />
+    <add key="ConnectionString" value="server=TFB-database;port=5432;database=hello_world;user=benchmarkdbuser;password=benchmarkdbpass" />
     <add key="HttpAddress_local" value="http://0.0.0.0:8080/" />
     <add key="HttpAddress_local" value="http://0.0.0.0:8080/" />
     <add key="Revenj.HttpServer" value="Revenj"/>
     <add key="Revenj.HttpServer" value="Revenj"/>
     <add key="CustomAuth" value="Revenj.Http.NoAuth"/>
     <add key="CustomAuth" value="Revenj.Http.NoAuth"/>

+ 0 - 1
frameworks/CSharp/revenj/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "revenj",
   "framework": "revenj",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup",
       "json_url": "/bench/json",
       "json_url": "/bench/json",
       "db_url": "/bench/db",
       "db_url": "/bench/db",
       "query_url": "/bench/queries/",
       "query_url": "/bench/queries/",

+ 0 - 3
frameworks/CSharp/revenj/install.sh

@@ -1,3 +0,0 @@
-#!/bin/bash
-
-fw_depends mono java dsl_platform

+ 32 - 0
frameworks/CSharp/revenj/revenj.dockerfile

@@ -0,0 +1,32 @@
+FROM tfb/java:latest as java
+FROM tfb/mono:latest
+COPY --from=java /java /java
+ENV JAVA_HOME=/java/jdk-9.0.4
+ENV PATH="${JAVA_HOME}/bin:${PATH}"
+
+ADD ./ /revenj
+WORKDIR /revenj
+
+RUN curl -sL -O https://github.com/ngs-doo/revenj/releases/download/1.4.2/dsl-compiler.zip
+RUN unzip dsl-compiler.zip
+RUN rm dsl-compiler.zip
+
+RUN curl -sL -O https://github.com/ngs-doo/dsl-compiler-client/releases/download/1.8.2/dsl-clc.jar
+RUN curl -sL -O https://github.com/ngs-doo/revenj/releases/download/1.4.2/http-server.zip
+RUN unzip http-server.zip -d /revenj/exe
+
+RUN java -jar dsl-clc.jar \
+	temp=/revenj/tmp/ \
+	force \
+	dsl=/revenj/Revenj.Bench \
+	manual-json \
+	compiler=/revenj/dsl-compiler.exe \
+	revenj.net=/revenj/exe/ServerModel.dll \
+	no-prompt \
+	dependencies:revenj.net=/revenj/exe
+
+RUN xbuild /revenj/Revenj.Bench/Revenj.Bench.csproj /t:Rebuild /p:Configuration=Release
+
+RUN mv /revenj/Revenj.Http.exe.config /revenj/exe/Revenj.Http.exe.config
+
+CMD mono /revenj/exe/Revenj.Http.exe

+ 0 - 35
frameworks/CSharp/revenj/setup.sh

@@ -1,35 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql java mono dsl_platform
-
-echo "Cleaning up..."
-rm -rf $TROOT/exe $TROOT/tmp $TROOT/dsl-clc.jar $TROOT/http-server.zip
-
-echo "Download DSL compiler client"
-wget -O $TROOT/dsl-clc.jar https://github.com/ngs-doo/dsl-compiler-client/releases/download/1.8.2/dsl-clc.jar
-
-echo "Download Revenj.NET HTTP server 1.4.2"
-wget -O $TROOT/http-server.zip https://github.com/ngs-doo/revenj/releases/download/1.4.2/http-server.zip
-
-echo "Unzipping HTTP server"
-unzip $TROOT/http-server.zip -d $TROOT/exe
-
-echo "Compiling the server model and downloading dependencies..."
-java -jar $TROOT/dsl-clc.jar \
-	temp=$TROOT/tmp/ \
-	force \
-	dsl=$TROOT/Revenj.Bench \
-	manual-json \
-	compiler=$IROOT/dsl-compiler.exe \
-	revenj.net=$TROOT/exe/ServerModel.dll \
-	no-prompt \
-	dependencies:revenj.net=$TROOT/exe
-
-echo "Compiling the benchmark project..."
-xbuild $TROOT/Revenj.Bench/Revenj.Bench.csproj /t:Rebuild /p:Configuration=Release
-
-echo "Copying the configuration template"
-cat $TROOT/Revenj.Http.exe.config | sed 's|\(ConnectionString.*server=\)localhost|\1'"${DBHOST}"'|' > $TROOT/exe/Revenj.Http.exe.config
-
-echo "Running the Revenj instance"
-mono $TROOT/exe/Revenj.Http.exe

+ 0 - 13
frameworks/CSharp/servicestack/.gitignore

@@ -1,13 +0,0 @@
-*.pyc
-*.user
-*.suo
-*/bin/
-*/obj/
-obj/
-[Bb]in
-[Dd]ebug*/
-[Rr]elease*/
-nuget.exe
-packages/
-!packages/repositories.config
-lib/*

+ 0 - 1
frameworks/CSharp/servicestack/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "servicestack",
   "framework": "servicestack",
   "tests": [{
   "tests": [{
     "default": {
     "default": {
-      "setup_file": "setup_nginx",
       "json_url": "/json",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "plaintext_url": "/plaintext",
       "port": 8080,
       "port": 8080,

+ 1 - 1
frameworks/CSharp/servicestack/nginx.conf

@@ -19,7 +19,7 @@ http {
 
 
         location / {
         location / {
             fastcgi_pass mono;
             fastcgi_pass mono;
-            include /usr/local/nginx/conf/fastcgi_params;
+            include /nginx/conf/fastcgi_params;
             fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
             fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
         }
         }
     }
     }

+ 25 - 0
frameworks/CSharp/servicestack/run.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# one fastcgi instance for each thread
+# load balanced by nginx
+port_start=9001
+port_end=$(($port_start+$CPU_COUNT))
+
+# To debug, use --printlog --verbose --loglevels=All
+for port in $(seq $port_start $port_end); do
+	MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:/servicestack/src --socket=tcp:127.0.0.1:$port &
+done
+
+sleep 5s
+
+# nginx
+conf="upstream mono {\n"
+for port in $(seq $port_start $port_end); do
+  conf+="\tserver 127.0.0.1:${port};\n"
+done
+conf+="}"
+
+echo -e $conf > nginx.upstream.conf
+nginx -c /servicestack/nginx.conf -g "worker_processes ${CPU_COUNT};"
+
+wait

+ 12 - 0
frameworks/CSharp/servicestack/servicestack.dockerfile

@@ -0,0 +1,12 @@
+FROM tfb/mono:latest
+
+ADD ./ /servicestack
+WORKDIR /servicestack
+
+RUN mkdir lib
+RUN curl -sL -O https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
+RUN mono nuget.exe install src/packages.config -OutputDirectory lib/
+RUN xbuild src/ServiceStackBenchmark.csproj /t:Clean
+RUN xbuild src/ServiceStackBenchmark.csproj /t:Build
+
+CMD bash run.sh

+ 0 - 33
frameworks/CSharp/servicestack/setup_nginx.sh

@@ -1,33 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql postgresql mongodb nginx mono
-
-sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' nginx.conf
-
-rm -rf lib/
-mkdir lib
-
-wget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -O nuget.exe
-
-mono nuget.exe install src/packages.config -OutputDirectory lib/
-
-# extra cleaning
-rm -rf src/bin src/obj
-xbuild src/ServiceStackBenchmark.csproj /t:Clean
-xbuild src/ServiceStackBenchmark.csproj /t:Build
-# one fastcgi instance for each thread
-# load balanced by nginx
-port_start=9001
-port_end=$(($port_start+$CPU_COUNT))
-# nginx
-conf="upstream mono {\n"
-for port in $(seq $port_start $port_end); do
-conf+="\tserver 127.0.0.1:${port};\n"
-done
-conf+="}"
-echo -e $conf > $TROOT/nginx.upstream.conf
-nginx -c $TROOT/nginx.conf -g "worker_processes ${CPU_COUNT};"
-# To debug, use --printlog --verbose --loglevels=All
-for port in $(seq $port_start $port_end); do
-	MONO_OPTIONS=--gc=sgen fastcgi-mono-server4 --applications=/:$TROOT/src --socket=tcp:127.0.0.1:$port &
-done

+ 6 - 0
toolset/setup/docker/systools/mono.dockerfile

@@ -0,0 +1,6 @@
+FROM tfb/nginx:latest
+
+RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+RUN echo "deb http://download.mono-project.com/repo/ubuntu stable-xenial main" | tee /etc/apt/sources.list.d/mono-official-stable.list
+RUN apt-get update
+RUN apt-get install -y mono-complete mono-fastcgi-server