Skip to content

Commit

Permalink
ansible: add rscript/wrk for benchmarking machines
Browse files Browse the repository at this point in the history
Fixes: nodejs#821
Fixes: nodejs#955
  • Loading branch information
maclover7 committed May 31, 2018
1 parent aa8b341 commit 41958ea
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
48 changes: 47 additions & 1 deletion ansible/roles/benchmarking/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: gather facts
setup:

- name: Install h2load dependencies
- name: Install packages
package:
name: "{{ package }}"
state: present
Expand All @@ -21,3 +21,49 @@
shell: "autoreconf -i && automake && autoconf && ./configure --enable-app && make -j4"
args:
chdir: "/home/{{ server_user }}/nghttp2"

- name: Download wrk git repo
git:
repo: https://github.com/wg/wrk.git
dest: "/home/{{ server_user }}/wrk"
force: yes

- name: Setup and compile wrk
shell: "make"
args:
chdir: "/home/{{ server_user }}/wrk"

- name: Install Rscript repo | ubuntu1404
when: os == "ubuntu1404"
shell: echo "deb https://ftp.heanet.ie/mirrors/cran.r-project.org/bin/linux/ubuntu trusty/" > /etc/apt/sources.list.d/r.list

- name: Install Rscript repo | ubuntu1604
when: os == "ubuntu1604"
shell: echo "deb https://ftp.heanet.ie/mirrors/cran.r-project.org/bin/linux/ubuntu xenial/" > /etc/apt/sources.list.d/r.list

- name: Add R key
apt_key:
keyserver: keyserver.ubuntu.com
id: E084DAB9

- name: Update keys
shell: "apt-key update"

- name: Update packages
include_role:
name: package-upgrade

- name: Install Rscript packages
package:
name: "{{ package }}"
state: present
loop_control:
loop_var: package
with_items:
- r-base

- name: Install ggplot2
shell: echo 'install.packages("ggplot2", repo="http://cran.us.r-project.org")' | R --no-save

- name: Install plyr
shell: echo 'install.packages("plyr", repo="http://cran.us.r-project.org")' | R --no-save
1 change: 1 addition & 0 deletions ansible/roles/benchmarking/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ packages:
- python-numpy
- python-requests
- zlib1g-dev
- build-essential
2 changes: 1 addition & 1 deletion ansible/roles/jenkins-worker/templates/systemd.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Environment="USER={{ server_user }}"
Environment="JOBS={{ jobs_env }}"
Environment="SHELL=/bin/bash"
Environment="HOME=/home/{{ server_user }}"
Environment="PATH=/home/{{ server_user }}/nghttp2/src:/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Environment="PATH=/home/{{ server_user }}/nghttp2/src:/home/{{ server_user }}/wrk:/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Environment="NODE_COMMON_PIPE=/home/{{ server_user }}/test.pipe"
Environment="NODE_TEST_DIR=/home/{{ server_user }}/tmp"
Environment="OSTYPE=linux-gnu"
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/jenkins-worker/templates/upstart.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env JOBS="{{ jobs_env }}"
env OSTYPE=linux-gnu

# default path in ubuntu 1404 plus ccache
env PATH="/home/{{ server_user }}/nghttp2/src:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
env PATH="/home/{{ server_user }}/nghttp2/src:/home/{{ server_user }}/wrk:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

setgid iojs
setuid iojs
Expand Down

0 comments on commit 41958ea

Please sign in to comment.