From 269bd838f330de1ac8cf732f4666e79191a6734c Mon Sep 17 00:00:00 2001 From: Nikita Sokolov Date: Fri, 17 May 2019 19:03:57 +0300 Subject: [PATCH] Ansible flamestream lenta bench --- benchmark/ansible/flamestream.yml | 2 +- .../roles/flamestream-bench/tasks/main.yml | 4 +-- .../flamestream-lenta-bench/files/.gitkeep | 0 .../flamestream-lenta-bench/tasks/main.yml | 35 +++++++++++++++++++ .../templates/bench.conf.j2 | 10 ++++++ .../templates/deployer.conf.j2 | 5 +++ 6 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 benchmark/ansible/roles/flamestream-lenta-bench/files/.gitkeep create mode 100644 benchmark/ansible/roles/flamestream-lenta-bench/tasks/main.yml create mode 100644 benchmark/ansible/roles/flamestream-lenta-bench/templates/bench.conf.j2 create mode 100644 benchmark/ansible/roles/flamestream-lenta-bench/templates/deployer.conf.j2 diff --git a/benchmark/ansible/flamestream.yml b/benchmark/ansible/flamestream.yml index c55044021..e3644d23e 100644 --- a/benchmark/ansible/flamestream.yml +++ b/benchmark/ansible/flamestream.yml @@ -47,7 +47,7 @@ - name: Run the benchmark hosts: bench roles: - - { role: flamestream-bench , bench_class: com.spbsu.flamestream.example.benchmark.LentaBenchStand } + - { role: flamestream-lenta-bench , bench_class: com.spbsu.flamestream.example.benchmark.LentaBenchStand } - name: Destroy flamestream hosts: workers diff --git a/benchmark/ansible/roles/flamestream-bench/tasks/main.yml b/benchmark/ansible/roles/flamestream-bench/tasks/main.yml index 0e6c059b7..3d80ba34c 100644 --- a/benchmark/ansible/roles/flamestream-bench/tasks/main.yml +++ b/benchmark/ansible/roles/flamestream-bench/tasks/main.yml @@ -1,7 +1,7 @@ --- - name: Copy the wiki dump copy: - src: lenta-ru-news.csv + src: wiki.xml dest: "{{ flamestream_dir }}/wiki.xml" - name: Copy the deployer file @@ -21,8 +21,6 @@ -cp '{{ flamestream_dir }}/lib/*' {{ bench_class }} {{ flamestream_dir }}/bench.conf {{ flamestream_dir }}/deployer.conf > {{ flamestream_dir }}/bench.log 2>&1 - environment: - LOCAL_ADDRESS: "{{ inventory_hostname }}:{{ flamestream_worker_port }}" - name: Fetch bench logs fetch: diff --git a/benchmark/ansible/roles/flamestream-lenta-bench/files/.gitkeep b/benchmark/ansible/roles/flamestream-lenta-bench/files/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/benchmark/ansible/roles/flamestream-lenta-bench/tasks/main.yml b/benchmark/ansible/roles/flamestream-lenta-bench/tasks/main.yml new file mode 100644 index 000000000..7a6592609 --- /dev/null +++ b/benchmark/ansible/roles/flamestream-lenta-bench/tasks/main.yml @@ -0,0 +1,35 @@ +--- +- name: Copy the lenta feed + copy: + src: lenta-ru-news.csv + dest: "{{ flamestream_dir }}/lenta-ru-news.csv" + +- name: Copy the deployer file + template: + src: deployer.conf.j2 + dest: "{{ flamestream_dir }}/deployer.conf" + +- name: Copy the bench configuration file + template: + src: bench.conf.j2 + dest: "{{ flamestream_dir }}/bench.conf" + +- name: Start the flamestream bench + shell: > + java + -Daeron.term.buffer.length=4194304 -Daeron.mtu.length=16384 -Xms500m -Xmx500m -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError + -cp '{{ flamestream_dir }}/lib/*' + {{ bench_class }} + {{ flamestream_dir }}/bench.conf {{ flamestream_dir }}/deployer.conf > {{ flamestream_dir }}/bench.log 2>&1 + +- name: Fetch bench logs + fetch: + src: "{{ flamestream_dir }}/bench.log" + dest: "{{ results_dir }}/flamestream/bench.log" + flat: true + +- name: Fetch latencies + fetch: + src: /tmp/lat.data + dest: "{{ results_dir }}/flamestream/latency/lat.data" + flat: true diff --git a/benchmark/ansible/roles/flamestream-lenta-bench/templates/bench.conf.j2 b/benchmark/ansible/roles/flamestream-lenta-bench/templates/bench.conf.j2 new file mode 100644 index 000000000..7652b6598 --- /dev/null +++ b/benchmark/ansible/roles/flamestream-lenta-bench/templates/bench.conf.j2 @@ -0,0 +1,10 @@ +benchmark { + bench-host = "{{ groups['bench'][0] }}" + input-host = "{{ groups['input'][0] }}" + bench-source-port = 4567 + bench-sink-port = 5678 + + lenta-dump-path = "{{ flamestream_dir }}/lenta-ru-news.csv" + sleep-between-docs-ms = {{ rate }} + validator = com.spbsu.flamestream.example.benchmark.validators.{{ validator }} +} \ No newline at end of file diff --git a/benchmark/ansible/roles/flamestream-lenta-bench/templates/deployer.conf.j2 b/benchmark/ansible/roles/flamestream-lenta-bench/templates/deployer.conf.j2 new file mode 100644 index 000000000..ddba4b605 --- /dev/null +++ b/benchmark/ansible/roles/flamestream-lenta-bench/templates/deployer.conf.j2 @@ -0,0 +1,5 @@ +deployer { + remote { + zk = "{{ groups['manager'][0] }}:{{ zookeeper_client_port }}" + } +} \ No newline at end of file