Browse Source

Deployment: Add support for setting virtual box cpu count

Hamilton Turner 11 years ago
parent
commit
500ad10c4b
3 changed files with 17 additions and 5 deletions
  1. 14 1
      README.md
  2. 2 3
      deployment/vagrant-common/core.rb
  3. 1 1
      deployment/vagrant-virtualbox/README.md

+ 14 - 1
README.md

@@ -21,6 +21,19 @@ or chat with us on [Freenode](https://freenode.net/faq.shtml#whatwhy) at `#teche
 
 
 [Setup a development environment](deployment), typically by using a 
 [Setup a development environment](deployment), typically by using a 
 remote server dedicated to this project or by using a virtual machine. 
 remote server dedicated to this project or by using a virtual machine. 
+Here's a short example: 
+    
+```
+# Clone the project, then move into the right directory
+$ cd ~/FrameworkBenchmarks/deployment/vagrant-development
+# Turn on the VM. Takes at least 20 minutes
+$ vagrant up
+# Enter the VM, then run a test
+$ vagrant ssh
+vagrant@TFB-all:~$ cd ~/FrameworkBenchmarks
+vagrant@TFB-all:~/FrameworkBenchmarks$ toolset/run-tests.py --install server --mode verify --test beego
+```
+
 Then enable Travis-CI on your project fork, so that any commits you send
 Then enable Travis-CI on your project fork, so that any commits you send
 to Github are automatically verified for correctness (e.g. meeting all 
 to Github are automatically verified for correctness (e.g. meeting all 
 [benchmark requirements](http://www.techempower.com/benchmarks/#section=code)). 
 [benchmark requirements](http://www.techempower.com/benchmarks/#section=code)). 
@@ -127,7 +140,7 @@ toolset/run-tests.py --install server --verbose --install-only
 You can easily list all available tests
 You can easily list all available tests
 
 
 ```
 ```
-╰─$ toolset/run-tests.py --list-tests
+$ toolset/run-tests.py --list-tests
 activeweb
 activeweb
 activeweb-raw
 activeweb-raw
 aspnet
 aspnet

+ 2 - 3
deployment/vagrant-common/core.rb

@@ -90,9 +90,8 @@ def provider_virtualbox(config, role)
       vb.gui = true
       vb.gui = true
     end
     end
 
 
-    if ENV.fetch('TFB_VB_MEM', 2048)
-      vb.customize ["modifyvm", :id, "--memory", "2048"]
-    end
+    vb.memory = ENV.fetch('TFB_VB_MEM', 2048)
+    vb.cpus = ENV.fetch('TFB_VB_CPU', 2)
 
 
     override.vm.synced_folder "../..", "/FrameworkBenchmarks"
     override.vm.synced_folder "../..", "/FrameworkBenchmarks"
 
 

+ 1 - 1
deployment/vagrant-virtualbox/README.md

@@ -9,4 +9,4 @@ that modify how TFB launches your Virtuabox virtual machines.
 | `TFB_VB_SHOW`                    | `true,false`        | Show the VM in a window when running? Default is false
 | `TFB_VB_SHOW`                    | `true,false`        | Show the VM in a window when running? Default is false
 | `TFB_VB_ARCH`                    | `64,32`             | Used to force TFB to run a 32-bit virtual machine. This is unsupported, as many of the framework binaries we download are 64-bit only and will not launch. If you cannot run a 64-bit VM, then we recommend using the Amazon AWS provider instead of using this variable
 | `TFB_VB_ARCH`                    | `64,32`             | Used to force TFB to run a 32-bit virtual machine. This is unsupported, as many of the framework binaries we download are 64-bit only and will not launch. If you cannot run a 64-bit VM, then we recommend using the Amazon AWS provider instead of using this variable
 | `TFB_VB_MEM`                     | `<number>` e.g. `2048` | Size of VM's RAM in MB. Default is `2048`
 | `TFB_VB_MEM`                     | `<number>` e.g. `2048` | Size of VM's RAM in MB. Default is `2048`
-
+| `TFB_VB_CPU`                     | `<number>` e.g. `2` | Number of host CPUs that the VM can access