This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9338 from alphagov/gatling
add puppet node & class for Gatling
- Loading branch information
Showing
7 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# == Class: govuk::node::s_gatling | ||
# | ||
# This machine class is used to run Gatling, a load testing tool. | ||
# | ||
# === Parameters | ||
# | ||
# [*root_dir*] | ||
# The root of the website where Gatling stores its results | ||
# Default = '/home/gatling/gatling-software/results' | ||
# | ||
# [*repo*] | ||
# The github repository where GOV.UK defines its load tests | ||
# Default = '[email protected]:alphagov/govuk-load-testing.git' | ||
# | ||
# [*commit*] | ||
# The version of the repository where GOV.UK defines its load tests | ||
# Default = 'master' | ||
# | ||
# | ||
# | ||
class govuk::node::s_gatling ( | ||
$root_dir = '/usr/local/bin/gatling/results', | ||
$repo = 'https://github.com/alphagov/govuk-load-testing.git', | ||
$commit = 'master', | ||
$apt_mirror_hostname = undef, | ||
) inherits govuk::node::s_base { | ||
|
||
# User used to run Gatling | ||
govuk_user { 'gatling': | ||
fullname => 'GOV.UK Gatling', | ||
email => '[email protected]', | ||
groups => ['admin', 'deploy', 'adm', 'www-data' ], | ||
} | ||
|
||
# repository where GOV.UK stores its load tests | ||
vcsrepo { '/home/gatling/govuk-load-testing': | ||
ensure => present, | ||
provider => git, | ||
source => $repo, | ||
revision => $commit, | ||
force => true, | ||
} | ||
|
||
# install the JRE and JDK on the Gatling instance | ||
include ::govuk_java::openjdk8::jre | ||
include ::govuk_java::openjdk8::jdk | ||
class { 'govuk_java::set_defaults': | ||
jdk => 'openjdk8', | ||
jre => 'openjdk8', | ||
} | ||
|
||
apt::source { 'govuk-gatling': | ||
location => "http://${apt_mirror_hostname}/govuk-gatling", | ||
release => 'trusty', | ||
architecture => $::architecture, | ||
repos => 'main', | ||
key => '3803E444EB0235822AA36A66EC5FE1A937E3ACBB', | ||
} | ||
|
||
package { 'govuk-gatling': | ||
ensure => latest, | ||
name => 'gatling-3.1.3.deb', | ||
require => Apt::Source['govuk-gatling'], | ||
} | ||
|
||
file { '/usr/local/bin/gatling': | ||
ensure => directory, | ||
mode => '0777', | ||
recurse => true, | ||
require => Package['govuk-gatling'], | ||
} | ||
|
||
include nginx | ||
nginx::config::site { 'gatling_service': | ||
content => template('govuk/node/s_gatling/gatling_cluster_vhost.conf.erb'), | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
modules/govuk/templates/node/s_gatling/gatling_cluster_vhost.conf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server { | ||
server_name gatling.* gatling-origin.*; | ||
root <%= @root_dir -%>; | ||
|
||
access_log /var/log/nginx/gatling-access.log timed_combined; | ||
access_log /var/log/nginx/gatling-json.event.access.log json_event; | ||
error_log /var/log/nginx/gatling-error.log; | ||
|
||
location / { | ||
autoindex on; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
'mongo-api-1', | ||
'prometheus-1', | ||
'search-1', | ||
'gatling-1', | ||
] | ||
|
||
if ! ($::hostname in $whitelist) { | ||
|