Commit 2fda4904 by Troy Sankey Committed by GitHub

Merge pull request #3783 from edx/pwnage101/loadtest-worker

infrastructure for building an AMI for a loadtest driver jenkins worker
parents e7010155 a216d927
# Configure a Jenkins worker instance
# This has all the requirements to run load tests.
- name: Configure instance(s)
hosts: jenkins_worker
become: True
gather_facts: True
vars:
loadtest_driver_worker: True
roles:
- aws
- jenkins_worker
......@@ -46,3 +46,7 @@ dependencies:
android_apt_libraries:
- lib32stdc++6
- lib32z1
# dependencies for loadtest driver worker
- role: loadtest_driver
when: loadtest_driver_worker is defined
---
# ulimit variables
ulimit_config:
- domain: '*'
type: soft
item: nofile
value: 4096
- domain: '*'
type: hard
item: nofile
value: 4096
ulimit_conf_file: "/etc/security/limits.conf"
---
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Role includes for role loadtest_driver
#
dependencies:
- common
---
# configure a machine for driving loadtests.
# Specifically, we want to allow as many open connections as possible, to
# simulate more locust clients.
- name: Increase file descriptor limit of the system
lineinfile:
dest: "{{ ulimit_conf_file }}"
line: "{{ item.domain }} {{ item.type }} {{ item.item }} {{ item.value }}"
with_items: "{{ ulimit_config }}"
......@@ -12,6 +12,7 @@
#
dependencies:
- common
- loadtest_driver
- role: edx_service
edx_service_name: "{{ locust_service_name }}"
edx_service_config: "{{ LOCUST_SERVICE_CONFIG }}"
......
......@@ -19,6 +19,7 @@
#
# Dependencies:
# - edx-service role
# - loadtest_driver role
# - load tests repo with locust tests in it.
#
# Example play:
......@@ -38,14 +39,6 @@
state: present
become_user: "{{ locust_user }}"
# Specifically, we are concerned about allowing as many open connections as
# possible, to simulate more locust clients.
- name: Increase file descriptor limit of the system (Session Logout and Login would be required)
lineinfile:
dest: "{{ ulimit_conf_file }}"
line: "{{ item.domain }} {{ item.type }} {{ item.item }} {{ item.value }}"
with_items: "{{ ulimit_config }}"
- name: Configure locust user with an interactive shell
user:
name: "{{ locust_user }}"
......
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"playbook_remote_dir": "/tmp/packer-edx-playbooks",
"venv_dir": "/edx/app/edx_ansible/venvs/edx_ansible",
"ami": "{{env `JENKINS_WORKER_AMI`}}",
"delete_or_keep": "{{env `DELETE_OR_KEEP_AMI`}}",
"remote_branch": "{{env `REMOTE_BRANCH`}}"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"ami_name": "jenkins_worker_loadtest_driver-{{isotime | clean_ami_name}}",
"instance_type": "m3.medium",
"region": "us-east-1",
"source_ami": "{{user `ami`}}",
"ssh_username": "ubuntu",
"ami_description": "jenkins worker loadtest driver",
"iam_instance_profile": "jenkins-worker",
"security_group_id": "sg-75af5e18",
"tags": {
"delete_or_keep": "{{user `delete_or_keep`}}"
}
}],
"provisioners": [{
"type": "shell",
"inline": ["rm -rf {{user `playbook_remote_dir`}}",
"mkdir {{user `playbook_remote_dir`}}"]
}, {
"type": "file",
"source": "stop-automatic-updates.sh",
"destination": "{{user `playbook_remote_dir`}}/stop-automatic-updates.sh"
}, {
"type": "file",
"source": "../../util/install/ansible-bootstrap.sh",
"destination": "{{user `playbook_remote_dir`}}/ansible-bootstrap.sh"
}, {
"type": "shell",
"inline": ["cd {{user `playbook_remote_dir`}}",
"export CONFIGURATION_VERSION='{{user `remote_branch`}}'",
"sudo bash ./stop-automatic-updates.sh",
"sudo bash ./ansible-bootstrap.sh" ]
}, {
"type": "ansible-local",
"playbook_file": "../../playbooks/edx-east/jenkins_worker_loadtest_driver.yml",
"playbook_dir": "../../playbooks",
"command": ". {{user `venv_dir`}}/bin/activate && ansible-playbook",
"inventory_groups": "jenkins_worker",
"extra_arguments": [ "-vvv" ]
}]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment