Commit 1ea59181 authored by Rafael Monnerat's avatar Rafael Monnerat

Merge branch 'master' into '1.0'

Master

Release Candidate

See merge request !14
parents 88976343 72d90603
......@@ -7,10 +7,11 @@ extends =
[fluentd]
recipe = rubygemsrecipe
url = https://rubygems.org/rubygems/rubygems-2.4.8.zip
ruby-executable = ${ruby:location}/bin/ruby
gems =
fluentd
gem-options = --with-icu-lib=${icu:location}/lib/ --with-icu-dir=${icu:location}/
fluentd==0.12.15
gem-options = --no-ri --no-rdoc --with-icu-lib=${icu:location}/lib/ --with-icu-dir=${icu:location}/
environment =
LDFLAGS = -L${icu:location}/lib -Wl,-rpath=${icu:location}/lib
CFLAGS = -I${icu:location}/include
......@@ -28,6 +28,7 @@ virtual_hard_drive_gzipped = '%(virtual-hard-drive-gzipped)s'.strip().lower()
nat_rules = '%(nat-rules)s'.strip()
use_tap = '%(use-tap)s'.lower()
use_nat = '%(use-nat)s'.lower()
enable_vhost = '%(enable-vhost)s'.lower()
tap_interface = '%(tap-interface)s'
listen_ip = '%(ipv4)s'
mac_address = '%(mac-address)s'
......@@ -208,13 +209,16 @@ if use_nat == 'true':
rules += ',guestfwd=tcp:10.0.2.101:443-cmd:%%s %%s %%s' %% (netcat_bin,
cluster_doc_host, cluster_doc_port)
nat_network_parameter = ['-netdev', rules,
'-device', 'e1000,netdev=lan%%s,mac=%%s' %% (number, mac_address)]
'-device', 'virtio-net-pci,netdev=lan%%s,mac=%%s' %% (number, mac_address)]
if use_tap == 'true':
number += 1
vhost = ''
if enable_vhost == 'true':
vhost = ',vhost=on'
tap_network_parameter = ['-netdev',
'tap,id=lan%%s,ifname=%%s,script=no,downscript=no' %% (number,
tap_interface),
'-device', 'e1000,netdev=lan%%s,mac=%%s' %% (number, tap_mac_address)]
'tap,id=lan%%s,ifname=%%s,script=no,downscript=no%%s' %% (number,
tap_interface, vhost),
'-device', 'virtio-net-pci,netdev=lan%%s,mac=%%s' %% (number, tap_mac_address)]
smp = smp_count
if smp_options:
......
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"port": {
"title": "Backend port",
"description": "Port where the service is running on the backend",
"default": 80,
"type": "integer"
},
"frontend-custom_domain": {
"title": "Custom Domain",
"description": "Custom Domain to use for the website",
"type": "string",
"pattern": "^([a-zA-Z0-9]([a-zA-Z0-9\\-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,6}$"
},
"frontend-server-alias": {
"title": "Server Alias",
"description": "Server Alias List separated by space",
"type": "string",
"default": ""
},
"frontend-type": {
"title": "Backend Type",
"description": "Type of slave. If redirect, the slave will redirect to the given url. If zope, the rewrite rules will be compatible with Virtual Host Monster",
"type": "string",
"default": "",
"enum": ["", "zope", "redirect"]
},
"frontend-path": {
"title": "Backend Path",
"description": "Path to proxy to in the backend",
"type": "string",
"default": ""
},
"frontend-default-path": {
"title": "Default Path",
"description": "Provide default path to redirect user to",
"type": "string",
"default": ""
},
"frontend-ssl_crt": {
"title": "SSL Certificate",
"description": "SSL Certificate",
"type": "string",
"default": ""
},
"frontend-ssl_key": {
"title": "SSL Key",
"description": "SSL Key",
"type": "string",
"default": ""
},
"frontend-ssl_ca_crt": {
"title": "SSL Certificate Authority's Certificate",
"description": "SSL Key",
"type": "string",
"default": ""
},
"frontend-https-only": {
"title": "HTTPS Only",
"description": "If set to true, http request are redirect to https",
"type": "string",
"default": "false",
"enum": ["false", "true"]
},
"frontend-ssl-proxy-verify": {
"title": "Verify Backend Certificates",
"description": "If set to true, Backend Certificates are checked",
"type": "string",
"default": "false",
"enum": ["false", "true"]
},
"frontend-ssl_proxy_ca_crt": {
"title": "SSL Backend Authority's Certificate",
"description": "SSL Certificate Authority of the backen (to be used with ssl-proxy-verify)",
"type": "string",
"default": ""
},
"frontend-enable_cache": {
"title": "Enable Cache",
"description": "If set to true, the cache is used",
"type": "string",
"default": "false",
"enum": ["false", "true"]
},
"frontend-disable-no-cache-request": {
"title": "Disable 'no-cache' requests",
"description": "If set to true, no-cache control headers will be disabled",
"type": "string",
"default": "false",
"enum": ["false", "true"]
},
"frontend-disable-via-header": {
"title": "Disable 'Via' headers from cache",
"description": "If set to true, via headers will be disabled",
"type": "string",
"default": "false",
"enum": ["false", "true"]
},
"frontend-prefer-gzip-encoding-to-backend": {
"title": "Prefer gzip Encoding for Backend",
"description": "If set to true, if a request is made with accept encoding 'gzip', only that one will be transferred to the backend",
"type": "string",
"default": "false",
"enum": ["false", "true"]
},
"frontend-disabled-cookie-list": {
"title": "Disabled Cookies",
"description": "List of Cookies separated by space that will not be sent to the backend",
"type": "string",
"default": ""
}
}
}
[buildout]
parts =
request-re6stnet-token-slave
request-frontend-token-slave
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
# Create all needed directories
[directory]
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
etc = $${:home}/etc/
var = $${:home}/var/
srv = $${:home}/srv/
bin = $${:home}/bin/
tmp = $${:home}/tmp/
[request-frontend-token-slave]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = WebSite Frontend
# XXX We have hardcoded SR URL here.
software-url = product.frontend
slave = true
config-url = http://$${request-re6stnet-token-slave:connection-ipv6}/
config-domain = $${slap-parameter:frontend-domain}
return = site_url domain
[request-re6stnet-token-slave]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Re6st token Frontend
# XXX We have hardcoded SR URL here.
software-url = product.re6st
slave = true
return = token info_1 ipv6
[publish-connection-informations]
recipe = slapos.cookbook:publish
url = https://$${request-frontend-token-slave:connection-domain}
token = $${request-re6stnet-token-slave:connection-token}
ipv6 = $${request-re6stnet-token-slave:connection-ipv6}
info_1 = $${request-re6stnet-token-slave:info_1}
\ No newline at end of file
[buildout]
parts =
request-re6stnet-token-slave
request-frontend-token-slave
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
# Create all needed directories
[directory]
recipe = slapos.cookbook:mkdirectory
home = $${buildout:directory}
etc = $${:home}/etc/
var = $${:home}/var/
srv = $${:home}/srv/
bin = $${:home}/bin/
tmp = $${:home}/tmp/
[request-frontend-token-slave]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = WebSite Frontend
# XXX We have hardcoded SR URL here.
software-url = product.frontend
slave = true
{% if slapparameter_dict.get('frontend-custom_domain', '80') != '443' %}
config-url = https://[$${request-re6stnet-token-slave:connection-ipv6}1]:{{ slapparameter_dict.get('port', '80') }}/
{% endif -%}
{% if slapparameter_dict.get('frontend-custom_domain', '80') == '443' %}
config-url = https://[$${request-re6stnet-token-slave:connection-ipv6}1]:{{ slapparameter_dict.get('port', '443') }}/
{% endif -%}
{% if slapparameter_dict.get('frontend-custom_domain', '') %}
config-custom_domain = {{ slapparameter_dict.get('frontend-custom_domain', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-server-alias', '') %}
config-server-alias = {{ slapparameter_dict.get('frontend-server-alias', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-type', '') %}
config-type = {{ slapparameter_dict.get('frontend-type', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-path', '') %}
config-path = {{ slapparameter_dict.get('frontend-path', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-default-path', '') %}
config-default-path = {{ slapparameter_dict.get('frontend-default-path', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-ssl_crt', '') %}
config-ssl_crt = {{ slapparameter_dict.get('frontend-ssl_crt', '').split('\n') | join('\n ') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-ssl_key', '') %}
config-ssl_key = {{ slapparameter_dict.get('frontend-ssl_key', '').split('\n') | join('\n ') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-ssl_ca_crt', '') %}
config-ssl_ca_crt = {{ slapparameter_dict.get('frontend-ssl_ca_crt', '').split('\n') | join('\n ') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-https-only', '') %}
config-https-only = {{ slapparameter_dict.get('frontend-https-only', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-ssl-proxy-verify', '') %}
config-ssl-proxy-verify = {{ slapparameter_dict.get('frontend-ssl-proxy-verify', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-ssl_proxy_ca_crt', '') %}
config-ssl_proxy_ca_crt = {{ slapparameter_dict.get('frontend-ssl_proxy_ca_crt', '').split('\n') | join('\n ') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-enable_cache', '') %}
config-enable_cache = {{ slapparameter_dict.get('frontend-enable_cache', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-disable-no-cache-request', '') %}
config-disable-no-cache-request = {{ slapparameter_dict.get('frontend-disable-no-cache-request', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-disable-via-header', '') %}
config-disable-via-header = {{ slapparameter_dict.get('frontend-disable-via-header', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-prefer-gzip-encoding-to-backend', '') %}
config-prefer-gzip-encoding-to-backend = {{ slapparameter_dict.get('frontend-prefer-gzip-encoding-to-backend', '') }}
{% endif -%}
{% if slapparameter_dict.get('frontend-disabled-cookie-list', '') %}
config-disabled-cookie-list = {{ slapparameter_dict.get('frontend-disabled-cookie-list', '') }}
{% endif -%}
return = site_url domain
[request-re6stnet-token-slave]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Re6st token Frontend
# XXX We have hardcoded SR URL here.
software-url = product.re6st
slave = true
return = token info_1 ipv6
[publish-connection-informations]
recipe = slapos.cookbook:publish
url = https://$${request-frontend-token-slave:connection-domain}
token = $${request-re6stnet-token-slave:connection-token}
ipv6 = $${request-re6stnet-token-slave:connection-ipv6}
info_1 = $${request-re6stnet-token-slave:info_1}
......@@ -6,7 +6,6 @@ extends =
# to avoid versioning issues
parts =
slapos-cookbook-develop
template
eggs
template-cdn-request
......@@ -20,9 +19,9 @@ mode = 0644
[template-cdn-request]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-cdn-request.cfg
output = ${buildout:directory}/template-cdn-request.cfg
md5sum = 4c5ad2a5e9c4364588e1e4212ed8d1aa
url = ${:_profile_base_location_}/instance-cdn-request.cfg.jinja2
output = ${buildout:directory}/template-cdn-request.cfg.jinja2
md5sum = b450c721194eb0834e3738158195975a
mode = 0644
[slapos.cookbook-repository]
......@@ -38,3 +37,10 @@ eggs =
plone.recipe.command
slapos.recipe.build
${slapos-cookbook:eggs}
[versions]
cns.recipe.symlink = 0.2.3
collective.recipe.environment = 0.2.0
erp5.util = 0.4.42
plone.recipe.command = 1.1
slapos.recipe.template = 2.8
{
"name": "CDN ME",
"description": "CDN ME",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
"description": "Re6st registry",
"request": "instance-cdn-me-input-schema.json",
"response": "instance-cdn-me-output-schema.json",
"index": 0
}
}
\ No newline at end of file
......@@ -98,7 +98,7 @@ mode = 0644
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2
mode = 644
md5sum = da3b3bde94ac2c06759a89c78168df91
md5sum = 52e115fe1aaf232994af9037bf7c292c
download-only = true
on-update = true
......@@ -106,7 +106,7 @@ on-update = true
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm-cluster.cfg.jinja2.in
mode = 644
md5sum = 3fc6611feaabcacd7e51f3b5681120fd
md5sum = 5700de1cadde0b5bede78f08e215f47a
download-only = true
on-update = true
......@@ -213,7 +213,7 @@ recipe = slapos.recipe.template:jinja2
filename = template-httpd.cfg
template = ${:_profile_base_location_}/instance-kvm-http.cfg.in
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}/instance-kvm-http.cfg
md5sum = fc8b3259942d6dedbc01065358a00d71
md5sum = 26a181a48046ce88570adb32334747ef
context =
key apache_location apache:location
raw openssl_executable_location ${openssl:location}/bin/openssl
......
......@@ -144,6 +144,13 @@
"type": "string",
"default": ""
},
"state": {
"title": "State of this Virtual Machine",
"description": "Define if SlapOS should start or stop this VM.",
"type": "string",
"default": "started",
"enum": ["started", "stopped"]
},
"ram-size": {
"title": "RAM size",
"description": "RAM size, in MB.",
......@@ -151,7 +158,7 @@
"default": 1024,
"minimum": 128,
"multipleOf": 128,
"maximum": 16384
"maximum": 92160
},
"disk-size": {
"title": "Disk size",
......@@ -290,6 +297,12 @@
443
]
},
"enable-vhost": {
"title": "Use vhost-net to improve network performance of tap interface",
"description": "The vhost-net provides much improved network performance for your VM. Only work if the vhost-net kernel module is loaded and available on host machine, please keep this option off if you're not shure.",
"type": "boolean",
"default": false
},
"data-to-vm": {
"title": "Text content to send to this virtual machine.",
"description": "Text content which will be written in a file 'data' of http server of this virtual machine instance. The file will be available via URL: http://10.0.2.100/data in the VM.",
......
......@@ -28,6 +28,9 @@ config-use-ipv6 = {{ dumps(slapparameter_dict.get('use-ipv6', False)) }}
software-type = kvm
name = {{ instance_name }}
sla-computer_guid = {{ dumps(kvm_parameter_dict.get('computer-guid', '')) }}
{% if kvm_parameter_dict.get('state', '') == 'stopped' -%}
state = stopped
{% endif -%}
config-frontend-instance-name = {{ instance_name ~ ' VNC Frontend' }}
config-frontend-software-type = {{ dumps(frontend_dict.get('software-type', 'frontend')) }}
......@@ -53,6 +56,7 @@ config-nat-rules = {{ nat_rules_list | join(' ') }}
config-publish-nat-url = True
config-use-nat = {{ use_nat }}
config-use-tap = {{ dumps(kvm_parameter_dict.get('use-tap', True)) }}
config-enable-vhost = {{ dumps(kvm_parameter_dict.get('enable-vhost', False)) }}
config-virtual-hard-drive-url = {{ dumps(kvm_parameter_dict.get('virtual-hard-drive-url', '')) }}
config-virtual-hard-drive-md5sum = {{ dumps(kvm_parameter_dict.get('virtual-hard-drive-md5sum', '')) }}
config-virtual-hard-drive-gzipped = {{ dumps(kvm_parameter_dict.get('virtual-hard-drive-gzipped', False)) }}
......@@ -189,7 +193,7 @@ mode = {{ mode }}
# write cluster-data into file public/data
{% if slapparameter_dict.get('cluster-data', '') -%}
{{ writefile('cluster-data-content', '${http-server:root-dir}/data', slapparameter_dict.get('cluster-data', ''), '700') }}
{{ writefile('cluster-data-content', '${directory:webroot}/${hash-code:passwd}/data', slapparameter_dict.get('cluster-data', ''), '700') }}
{% endif -%}
[publish]
......@@ -203,6 +207,7 @@ extends =
parts =
httpd
httpd-graceful
httpd-promise
publish
directory-doc
......
......@@ -2,6 +2,7 @@
parts =
httpd
httpd-graceful
httpd-promise
[directory]
......@@ -12,6 +13,7 @@ srv = ${buildout:directory}/srv
public = ${:srv}/public/
log = ${:var}/log
services = ${:etc}/service
scripts = ${:etc}/run
promises = ${:etc}/promise
run = ${:var}/run
document = ${:srv}/document
......@@ -46,6 +48,14 @@ recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:services}/httpd
command-line = "{{ apache_location }}/bin/httpd" -f "${apache-conf:rendered}" -DFOREGROUND
[httpd-graceful]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
exec kill -USR1 $(cat ${apache-conf:pid-file})
output = ${directory:scripts}/httpd-graceful
mode = 700
[httpd-ssl]
recipe = plone.recipe.command
command = "{{ openssl_executable_location }}" req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout "${:key}" -out "${:cert}"
......
......@@ -11,7 +11,7 @@
"default": 1024,
"minimum": 128,
"multipleOf": 128,
"maximum": 16384
"maximum": 92160
},
"disk-size": {
"title": "Disk size",
......@@ -135,6 +135,12 @@
"description": "List of rules for NAT of QEMU user mode network stack, as comma-separated list of ports. For each port specified, it will redirect port x of the VM (example: 80) to the port x + 10000 of the public IPv6 (example: 10080). Defaults to \"22 80 443\". Ignored if \"use-tap\" parameter is enabled.",
"type": "string"
},
"enable-vhost": {
"title": "Use vhost-net to improve network performance of tap interface",
"description": "The vhost-net provides much improved network performance for your VM. Only work if the vhost-net kernel module is loaded and available on host machine, please keep this option off if you're not shure.",
"type": "boolean",
"default": false
},
"enable-monitor": {
"title": "Deploy monitoring tools",
"description": "Deploy monitor instance to this kvm instance. It help to check instance status, log and promise results.",
......
......@@ -150,6 +150,7 @@ controller-path = ${directory:scripts}/kvm_controller
use-tap = ${slap-parameter:use-tap}
use-nat = ${slap-parameter:use-nat}
nat-rules = ${slap-parameter:nat-rules}
enable-vhost = ${slap-parameter:enable-vhost}
6tunnel-wrapper-path = ${directory:services}/6tunnel
virtual-hard-drive-url = ${slap-parameter:virtual-hard-drive-url}
......@@ -387,7 +388,7 @@ tap-ipv4 = ${slap-network-information:tap-ipv4}
{% endif -%}
{% set kvm_http = 'http://${slap-network-information:local-ipv4}:' ~ slapparameter_dict.get('httpd-port', 8081) -%}
{% if enable_http == 'True' %}
{% if enable_http == 'true' %}
{% if use_nat == 'true' -%}
{% set kvm_http = 'http://10.0.2.100' -%}
{% endif %}
......@@ -548,6 +549,7 @@ numa =
nat-rules = 22 80 443
use-nat = True
use-tap = False
enable-vhost = False
virtual-hard-drive-url =
virtual-hard-drive-md5sum =
......
......@@ -18,9 +18,9 @@ parts =
cgi-httpd-graceful-wrapper
monitor-promise
monitor-instance-log-access
cron-rsync-logs
cron-smart-monitor-logs
cron-network-bench
symlink-re6st-logs
symlink-collected-logs
extends = ${monitor-template:output}
......@@ -29,49 +29,22 @@ eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[cron-rsync-logs]
<= cron
recipe = slapos.cookbook:cron.d
name = rsync-logs
frequency = * * * * *
command = $${rsync-logs:rendered}
[cron-smart-monitor-logs]
<= cron
recipe = slapos.cookbook:cron.d
name = smartctl-mon
frequency = 11 * * * *
command = $${smartmon-logs:rendered}
[cron-network-bench]
<= cron
recipe = slapos.cookbook:cron.d
name = network-bench-test
frequency = */3 * * * *
frequency = */10 * * * *
command = ${buildout:bin-directory}/networkbench $${network-bench-configuration:rendered} $${monitor-directory:monitor-log}
[rsync-logs]
recipe = slapos.recipe.template:jinja2
template = ${rsync-logs-script:output}
rendered = $${monitor-directory:bin}/rsync-logs.sh
mode = 0744
context =
key buildout_directory buildout:directory
raw rsync_binary ${rsync:location}/bin/rsync
key server_log_directory monitor-directory:server-log
raw re6st_log_directory /var/log/re6stnet
key system_log_directory monitor-directory:system-log
[symlink-re6st-logs]
recipe = cns.recipe.symlink
symlink = /var/log/re6stnet = $${monitor-directory:system-log}/re6stnet
autocreate = true
[smartmon-logs]
recipe = slapos.recipe.template:jinja2
template = ${smartmon-logs-script:output}
rendered = $${monitor-directory:bin}/smartmon-logs.py
mode = 0744
context =
key buildout_directory buildout:directory
raw smartctl_binary ${smartmontools:location}/sbin/smartctl
key monitor_log_directory monitor-directory:monitor-log
raw python_executable ${buildout:executable}
[symlink-collected-logs]
recipe = cns.recipe.symlink
symlink = /srv/slapgrid/var/data-log = $${monitor-directory:server-log}/data-log
autocreate = true
[network-bench-configuration]
recipe = slapos.recipe.template:jinja2
......@@ -79,6 +52,7 @@ template = ${network-bench-cfg:output}
rendered = $${monitor-directory:etc}/network_bench.cfg
mode = 0744
context =
key slapparameter_dict slap-parameters:configuration
[pwgen]
......@@ -103,17 +77,21 @@ private-hash = $${pwgen:passwd}$${pwgen32:passwd}
frontend-domain =
[monitor-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Monitor Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config = url domain
config-url = $${monitor-parameters:url}
config-domain = $${slap-parameter:frontend-domain}
return = site_url domain
server-url = $${slap-connection:server-url}
key-file = $${slap-connection:key-file}
cert-file = $${slap-connection:cert-file}
computer-id = $${slap-connection:computer-id}
partition-id = $${slap-connection:partition-id}
[publish-connection-informations]
recipe = slapos.cookbook:publish
monitor_url = $${monitor-parameters:url}
......
[buildout]
parts =
switch_softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
[switch_softwaretype]
recipe = slapos.cookbook:softwaretype
default = $${instance-base-runner:rendered}
[instance-base-runner]
recipe = slapos.recipe.template:jinja2
template = ${template-monitor:output}
rendered = $${buildout:directory}/template-monitor.cfg
extensions = jinja2.ext.do
context = key buildout buildout:bin-directory
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key slapparameter_dict slap-configuration:configuration
mode = 0644
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
computer = $${slap-connection:computer-id}
partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
\ No newline at end of file
[network_bench]
url =
http://www.tiolive.com/robots.txt
http://www.erp5.com/robots.txt
http://www.erp5.cn/robots.txt
http://www.nexedi.cn/robots.txt
http://www.osoe-project.cn/robots.txt
http://www.nexedi.cn/robots.txt
http://www.osoe-project.org/robots.txt
http://www.osoe-project.cn/robots.txt
http://www.google.com/robots.txt
http://ipv6.google.com/robots.txt
https://[2001:67c:1254:e:a7::2e20]:9685/monitor-public/rssfeed.html
https://[2001:67c:1254:69::115c]:9685/monitor-public/rssfeed.html
https://[2001:67c:1254:8a::2621]:9685/monitor-public/rssfeed.html
https://[2001:67c:1254:e:c7::89ae]:9685/monitor-public/rssfeed.html
https://[2001:67c:1254:e:93::2e31]:9685/monitor-public/rssfeed.html
https://[2001:67c:1254:1f::2723]:9685/monitor-public/rssfeed.html
https://[2001:41d0:1:a78b::3c2a]:9685/monitor-public/rssfeed.html
http://[2001:67c:1254:4::1]/index.html
dns =
erp5.com
www.erp5.com
erp5.cn
www.erp5.cn
nexedi.cn
www.nexedi.com
www.nexedi.cn
www.osoe-project.org
www.osoe-project.cn
free.fr
google.com
ping =
erp5.com
erp5.cn
google.com
free.fr
frontend1.nexedi.com
frontend2.nexedi.com
frontend3.nexedi.cn
42.192.4.15
195.208.185.22
[network_bench]
url =
{{ slapparameter_dict.get('test_http_url_list', '').split('\n') | join('\n ') }}
dns =
{{ slapparameter_dict.get('test_name_list', '').split('\n') | join('\n ') }}
ping =
{{ slapparameter_dict.get('ping_ip_list', '').split('\n') | join('\n ') }}
ping6 =
{{ slapparameter_dict.get('ping6_ip_list', '').split('\n') | join('\n ') }}
\ No newline at end of file
#!${dash-output:dash}
RSYNC_BIN={{ rsync_binary }}
SLAPGRID_LOGS={{ buildout_directory }}/../var/data-log/
RE6STLOGS={{ re6st_log_directory }}
SYSTEMLOGS={{ system_log_directory }}
SERVERLOGS={{ server_log_directory }}
$RSYNC_BIN -a --delete $SLAPGRID_LOGS $SERVERLOGS
if [ -d $RE6STLOGS ]; then
$RSYNC_BIN -a --delete $RE6STLOGS $SYSTEMLOGS
fi
#!{{ python_executable }}
SMARCTBIN={{ smartctl_binary }}
LOGFOLDER={{ monitor_log_directory }}
import subprocess
import logging
import os
logger = logging.getLogger("SMARTMON")
logger.setLevel(logging.DEBUG)
ch = logging.FileHandler(os.path.join(LOGFOLDER, "smartmontools.log"))
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
def _call(cmd):
p = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
shell=True)
return p.communicate()
def get_disk_list():
output, err = _call("%s --scan" % SMARCTBIN)
disk_list = []
for line in output.split("\n"):
if line != '':
disk_path = line.split(" ")[0]
if disk_path.startswith("/dev/"):
disk_list.append(disk_path)
return disk_list
logger.debug("Starting new Data collection.")
disk_list = get_disk_list()
logger.debug("Identified disks: %s" % disk_list)
for disk in disk_list:
logger.info("Starting test for %s" % disk)
output, err = _call("%s --all %s" % (SMARCTBIN, disk))
for l in output.split("\n"):
logger.info("%s - %s" % (disk, l))
if err is not None:
logger.warning(err)
logger.debug("Stopped to Collect Data.")
[buildout]
extends =
../../component/pycurl/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
../../component/rsync/buildout.cfg
../../component/smartmontools/buildout.cfg
../../component/lmsensors/buildout.cfg
../../component/fluentd/buildout.cfg
../../stack/slapos.cfg
parts =
slapos-cookbook
slapos-toolbox
template
network-bench-cfg
template-monitor
eggs
rsync
smartmontools
lmsensors
fluentd
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
md5sum = 184a27424b48514cfe9374e881e1cc0c
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
md5sum = daf1125d0d67b6b140a4b6de8c8e35f3
mode = 0644
[template-monitor]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-monitor.cfg.jinja2
output = ${buildout:directory}/template-monitor.cfg
md5sum = bf6bb18ed86fcb450e5e23d7815a208f
mode = 0644
# stupify index for now
......@@ -34,31 +38,19 @@ md5sum = 876f18b159fbd9325332d0f42e9172ac
url = ${:_profile_base_location_}/${:filename}
md5sum = 1f30b17f5ea11fd033984d17c38bcfd3
[rsync-logs-script]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/rsync-logs.sh.in
md5sum = 8828868268a6f9761eccbcec1660cc9a
output = ${buildout:directory}/template-rsync-logs.sh.in
mode = 0644
[smartmon-logs-script]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/smartmon.py.in
md5sum = a3ea2604abf53067af1b952b278fba94
output = ${buildout:directory}/template-smartmon-logs.py.in
mode = 0644
[network-bench-cfg]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/network_bench.cfg
md5sum = 44f8db5fca5e16ae87f570623a3ad0b4
url = ${:_profile_base_location_}/network_bench.cfg.in
md5sum = a3510050a1b237dc11ab46a9d2b78f56
output = ${buildout:directory}/template-network-bench-cfg.in
mode = 0644
[slapos-toolbox]
recipe = zc.recipe.egg
eggs =
${lxml-python:egg}
${pycurl:egg}
slapos.toolbox
scripts =
......@@ -80,12 +72,14 @@ cns.recipe.symlink = 0.2.3
plone.recipe.command = 1.1
slapos.recipe.template = 2.7
z3c.recipe.scripts = 1.0.1
rubygemsrecipe = 0.2.1
pycurl = 7.19.5.1
apache-libcloud = 0.16.0
ecdsa = 0.11
gitdb = 0.6.0
pycrypto = 2.6.1
slapos.toolbox = 0.45.1
slapos.toolbox = 0.51
smmap = 0.8.3
# Required by:
......@@ -103,3 +97,13 @@ feedparser = 5.1.3
# Required by:
# slapos.toolbox==0.45.1
paramiko = 1.15.2
# Required by:
# slapos.toolbox==0.51
lockfile = 0.10.2
# Required by:
# slapos.toolbox==0.51
rpdb = 0.1.5
......@@ -69,6 +69,7 @@ eggs =
[ruby-gems]
recipe = rubygemsrecipe
url = https://rubygems.org/rubygems/rubygems-2.4.8.zip
ruby-executable = ${ruby:location}/bin/ruby
gems =
charlock_holmes==0.6.8
......
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