Skip to content

Commit

Permalink
Add riot conf in deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Mar 15, 2019
1 parent 6265d93 commit cbad9db
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 1 deletion.
18 changes: 18 additions & 0 deletions deploy/aws/provision/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,24 @@
tags:
- start-storage

- hosts: riot
remote_user: ec2-user
become: true
vars_files:
- vars.yml
tasks:
- name: Restart riot
shell: >
{{ item }}
with_items:
- /var/qed/riot-stop.sh
- /var/qed/riot-start.sh
wait_for:
port: 7700
host: "{{ansible_hostname}}"
tags:
- start-storage

- hosts: prometheus
remote_user: ec2-user
become: true
Expand Down
12 changes: 11 additions & 1 deletion deploy/aws/provision/tasks/riot/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,14 @@
src: config_files/bin/{{ item }}
mode: 0777
with_items:
- riot
- riot

- name: Create QED start|stop script
template:
dest: /var/qed/{{ item }}
src: ../../templates/{{ item }}.j2
force: true
mode: 0775
with_items:
- riot-start.sh
- riot-stop.sh
29 changes: 29 additions & 0 deletions deploy/aws/provision/templates/riot-start.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{#
Copyright 2018 Banco Bilbao Vizcaya Argentaria, S.A.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}
#!/bin/bash

ulimit -n 819200

# 100 million requests
reqs=$((10**9))

export QED_HOME=/var/qed
nohup $QED_HOME/riot --api \
--n ${reqs} \
{% for host in groups['name_qed-0'] %}
--endpoint "{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }}:8400" \
{% endfor %}
>> $QED_HOME/qed.log 2>&1 &
18 changes: 18 additions & 0 deletions deploy/aws/provision/templates/riot-stop.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{#
Copyright 2018 Banco Bilbao Vizcaya Argentaria, S.A.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}
#!/bin/bash

killall riot || true

0 comments on commit cbad9db

Please sign in to comment.