瀏覽代碼

Docker tests and updates (#3358)

Nate 7 年之前
父節點
當前提交
ca1212dc6e
共有 73 個文件被更改,包括 300 次插入310 次删除
  1. 17 13
      .travis.yml
  2. 0 1
      frameworks/Haskell/servant/benchmark_config.json
  3. 8 0
      frameworks/Haskell/servant/servant.dockerfile
  4. 0 8
      frameworks/Haskell/servant/setup.sh
  5. 0 1
      frameworks/Haskell/snap/.gitignore
  6. 1 1
      frameworks/Haskell/snap/bench/cfg/db.cfg
  7. 0 1
      frameworks/Haskell/snap/benchmark_config.json
  8. 0 11
      frameworks/Haskell/snap/setup.sh
  9. 7 0
      frameworks/Haskell/snap/snap.dockerfile
  10. 0 17
      frameworks/Haskell/spock/.gitignore
  11. 0 1
      frameworks/Haskell/spock/benchmark_config.json
  12. 0 13
      frameworks/Haskell/spock/setup.sh
  13. 7 0
      frameworks/Haskell/spock/spock.dockerfile
  14. 1 1
      frameworks/Haskell/spock/src/Main.hs
  15. 0 1
      frameworks/Haskell/wai/.gitignore
  16. 0 1
      frameworks/Haskell/wai/benchmark_config.json
  17. 0 9
      frameworks/Haskell/wai/setup.sh
  18. 7 0
      frameworks/Haskell/wai/wai.dockerfile
  19. 0 3
      frameworks/Haskell/yesod/benchmark_config.json
  20. 0 9
      frameworks/Haskell/yesod/run_yesod_mysql_mongo.sh
  21. 0 9
      frameworks/Haskell/yesod/run_yesod_postgres.sh
  22. 5 0
      frameworks/Haskell/yesod/yesod-mongodb-base.dockerfile
  23. 3 0
      frameworks/Haskell/yesod/yesod-mongodb-raw.dockerfile
  24. 0 8
      frameworks/Haskell/yesod/yesod-mysql-mongo/.gitignore
  25. 7 0
      frameworks/Haskell/yesod/yesod-postgres.dockerfile
  26. 0 10
      frameworks/Haskell/yesod/yesod-postgres/.gitignore
  27. 1 1
      frameworks/Haskell/yesod/yesod-postgres/src/Main.hs
  28. 3 0
      frameworks/Haskell/yesod/yesod.dockerfile
  29. 0 1
      frameworks/Nim/jester/.gitignore
  30. 0 1
      frameworks/Nim/jester/benchmark_config.json
  31. 16 0
      frameworks/Nim/jester/jester.dockerfile
  32. 0 0
      frameworks/Nim/jester/public/.gitkeep
  33. 3 3
      frameworks/Nim/jester/start-servers.sh
  34. 1 0
      frameworks/Rust/actix/TODO.md
  35. 6 0
      frameworks/Rust/actix/actix-base.dockerfile
  36. 3 0
      frameworks/Rust/actix/actix-diesel.dockerfile
  37. 3 0
      frameworks/Rust/actix/actix-pg.dockerfile
  38. 3 0
      frameworks/Rust/actix/actix.dockerfile
  39. 0 3
      frameworks/Rust/actix/benchmark_config.json
  40. 0 7
      frameworks/Rust/actix/setup.sh
  41. 0 7
      frameworks/Rust/actix/setup_diesel.sh
  42. 0 7
      frameworks/Rust/actix/setup_pg.sh
  43. 0 1
      frameworks/Rust/hyper/benchmark_config.json
  44. 8 0
      frameworks/Rust/hyper/hyper.dockerfile
  45. 0 7
      frameworks/Rust/hyper/setup.sh
  46. 0 1
      frameworks/Rust/iron/benchmark_config.json
  47. 7 0
      frameworks/Rust/iron/iron.dockerfile
  48. 0 7
      frameworks/Rust/iron/setup.sh
  49. 11 0
      frameworks/Rust/may-minihttp/Cargo.toml
  50. 15 0
      frameworks/Rust/may-minihttp/README.md
  51. 23 0
      frameworks/Rust/may-minihttp/benchmark_config.json
  52. 8 0
      frameworks/Rust/may-minihttp/may-minihttp.dockerfile
  53. 40 0
      frameworks/Rust/may-minihttp/src/main.rs
  54. 0 1
      frameworks/Rust/nickel/benchmark_config.json
  55. 8 0
      frameworks/Rust/nickel/nickel.dockerfile
  56. 0 7
      frameworks/Rust/nickel/setup.sh
  57. 0 1
      frameworks/Rust/rouille/benchmark_config.json
  58. 8 0
      frameworks/Rust/rouille/rouille.dockerfile
  59. 0 7
      frameworks/Rust/rouille/setup.sh
  60. 0 1
      frameworks/Rust/tokio-minihttp/benchmark_config.json
  61. 0 7
      frameworks/Rust/tokio-minihttp/setup.sh
  62. 8 0
      frameworks/Rust/tokio-minihttp/tokio-minihttp.dockerfile
  63. 15 1
      toolset/setup/linux/docker/base.dockerfile
  64. 3 0
      toolset/setup/linux/docker/languages/haskell.dockerfile
  65. 21 0
      toolset/setup/linux/docker/languages/nim.dockerfile
  66. 12 0
      toolset/setup/linux/docker/languages/rust.dockerfile
  67. 11 0
      toolset/setup/linux/docker/systools/nimble.dockerfile
  68. 0 19
      toolset/setup/linux/frameworks/jester.sh
  69. 0 18
      toolset/setup/linux/languages/haskell.sh
  70. 0 18
      toolset/setup/linux/languages/java8.sh
  71. 0 28
      toolset/setup/linux/languages/nim.sh
  72. 0 17
      toolset/setup/linux/languages/rust.sh
  73. 0 21
      toolset/setup/linux/systools/nimble.sh

+ 17 - 13
.travis.yml

@@ -65,11 +65,13 @@ env:
     # - "TESTDIR=Go/webgo"
     # - "TESTDIR=Groovy/grails"
     # - "TESTDIR=Groovy/hot"
-    # - "TESTDIR=Haskell/snap"
-    # - "TESTDIR=Haskell/wai"
-    # - "TESTDIR=Haskell/yesod"
-    # - "TESTDIR=Haskell/servant"
-    # - "TESTDIR=Haskell/spock"
+     - "TESTDIR=Haskell/snap"
+     - "TESTDIR=Haskell/wai"
+     # Separating these tests b/c of travis timeout
+     - 'TEST="yesod yesod-mongodb-raw"'
+     - "TEST=yesod-postgres"
+     - "TESTDIR=Haskell/servant"
+     - "TESTDIR=Haskell/spock"
      - "TESTDIR=Java/act"
      - "TESTDIR=Java/activeweb"
      - "TESTDIR=Java/baratine"
@@ -112,7 +114,7 @@ env:
      - "TESTDIR=Lua/lapis"
     # - "TESTDIR=Lua/octopus"
     # - "TESTDIR=Lua/openresty"
-    # - "TESTDIR=Nim/jester"
+     - "TESTDIR=Nim/jester"
     # - "TESTDIR=Perl/dancer"
     # - "TESTDIR=Perl/kelp"
     # - "TESTDIR=Perl/mojolicious"
@@ -178,11 +180,12 @@ env:
     # - "TESTDIR=Ruby/roda-sequel"
     # - "TESTDIR=Ruby/sinatra"
     # - "TESTDIR=Ruby/sinatra-sequel"
-    # - "TESTDIR=Rust/iron"
-    # - "TESTDIR=Rust/nickel"
-    # - "TESTDIR=Rust/hyper"
-    # - "TESTDIR=Rust/tokio-minihttp"
-    # - "TESTDIR=Rust/rouille"
+     - "TESTDIR=Rust/iron"
+     - "TESTDIR=Rust/nickel"
+     - "TESTDIR=Rust/hyper"
+     - "TESTDIR=Rust/may-minihttp"
+     - "TESTDIR=Rust/tokio-minihttp"
+     - "TESTDIR=Rust/rouille"
     # - "TESTDIR=Rust/actix"
      - "TESTDIR=Scala/akka-http"
      - "TESTDIR=Scala/blaze"
@@ -223,8 +226,9 @@ script:
   # we'd like to try and do the diffing before travis_clean & setup.
   # This will run the tests exactly as you would in your own vm:
   # ./toolset/run-tests.py --mode verify --test (all the valid tests for this framework)
-  - if [[ $CONTINUE_TEST && "$TESTDIR" ]]; then tfb --mode verify --test-dir "$TESTDIR"; else echo 'Skipping test verification.'; fi
-  - if [[ $CONTINUE_TEST && "$TESTLANG" ]]; then tfb --mode verify --test-lang "$TESTLANG"; else echo 'Skipping test verification.'; fi
+  - if [[ $CONTINUE_TEST && "$TESTDIR" ]]; then tfb --mode verify --test-dir $TESTDIR; else echo 'Skipping test verification.'; fi
+  - if [[ $CONTINUE_TEST && "$TESTLANG" ]]; then tfb --mode verify --test-lang $TESTLANG; else echo 'Skipping test verification.'; fi
+  - if [[ $CONTINUE_TEST && "$TEST" ]]; then tfb --mode verify --test $TEST; else echo 'Skipping test verification.'; fi
   # - tfb --mode verify --test
 
 cache:

+ 0 - 1
frameworks/Haskell/servant/benchmark_config.json

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

+ 8 - 0
frameworks/Haskell/servant/servant.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/haskell:latest
+
+COPY ./ ./
+
+RUN stack --allow-different-user setup
+RUN stack --allow-different-user build
+
+CMD stack --allow-different-user exec servant-exe -- TFB-database +RTS -A32m -N${CPU_COUNT}

+ 0 - 8
frameworks/Haskell/servant/setup.sh

@@ -1,8 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql stack
-
-${IROOT}/stack --allow-different-user setup
-${IROOT}/stack --allow-different-user build
-
-${IROOT}/stack --allow-different-user exec servant-exe -- ${DBHOST} +RTS -A32m -N${CPU_COUNT} &

+ 0 - 1
frameworks/Haskell/snap/.gitignore

@@ -1 +0,0 @@
-/bench/.stack-work/

+ 1 - 1
frameworks/Haskell/snap/bench/cfg/db.cfg

@@ -1,4 +1,4 @@
-host="127.0.0.1"
+host="TFB-database"
 uname="benchmarkdbuser"
 pword="benchmarkdbpass"
 dbase="hello_world"

+ 0 - 1
frameworks/Haskell/snap/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "snap",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/dbs?queries=",

+ 0 - 11
frameworks/Haskell/snap/setup.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-sed -i 's|host=".*"|host="'"${DBHOST}"'"|g' bench/cfg/db.cfg
-
-fw_depends mysql stack
-
-cd bench
-
-${IROOT}/stack --allow-different-user build --install-ghc
-
-${IROOT}/stack --allow-different-user exec snap-bench -- +RTS -A4M -N -qg2 -I0 -G2 &

+ 7 - 0
frameworks/Haskell/snap/snap.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/haskell:latest
+
+COPY ./bench ./
+
+RUN stack --allow-different-user build --install-ghc
+
+CMD stack --allow-different-user exec snap-bench -- +RTS -A4M -N -qg2 -I0 -G2

+ 0 - 17
frameworks/Haskell/spock/.gitignore

@@ -1,17 +0,0 @@
-dist
-cabal-dev
-*.o
-*.hi
-*.chi
-*.chs.h
-.virtualenv
-.hpc
-.hsenv
-.cabal-sandbox/
-cabal.sandbox.config
-cabal.config
-.stack-work
-*.prof
-*.hp
-*.aux
-.DS_Store

+ 0 - 1
frameworks/Haskell/spock/benchmark_config.json

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

+ 0 - 13
frameworks/Haskell/spock/setup.sh

@@ -1,13 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql stack
-
-sed -i 's|PG.connectHost     = "localhost"|PG.connectHost     = "'"${DBHOST}"'"|g' src/Main.hs
-
-if [ "$TRAVIS" = "true" ]; then
-    sed -i 's|PoolCfg 50 50 60|PoolCfg 20 25 60|g' src/Main.hs
-fi
-
-${IROOT}/stack --allow-different-user build --install-ghc
-
-${IROOT}/stack --allow-different-user exec spock-exe -- +RTS -A32m -N${CPU_COUNT} &

+ 7 - 0
frameworks/Haskell/spock/spock.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/haskell:latest
+
+COPY ./ ./
+
+RUN stack --allow-different-user build --install-ghc
+
+CMD stack --allow-different-user exec spock-exe -- +RTS -A32m -N${CPU_COUNT}

+ 1 - 1
frameworks/Haskell/spock/src/Main.hs

@@ -24,7 +24,7 @@ import           Views.Fortune
 creds :: PG.ConnectInfo
 creds =
     PG.ConnectInfo
-        { PG.connectHost     = "localhost"
+        { PG.connectHost     = "TFB-database"
         , PG.connectPort     = 5432
         , PG.connectUser     = "benchmarkdbuser"
         , PG.connectPassword = "benchmarkdbpass"

+ 0 - 1
frameworks/Haskell/wai/.gitignore

@@ -1 +0,0 @@
-/bench/.stack-work/

+ 0 - 1
frameworks/Haskell/wai/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "wai",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8000,

+ 0 - 9
frameworks/Haskell/wai/setup.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends stack
-
-cd bench
-
-${IROOT}/stack --allow-different-user build --install-ghc
-
-${IROOT}/stack --allow-different-user exec bench -- ${CPU_COUNT} ${DBHOST} +RTS -A32m -N${CPU_COUNT} &

+ 7 - 0
frameworks/Haskell/wai/wai.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/haskell:latest
+
+COPY ./ ./
+
+RUN cd bench && stack --allow-different-user build --install-ghc
+
+CMD cd bench && stack --allow-different-user exec bench -- ${CPU_COUNT} TFB-database +RTS -A32m -N${CPU_COUNT}

+ 0 - 3
frameworks/Haskell/yesod/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "yesod",
   "tests": [{
     "default": {
-      "setup_file": "run_yesod_mysql_mongo",
       "json_url": "/json",
       "db_url": "/db",
       "query_url": "/dbs/",
@@ -26,7 +25,6 @@
       "versus": "wai"
     },
     "mongodb-raw": {
-      "setup_file": "run_yesod_mysql_mongo",
       "db_url": "/mongo/raw/db",
       "query_url": "/mongo/raw/dbs/",
       "port": 8000,
@@ -46,7 +44,6 @@
       "versus": "wai"
     },
     "postgres": {
-      "setup_file": "run_yesod_postgres",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "db_url": "/db",

+ 0 - 9
frameworks/Haskell/yesod/run_yesod_mysql_mongo.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends mysql mongodb stack
-
-cd yesod-mysql-mongo
-
-${IROOT}/stack --allow-different-user build --install-ghc
-
-${IROOT}/stack --allow-different-user exec yesod-mysql-mongo -- ${CPU_COUNT} ${DBHOST} +RTS -A32m -N${CPU_COUNT} &

+ 0 - 9
frameworks/Haskell/yesod/run_yesod_postgres.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql stack
-
-cd yesod-postgres
-
-${IROOT}/stack --allow-different-user build --install-ghc
-
-${IROOT}/stack --allow-different-user exec yesod-postgres -- ${CPU_COUNT} ${DBHOST} +RTS -A32m -N${CPU_COUNT} &

+ 5 - 0
frameworks/Haskell/yesod/yesod-mongodb-base.dockerfile

@@ -0,0 +1,5 @@
+FROM tfb/haskell:latest
+
+COPY ./yesod-mysql-mongo ./
+
+RUN stack --allow-different-user build --install-ghc

+ 3 - 0
frameworks/Haskell/yesod/yesod-mongodb-raw.dockerfile

@@ -0,0 +1,3 @@
+FROM tfb/yesod-mongodb-base:latest
+
+CMD stack --allow-different-user exec yesod-mysql-mongo -- ${CPU_COUNT} TFB-database +RTS -A32m -N${CPU_COUNT}

+ 0 - 8
frameworks/Haskell/yesod/yesod-mysql-mongo/.gitignore

@@ -1,8 +0,0 @@
-dist*
-static/tmp/
-config/client_session_key.aes
-*.hi
-*.o
-*.sqlite3
-.hsenv*
-yesod-devel/

+ 7 - 0
frameworks/Haskell/yesod/yesod-postgres.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/haskell:latest
+
+COPY ./yesod-postgres ./
+
+RUN stack --allow-different-user build --install-ghc
+
+CMD stack --allow-different-user exec yesod-postgres -- ${CPU_COUNT} TFB-database +RTS -A32m -N${CPU_COUNT}

+ 0 - 10
frameworks/Haskell/yesod/yesod-postgres/.gitignore

@@ -1,10 +0,0 @@
-/bench/.stack-work/
-dist*
-static/tmp/
-config/client_session_key.aes
-*.hi
-*.o
-*.sqlite3
-.hsenv*
-yesod-devel/
-

+ 1 - 1
frameworks/Haskell/yesod/yesod-postgres/src/Main.hs

@@ -45,7 +45,7 @@ World sql=world
 |]
 
 mkPersist sqlSettings { mpsGeneric = True } [persistLowerCase|
-Fortune sql=Fortune
+Fortune sql=fortune
     message Text sql=message
 |]
 

+ 3 - 0
frameworks/Haskell/yesod/yesod.dockerfile

@@ -0,0 +1,3 @@
+FROM tfb/yesod-mongodb-base:latest
+
+CMD stack --allow-different-user exec yesod-mysql-mongo -- ${CPU_COUNT} TFB-database +RTS -A32m -N${CPU_COUNT}

+ 0 - 1
frameworks/Nim/jester/.gitignore

@@ -1 +0,0 @@
-/hello

+ 0 - 1
frameworks/Nim/jester/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "jester",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "port": 8080,
       "approach": "Realistic",

+ 16 - 0
frameworks/Nim/jester/jester.dockerfile

@@ -0,0 +1,16 @@
+FROM tfb/nimble:latest
+
+# 2015-06-25
+RUN git clone https://github.com/dom96/jester.git && \
+    cd jester && \
+    git checkout 71b8cc069a0d271d619c2dc41bc6479047885587 && \
+    nimble update && \
+    echo 'y' | nimble install
+
+ENV JESTER_HOME=/jester
+
+COPY ./ ./
+
+RUN chmod a+wrx start-servers.sh
+
+CMD ./start-servers.sh

+ 0 - 0
frameworks/Nim/jester/public/.gitkeep


+ 3 - 3
frameworks/Nim/jester/setup.sh → frameworks/Nim/jester/start-servers.sh

@@ -1,9 +1,7 @@
 #!/bin/bash
 
-fw_depends mysql nim jester nginx
-
 nim c -d:release hello.nim
-nginx -c $TROOT/config/nginx.conf
+nginx -c /config/nginx.conf
 
 current=9000
 end=9008
@@ -11,3 +9,5 @@ while [ $current -lt $end ]; do
   ./hello $current &
   let current=current+1
 done
+
+wait

+ 1 - 0
frameworks/Rust/actix/TODO.md

@@ -0,0 +1 @@
+All the other Rust frameworks are passing but Actix looks like it's being held up at `mio-uds 0.6.4` which seems specific to the actix / actix-web crates. 

+ 6 - 0
frameworks/Rust/actix/actix-base.dockerfile

@@ -0,0 +1,6 @@
+FROM tfb/rust:latest
+
+COPY ./ ./
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release

+ 3 - 0
frameworks/Rust/actix/actix-diesel.dockerfile

@@ -0,0 +1,3 @@
+FROM tfb/actix-base:latest
+
+CMD ./target/release/actix-diesel

+ 3 - 0
frameworks/Rust/actix/actix-pg.dockerfile

@@ -0,0 +1,3 @@
+FROM tfb/actix-base:latest
+
+CMD ./target/release/actix-pg

+ 3 - 0
frameworks/Rust/actix/actix.dockerfile

@@ -0,0 +1,3 @@
+FROM tfb/actix-base:latest
+
+CMD ./target/release/actix

+ 0 - 3
frameworks/Rust/actix/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "actix",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "plaintext_url": "/plaintext",
       "port": 8080,
@@ -21,7 +20,6 @@
       "versus": ""
     },
     "diesel": {
-      "setup_file": "setup_diesel",
       "db_url": "/db",
       "fortune_url": "/fortune",
       "query_url": "/queries?q=",
@@ -42,7 +40,6 @@
       "versus": ""
     },
     "pg": {
-      "setup_file": "setup_pg",
       "db_url": "/db",
       "fortune_url": "/fortune",
       "query_url": "/queries?q=",

+ 0 - 7
frameworks/Rust/actix/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql rust
-
-cargo clean
-RUSTFLAGS="-C target-cpu=native" cargo build --release
-./target/release/actix &

+ 0 - 7
frameworks/Rust/actix/setup_diesel.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql rust
-
-cargo clean
-RUSTFLAGS="-C target-cpu=native" cargo build --release
-./target/release/actix-diesel &

+ 0 - 7
frameworks/Rust/actix/setup_pg.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql rust
-
-cargo clean
-RUSTFLAGS="-C target-cpu=native" cargo build --release
-./target/release/actix-pg &

+ 0 - 1
frameworks/Rust/hyper/benchmark_config.json

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

+ 8 - 0
frameworks/Rust/hyper/hyper.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/rust:latest
+
+COPY ./ ./
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release
+
+CMD ./target/release/hello

+ 0 - 7
frameworks/Rust/hyper/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql rust
-
-cargo clean
-RUSTFLAGS="-C target-cpu=native" cargo build --release
-./target/release/hello &

+ 0 - 1
frameworks/Rust/iron/benchmark_config.json

@@ -2,7 +2,6 @@
   "framework": "iron",
   "tests": [{
     "default": {
-      "setup_file": "setup",
       "json_url": "/json",
       "db_url": "/db",
       "fortune_url": "/fortune",

+ 7 - 0
frameworks/Rust/iron/iron.dockerfile

@@ -0,0 +1,7 @@
+FROM tfb/rust:latest
+
+COPY ./ ./
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release
+CMD ./target/release/iron

+ 0 - 7
frameworks/Rust/iron/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql rust
-
-cargo clean
-RUSTFLAGS="-C target-cpu=native" cargo build --release
-./target/release/iron &

+ 11 - 0
frameworks/Rust/may-minihttp/Cargo.toml

@@ -0,0 +1,11 @@
+[package]
+name = "may-minihttp"
+version = "0.1.0"
+authors = ["Xudong Huang <[email protected]>"]
+
+[dependencies]
+num_cpus = "1.0"
+serde = "1.0"
+serde_json = "1.0"
+may = { git = "https://github.com/Xudong-Huang/may" }
+may_minihttp = { git = "https://github.com/Xudong-Huang/may_minihttp" }

+ 15 - 0
frameworks/Rust/may-minihttp/README.md

@@ -0,0 +1,15 @@
+# [may-minihttp](https://github.com/Xudong-Huang/may_minihttp) web framework
+
+## Description
+
+may-minihttp is a small, fast micro http framework based on [May](https://github.com/Xudong-Huang/may)
+
+## Test URLs
+
+### Test 1: JSON Encoding 
+
+    http://localhost:8080/json
+
+### Test 2: Plaintext
+
+    http://localhost:8080/plaintext

+ 23 - 0
frameworks/Rust/may-minihttp/benchmark_config.json

@@ -0,0 +1,23 @@
+{
+  "framework": "may-minihttp",
+  "tests": [
+    {
+      "default": {
+        "json_url": "/json",
+        "plaintext_url": "/plaintext",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "None",
+        "framework": "may-minihttp",
+        "language": "Rust",
+        "orm": "raw",
+        "platform": "Rust",
+        "webserver": "may-minihttp",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "may-minihttp"
+      }
+    }
+  ]
+}

+ 8 - 0
frameworks/Rust/may-minihttp/may-minihttp.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/rust:latest
+
+COPY ./ ./
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release
+
+CMD ./target/release/may-minihttp

+ 40 - 0
frameworks/Rust/may-minihttp/src/main.rs

@@ -0,0 +1,40 @@
+extern crate may;
+extern crate num_cpus;
+#[macro_use]
+extern crate serde_json;
+extern crate may_minihttp;
+
+use std::io;
+use may_minihttp::{HttpServer, HttpService, Request, Response};
+
+struct Techempower;
+
+impl HttpService for Techempower {
+    fn call(&self, req: Request) -> io::Result<Response> {
+        let mut resp = Response::new();
+
+        // Bare-bones router
+        match req.path() {
+            "/json" => {
+                resp.header("Content-Type", "application/json");
+                *resp.body_mut() =
+                    serde_json::to_vec(&json!({"message": "Hello, World!"})).unwrap();
+            }
+            "/plaintext" => {
+                resp.header("Content-Type", "text/plain")
+                    .body("Hello, World!");
+            }
+            _ => {
+                resp.status_code(404, "Not Found");
+            }
+        }
+
+        Ok(resp)
+    }
+}
+
+fn main() {
+    may::config().set_io_workers(num_cpus::get());
+    let server = HttpServer(Techempower).start("0.0.0.0:8080").unwrap();
+    server.join().unwrap();
+}

+ 0 - 1
frameworks/Rust/nickel/benchmark_config.json

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

+ 8 - 0
frameworks/Rust/nickel/nickel.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/rust:latest
+
+COPY ./ ./
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release
+
+CMD ./target/release/nickel

+ 0 - 7
frameworks/Rust/nickel/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends rust
-
-cargo clean
-cargo build --release
-./target/release/nickel &

+ 0 - 1
frameworks/Rust/rouille/benchmark_config.json

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

+ 8 - 0
frameworks/Rust/rouille/rouille.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/rust:latest
+
+COPY ./ ./
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release
+
+CMD ./target/release/rouille

+ 0 - 7
frameworks/Rust/rouille/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends rust
-
-cargo clean
-cargo build --release
-./target/release/rouille &

+ 0 - 1
frameworks/Rust/tokio-minihttp/benchmark_config.json

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

+ 0 - 7
frameworks/Rust/tokio-minihttp/setup.sh

@@ -1,7 +0,0 @@
-#!/bin/bash
-
-fw_depends postgresql rust
-
-cargo clean
-RUSTFLAGS="-C target-cpu=native" cargo build --release
-./target/release/tokio-minihttp &

+ 8 - 0
frameworks/Rust/tokio-minihttp/tokio-minihttp.dockerfile

@@ -0,0 +1,8 @@
+FROM tfb/rust:latest
+
+COPY ./ ./
+
+RUN cargo clean
+RUN RUSTFLAGS="-C target-cpu=native" cargo build --release
+
+CMD ./target/release/tokio-minihttp

+ 15 - 1
toolset/setup/linux/docker/base.dockerfile

@@ -1,7 +1,21 @@
 FROM ubuntu:16.04
 
 RUN apt-get update
-RUN apt-get install -qqy software-properties-common build-essential curl locales wget unzip git
+
+# Install some common development tools
+RUN apt-get install -y software-properties-common build-essential curl locales wget unzip git \
+    libmysqlclient-dev libpq-dev \
+    libpcre3 libpcre3-dev \
+    libssl-dev libcurl4-openssl-dev \
+    zlib1g-dev \
+    libreadline6-dev \
+    libbz2-dev \
+    libxslt-dev libgdbm-dev ncurses-dev  \
+    libffi-dev libtool bison libevent-dev \
+    libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 \
+    liborc-0.4-0 libgnutls-dev \
+    libjson0-dev libmcrypt-dev libicu-dev \
+    re2c libnuma-dev
 
 RUN locale-gen en_US.UTF-8
 ENV LANG en_US.UTF-8  

+ 3 - 0
toolset/setup/linux/docker/languages/haskell.dockerfile

@@ -0,0 +1,3 @@
+FROM tfb/base:latest
+
+RUN curl -sSL https://get.haskellstack.org/ | sh

+ 21 - 0
toolset/setup/linux/docker/languages/nim.dockerfile

@@ -0,0 +1,21 @@
+FROM tfb/nginx:latest
+
+ENV NIM_VERSION="0.11.2"
+ENV NIM_CSOURCES="6bf2282"
+
+RUN wget https://github.com/nim-lang/Nim/archive/v$NIM_VERSION.tar.gz
+RUN tar xvf v$NIM_VERSION.tar.gz
+RUN mv Nim-$NIM_VERSION nim
+
+RUN cd nim && \
+    git clone git://github.com/nim-lang/csources.git && \
+    cd csources && \
+    git checkout $NIM_CSOURCES && \
+    sh build.sh && \
+    cd .. && \
+
+    bin/nim c koch && \
+    ./koch boot -d:release
+
+ENV NIM_HOME=/nim
+ENV PATH=${NIM_HOME}/bin:${PATH}

+ 12 - 0
toolset/setup/linux/docker/languages/rust.dockerfile

@@ -0,0 +1,12 @@
+FROM tfb/base:latest
+
+ENV RUST_VERSION="1.24.1"
+
+RUN wget https://static.rust-lang.org/dist/rust-${RUST_VERSION}-x86_64-unknown-linux-gnu.tar.gz
+RUN tar xvf rust-${RUST_VERSION}-x86_64-unknown-linux-gnu.tar.gz
+
+RUN cd rust-${RUST_VERSION}-x86_64-unknown-linux-gnu && \
+	./install.sh --prefix=/rust
+
+ENV LD_LIBRARY_PATH=/rust/lib:${LD_LIBRARY_PATH}
+ENV PATH=/rust/bin:${PATH}

+ 11 - 0
toolset/setup/linux/docker/systools/nimble.dockerfile

@@ -0,0 +1,11 @@
+FROM tfb/nim:latest
+  
+ENV NIMBLE_VERSION="0.6.2"
+
+RUN cd $NIM_HOME && \
+    wget https://github.com/nim-lang/nimble/archive/v$NIMBLE_VERSION.tar.gz && \
+    tar xvf v$NIMBLE_VERSION.tar.gz && \
+    mv nimble-$NIMBLE_VERSION nimble && \
+    cd nimble && \
+    ../bin/nim c src/nimble && \
+    mv src/nimble ../bin/

+ 0 - 19
toolset/setup/linux/frameworks/jester.sh

@@ -1,19 +0,0 @@
-#!/bin/bash
-
-fw_depends nim nimble
-
-fw_installed jester && return 0
-
-JESTER=$IROOT/jester
-
-git clone https://github.com/dom96/jester.git
-cd jester
-# 2015-06-25
-git checkout 71b8cc069a0d271d619c2dc41bc6479047885587
-nimble update
-# If ~/.nimble/pkgs/jester exists, write over it.
-echo 'y' | nimble install
-
-echo "export JESTER_HOME=${JESTER}" > $IROOT/jester.installed
-
-source $IROOT/jester.installed

+ 0 - 18
toolset/setup/linux/languages/haskell.sh

@@ -1,18 +0,0 @@
-#!/bin/bash 
-
-fw_installed haskell && return 0
-
-CABAL_HOME=/opt/cabal/1.20
-HASKELL_HOME=/opt/ghc/7.8.3
-
-# TODO: someday move away from apt
-sudo add-apt-repository -y ppa:hvr/ghc
-sudo apt-get update
-sudo apt-get install -y ghc-7.8.3 cabal-install-1.20 libpcre3-dev
-
-echo "export LANG=en_US.UTF-8" > $IROOT/haskell.installed
-echo "export CABAL_HOME=${CABAL_HOME}" >> $IROOT/haskell.installed
-echo "export HASKELL_HOME=${HASKELL_HOME}" >> $IROOT/haskell.installed
-echo -e "export PATH=\$HASKELL_HOME/bin:\$CABAL_HOME/bin:\$PATH" >> $IROOT/haskell.installed
-
-source $IROOT/haskell.installed

+ 0 - 18
toolset/setup/linux/languages/java8.sh

@@ -1,18 +0,0 @@
-#!/bin/bash
-
-fw_installed java8 && return 0
-
-# TODO: Someday get away from apt-get
-sudo add-apt-repository -y ppa:openjdk-r/ppa
-sudo apt-get update
-sudo apt-get install -qqy openjdk-8-jdk
-
-# https://bugs.launchpad.net/ubuntu/+source/ca-certificates-java/+bug/1396760
-sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure
-
-# Setup environment variables
-JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
-echo "export JAVA_HOME=${JAVA_HOME}" > $IROOT/java8.installed
-echo -e "export PATH=\$JAVA_HOME/bin:\$PATH" >> $IROOT/java8.installed
-
-source $IROOT/java8.installed

+ 0 - 28
toolset/setup/linux/languages/nim.sh

@@ -1,28 +0,0 @@
-#!/bin/bash
-
-fw_installed nim && return 0
-
-NIM_VERSION="0.11.2"
-NIM_CSOURCES="6bf2282"
-
-fw_get -O https://github.com/nim-lang/Nim/archive/v$NIM_VERSION.tar.gz
-fw_untar v$NIM_VERSION.tar.gz
-mv Nim-$NIM_VERSION nim
-cd nim
-
-git clone git://github.com/nim-lang/csources.git
-cd csources
-git checkout $NIM_CSOURCES
-sh build.sh
-cd ..
-
-bin/nim c koch
-
-# bootstrapping nim's compiler
-./koch boot -d:release
-
-echo "export NIM_HOME=${IROOT}/nim" > $IROOT/nim.installed
-echo -e "export PATH=\$NIM_HOME/bin:\$PATH" >> $IROOT/nim.installed
-
-source $IROOT/nim.installed
-

+ 0 - 17
toolset/setup/linux/languages/rust.sh

@@ -1,17 +0,0 @@
-#!/bin/bash
-
-RUST_VERSION="1.22.1"
-
-fw_installed rust && return 0
-
-fw_get -O https://static.rust-lang.org/dist/rust-${RUST_VERSION}-x86_64-unknown-linux-gnu.tar.gz
-fw_untar rust-${RUST_VERSION}-x86_64-unknown-linux-gnu.tar.gz
-(
-	cd rust-${RUST_VERSION}-x86_64-unknown-linux-gnu
-	./install.sh --prefix=$IROOT/rust
-)
-
-echo -e "export LD_LIBRARY_PATH=${IROOT}/rust/lib:\$LD_LIBRARY_PATH" > $IROOT/rust.installed
-echo -e "export PATH=${IROOT}/rust/bin:\$PATH" >> $IROOT/rust.installed
-
-source $IROOT/rust.installed

+ 0 - 21
toolset/setup/linux/systools/nimble.sh

@@ -1,21 +0,0 @@
-#!/bin/bash
-
-fw_depends nim
-
-fw_installed nimble && return 0
-  
-NIMBLE_VERSION="0.6.2"
-
-cd $NIM_HOME
-# nim's package manager
-fw_get -O https://github.com/nim-lang/nimble/archive/v$NIMBLE_VERSION.tar.gz
-fw_untar v$NIMBLE_VERSION.tar.gz
-mv nimble-$NIMBLE_VERSION nimble
-cd nimble
-../bin/nim c src/nimble
-mv src/nimble ../bin/
-
-cd $IROOT
-echo "" > $IROOT/nimble.installed
-
-source $IROOT/nimble.installed