Commit e92cda3e authored by Rafael Monnerat's avatar Rafael Monnerat

Monitor: Accept slaves on distributor software type

  Each slave can introduce test parameter to be tested.
  Each slave has a log dedicated folder.
parent 3607fde4
...@@ -78,6 +78,26 @@ Alias /{{ monitor_private_hash }} {{ directory.get('private-directory') }}/ ...@@ -78,6 +78,26 @@ Alias /{{ monitor_private_hash }} {{ directory.get('private-directory') }}/
</Files> </Files>
</Directory> </Directory>
{% set slave_list = json_module.loads(slave_information.get('slave_instance_list')) -%}
{% for slave_instance in slave_list -%}
alias /{{ slave_instance.get('slave_reference') }} {{ directory.get('private-directory') }}/network-user-logs/{{ slave_instance.get('slave_reference') }}
<Directory {{ directory.get('private-directory') }}/network-user-logs/{{ slave_instance.get('slave_reference') }}>
Order Allow,Deny
Allow from all
AllowOverride All
Satisfy Any
Options Indexes FollowSymLinks
DirectoryIndex index.html
<Files .htaccess>
order allow,deny
deny from all
</Files>
</Directory>
{% endfor -%}
<Location /rewrite> <Location /rewrite>
AuthType Basic AuthType Basic
AuthName "Private access" AuthName "Private access"
......
[buildout] [buildout]
extends = {{ instance_base_monitor }} extends = {{ instance_base_monitor }}
parts +=
slave-test-configuration
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = ${buildout:directory}/${:filename}
extra-context =
context =
import json_module json
${:extra-context}
[slave-test-configuration]
<=jinja2-template-base
template = {{ template_json_distributor_test }}
filename = srv/monitor-private/test.json
extensions = jinja2.ext.do
extra-context =
section slave_information slap-parameter
[monitor-directory]
network-user-logs = ${:private-directory}/network-user-logs/
{% for slave_instance in slave_instance_list -%}
user-log-{{ slave_instance.get('slave_reference') }}-folder = ${:private-directory}/network-user-logs/{{ slave_instance.get('slave_reference') }}
{% endfor -%}
{% set part_list = [] -%}
# Publish information for each slave
{% for slave_instance in slave_instance_list -%}
{% set publish_section_title = 'publish-%s' % slave_instance.get('slave_reference') -%}
{% do part_list.append(publish_section_title) -%}
[{{ publish_section_title }}]
recipe = slapos.cookbook:publish
-slave-reference = {{ slave_instance.get('slave_reference') }}
log-access-url = ${monitor-frontend:connection-site_url}/{{ slave_instance.get('slave_reference') }}
log-access-url-v6 = ${monitor-parameters:url}/{{ slave_instance.get('slave_reference') }}
{% endfor %}
[buildout]
parts +=
{% for part in part_list %}
{{ ' %s' % part }}
{% endfor %}
...@@ -87,22 +87,25 @@ config-url = ${monitor-parameters:url} ...@@ -87,22 +87,25 @@ config-url = ${monitor-parameters:url}
config-domain = ${slap-parameter:frontend-domain} config-domain = ${slap-parameter:frontend-domain}
return = site_url domain return = site_url domain
server-url = $${slap-connection:server-url} server-url = ${slap-connection:server-url}
key-file = $${slap-connection:key-file} key-file = ${slap-connection:key-file}
cert-file = $${slap-connection:cert-file} cert-file = ${slap-connection:cert-file}
computer-id = $${slap-connection:computer-id} computer-id = ${slap-connection:computer-id}
partition-id = $${slap-connection:partition-id} partition-id = ${slap-connection:partition-id}
[publish-connection-informations] [publish-connection-informations]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
monitor_url = $${monitor-parameters:url} monitor_url = ${monitor-parameters:url}
server_log_url = $${:url}$${slap-parameter:private-hash}/ server_log_url = ${:url}${slap-parameter:private-hash}/
url = $${monitor-frontend:connection-site_url} url = ${monitor-frontend:connection-site_url}
[monitor-httpd-configuration-file] [monitor-httpd-configuration-file]
context = context =
import json_module json
section directory monitor-directory section directory monitor-directory
section monitor_parameters monitor-parameters section monitor_parameters monitor-parameters
section httpd_configuration monitor-httpd-configuration section httpd_configuration monitor-httpd-configuration
section monitor_rewrite_rule monitor-rewrite-rule section monitor_rewrite_rule monitor-rewrite-rule
section slave_information slap-parameter
key monitor_private_hash slap-parameter:private-hash key monitor_private_hash slap-parameter:private-hash
...@@ -28,11 +28,14 @@ recipe = slapos.recipe.template:jinja2 ...@@ -28,11 +28,14 @@ recipe = slapos.recipe.template:jinja2
template = ${template-monitor-distributor:destination} template = ${template-monitor-distributor:destination}
rendered = $${buildout:directory}/template-monitor-distributor.cfg rendered = $${buildout:directory}/template-monitor-distributor.cfg
extensions = jinja2.ext.do extensions = jinja2.ext.do
context = key buildout buildout:bin-directory context = import json_module json
key buildout buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration key slapparameter_dict slap-configuration:configuration
key instance_base_monitor instance-base-monitor:rendered key instance_base_monitor instance-base-monitor:rendered
key slave_instance_list slap-configuration:slave-instance-list
key template_json_distributor_test slap-configuration:json_test_template
mode = 0644 mode = 0644
[slap-configuration] [slap-configuration]
...@@ -44,3 +47,4 @@ key = $${slap-connection:key-file} ...@@ -44,3 +47,4 @@ key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file} cert = $${slap-connection:cert-file}
monitor_template_output = ${monitor-template:output} monitor_template_output = ${monitor-template:output}
network_benck_cfg_output = ${network-bench-cfg:output} network_benck_cfg_output = ${network-bench-cfg:output}
json_test_template = ${json-test-template:destination}
{% set slave_list = json_module.loads(slave_information.get('slave_instance_list')) -%}
{
"id" :
[
{% for slave_instance in slave_list -%}
{% if slave_instance != slave_list[-1] -%}
"{{ slave_instance.get('slave_reference') }}",
{% endif -%}
{% if slave_instance == slave_list[-1] -%}
"{{ slave_instance.get('slave_reference') }}"
{% endif -%}
{% endfor -%}
],
"ipv4" :
[
{% for slave_instance in slave_list -%}
{% if slave_instance.get('ping_ip_list') not in [None, "", "0.0.0.0"] -%}
{% if slave_instance != slave_list[-1] -%}
"{{ slave_instance.get('ping_ip_list') }}",
{% endif %}
{% if slave_instance == slave_list[-1] -%}
"{{ slave_instance.get('ping_ip_list') }}"
{% endif -%}
{% endif -%}
{% endfor -%}
],
"ipv6" :
[
{% for slave_instance in slave_list -%}
{% if slave_instance.get('ping6_ip_list') not in [None, "", "0.0.0.0"] -%}
{% if slave_instance != slave_list[-1] -%}
"{{ slave_instance.get('ping6_ip_list') }}",
{% endif -%}
{% if slave_instance == slave_list[-1] -%}
"{{ slave_instance.get('ping6_ip_list') }}"
{% endif -%}
{% endif -%}
{% endfor -%}
],
"url" :
[
{% for slave_instance in slave_list -%}
{% if slave_instance.get('test_http_url_list') not in [None, ""] -%}
{% if slave_instance != slave_list[-1] -%}
"{{ slave_instance.get('test_http_url_list') }}",
{% endif -%}
{% if slave_instance == slave_list[-1] -%}
"{{ slave_instance.get('test_http_url_list') }}"
{% endif -%}
{% endif -%}
{% endfor -%}
],
"dns" :
[
{% for slave_instance in slave_list -%}
{% if slave_instance.get('test_name_list') not in [None, ""] -%}
{% if slave_instance != slave_list[-1] -%}
"{{ slave_instance.get('test_name_list') }}",
{% endif -%}
{% if slave_instance == slave_list[-1] -%}
"{{ slave_instance.get('test_name_list') }}"
{% endif -%}
{% endif -%}
{% endfor -%}
]
}
...@@ -9,8 +9,9 @@ extends = ...@@ -9,8 +9,9 @@ extends =
parts = parts =
slapos-cookbook slapos-cookbook
slapos-toolbox slapos-toolbox
template
network-bench-cfg network-bench-cfg
json-test-template
template
template-monitor-distributor template-monitor-distributor
template-monitor template-monitor
eggs eggs
...@@ -20,23 +21,31 @@ parts = ...@@ -20,23 +21,31 @@ parts =
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
md5sum = 4402626ed57cc9e27eb4282839fbfb99 md5sum = 9225d232336515091191146cd34f30b9
mode = 0644 mode = 0644
[template-monitor] [template-monitor]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-monitor.cfg.jinja2 url = ${:_profile_base_location_}/instance-monitor.cfg.jinja2
destination = ${buildout:directory}/template-monitor.cfg destination = ${buildout:directory}/template-monitor.cfg
md5sum = c11064c5b529b9dfeec6549f04dfd078 md5sum = 810ed8199682068e27b62659d7fa101f
mode = 0644 mode = 0644
[template-monitor-distributor] [template-monitor-distributor]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/instance-monitor-distributor.cfg.jinja2 url = ${:_profile_base_location_}/instance-monitor-distributor.cfg.jinja2
destination = ${buildout:directory}/template-monitor-distributor.cfg destination = ${buildout:directory}/template-monitor-distributor.cfg
md5sum = a58e9c20ab71d7353d4dae6daaccbd31 md5sum = c012cf53a3f66c319db2a5d8226fa627
mode = 0644
[json-test-template]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/json-test-template.json.in.jinja2
destination = ${buildout:directory}/json-test-template.json.in.jinja2
md5sum = d9c576a2182fc429416aec892fe080f2
mode = 0644 mode = 0644
# stupify index for now # stupify index for now
[index] [index]
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
...@@ -44,7 +53,7 @@ md5sum = 876f18b159fbd9325332d0f42e9172ac ...@@ -44,7 +53,7 @@ md5sum = 876f18b159fbd9325332d0f42e9172ac
[monitor-httpd-template] [monitor-httpd-template]
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
md5sum = 1f30b17f5ea11fd033984d17c38bcfd3 md5sum = 25b5bfc7f9c2891c4a0923d6e08568a8
[network-bench-cfg] [network-bench-cfg]
recipe = slapos.recipe.template recipe = slapos.recipe.template
......
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