vagrant-g5k 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +19 -0
  4. data/Vagrantfile +18 -31
  5. data/Vagrantfile.multisite +37 -0
  6. data/lib/vagrant-g5k/errors.rb +8 -3
  7. data/lib/vagrant-g5k/util/g5k_utils.rb +21 -13
  8. data/lib/vagrant-g5k/version.rb +1 -1
  9. data/locales/en.yml +5 -1
  10. data/results/.gitignore +2 -0
  11. data/results/README.md +43 -0
  12. data/results/Vagrantfile +126 -0
  13. data/results/ansible.cfg +2 -0
  14. data/results/boilerplate.retry +1 -0
  15. data/results/boilerplate.yml +248 -0
  16. data/results/files/grafana/dashboard.json +4572 -0
  17. data/results/files/grafana/dedicated.json +5486 -0
  18. data/results/files/grafana/haproxy.json +2632 -0
  19. data/results/files/heka/config.json +47 -0
  20. data/results/files/heka/heka-globals.toml +2 -0
  21. data/results/files/heka/lua_decoders/haproxy_log.lua +162 -0
  22. data/results/files/heka/lua_decoders/os_keystone_apache_log.lua +78 -0
  23. data/results/files/heka/lua_decoders/os_mysql_log.lua +56 -0
  24. data/results/files/heka/lua_decoders/os_openstack_log.lua +146 -0
  25. data/results/files/heka/lua_decoders/os_rabbitmq_log.lua +79 -0
  26. data/results/files/kibana/all_objects.json +81 -0
  27. data/results/files/nginx.conf +34 -0
  28. data/results/templates/heka-elasticsearch.toml.j2 +18 -0
  29. data/results/templates/heka-haproxy.toml.j2 +10 -0
  30. data/results/templates/heka-keystone.toml.j2 +14 -0
  31. data/results/templates/heka-mariadb.toml.j2 +14 -0
  32. data/results/templates/heka-openstack.toml.j2 +15 -0
  33. data/results/templates/heka-rabbitmq.toml.j2 +21 -0
  34. data/results/test.rb +32 -0
  35. metadata +28 -2
@@ -0,0 +1,79 @@
1
+ -- Copyright 2015-2016 Mirantis, Inc.
2
+ --
3
+ -- Licensed under the Apache License, Version 2.0 (the "License");
4
+ -- you may not use this file except in compliance with the License.
5
+ -- You may obtain a copy of the License at
6
+ --
7
+ -- http://www.apache.org/licenses/LICENSE-2.0
8
+ --
9
+ -- Unless required by applicable law or agreed to in writing, software
10
+ -- distributed under the License is distributed on an "AS IS" BASIS,
11
+ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ -- See the License for the specific language governing permissions and
13
+ -- limitations under the License.
14
+ local dt = require "date_time"
15
+ local l = require 'lpeg'
16
+ l.locale(l)
17
+
18
+ local patt = require 'os_patterns'
19
+ local utils = require 'os_utils'
20
+
21
+
22
+ -- Allow custom type
23
+ t = read_config('type')
24
+ if t == nil or t == '' then
25
+ t = 'log'
26
+ end
27
+
28
+ local msg = {
29
+ Timestamp = nil,
30
+ Type = t,
31
+ Hostname = nil,
32
+ Payload = nil,
33
+ Pid = nil,
34
+ Fields = nil,
35
+ Severity = nil,
36
+ }
37
+
38
+ -- RabbitMQ message logs are formatted like this:
39
+ -- =ERROR REPORT==== 2-Jan-2015::09:17:22 ===
40
+ -- Blabla
41
+ -- Blabla
42
+ --
43
+ local message = l.Cg(patt.Message / utils.chomp, "Message")
44
+ -- The token before 'REPORT' isn't standardized so it can be a valid severity
45
+ -- level as 'INFO' or 'ERROR' but also 'CRASH' or 'SUPERVISOR'.
46
+ local severity = l.Cg(l.R"AZ"^1, "SeverityLabel")
47
+ local day = l.R"13" * l.R"09" + l.R"19"
48
+ local datetime = l.Cg(day, "day") * patt.dash * dt.date_mabbr * patt.dash * dt.date_fullyear *
49
+ "::" * dt.rfc3339_partial_time
50
+ local timestamp = l.Cg(l.Ct(datetime)/ dt.time_to_ns, "Timestamp")
51
+
52
+ local grammar = l.Ct("=" * severity * " REPORT==== " * timestamp * " ===" * l.P'\n' * message)
53
+
54
+ function process_message ()
55
+ local log = read_message("Payload")
56
+
57
+ local m = grammar:match(log)
58
+ if not m then
59
+ return -1
60
+ end
61
+
62
+ msg.Timestamp = m.Timestamp
63
+ msg.Payload = m.Message
64
+ msg.Logger = read_message("Logger")
65
+
66
+ if utils.label_to_severity_map[m.SeverityLabel] then
67
+ msg.Severity = utils.label_to_severity_map[m.SeverityLabel]
68
+ elseif m.SeverityLabel == 'CRASH' then
69
+ msg.Severity = 2 -- CRITICAL
70
+ else
71
+ msg.Severity = 5 -- NOTICE
72
+ end
73
+
74
+ msg.Fields = {}
75
+ msg.Fields.severity_label = utils.severity_to_label_map[msg.Severity]
76
+ msg.Fields.programname = 'rabbitmq'
77
+
78
+ return utils.safe_inject_message(msg)
79
+ end
@@ -0,0 +1,81 @@
1
+ [
2
+ {
3
+ "_id": "Logs",
4
+ "_type": "dashboard",
5
+ "_source": {
6
+ "title": "Logs",
7
+ "hits": 0,
8
+ "description": "",
9
+ "panelsJSON": "[{\"id\":\"Types\",\"type\":\"visualization\",\"panelIndex\":1,\"size_x\":4,\"size_y\":3,\"col\":1,\"row\":1},{\"id\":\"progname\",\"type\":\"visualization\",\"panelIndex\":2,\"size_x\":4,\"size_y\":3,\"col\":5,\"row\":1},{\"id\":\"http_status\",\"type\":\"visualization\",\"panelIndex\":3,\"size_x\":4,\"size_y\":3,\"col\":9,\"row\":1},{\"id\":\"raw\",\"type\":\"search\",\"panelIndex\":4,\"size_x\":12,\"size_y\":6,\"col\":1,\"row\":4,\"columns\":[\"_source\"],\"sort\":[\"Timestamp\",\"desc\"]}]",
10
+ "optionsJSON": "{\"darkTheme\":false}",
11
+ "uiStateJSON": "{}",
12
+ "version": 1,
13
+ "timeRestore": false,
14
+ "kibanaSavedObjectMeta": {
15
+ "searchSourceJSON": "{\"filter\":[{\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}]}"
16
+ }
17
+ }
18
+ },
19
+ {
20
+ "_id": "raw",
21
+ "_type": "search",
22
+ "_source": {
23
+ "title": "raw",
24
+ "description": "",
25
+ "hits": 0,
26
+ "columns": [
27
+ "_source"
28
+ ],
29
+ "sort": [
30
+ "Timestamp",
31
+ "desc"
32
+ ],
33
+ "version": 1,
34
+ "kibanaSavedObjectMeta": {
35
+ "searchSourceJSON": "{\"index\":\"heka*\",\"filter\":[],\"highlight\":{\"pre_tags\":[\"@kibana-highlighted-field@\"],\"post_tags\":[\"@/kibana-highlighted-field@\"],\"fields\":{\"*\":{}},\"require_field_match\":false,\"fragment_size\":2147483647},\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}"
36
+ }
37
+ }
38
+ },
39
+ {
40
+ "_id": "progname",
41
+ "_type": "visualization",
42
+ "_source": {
43
+ "title": "progname",
44
+ "visState": "{\"title\":\"progname\",\"type\":\"pie\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"isDonut\":false},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"programname\",\"size\":10,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}",
45
+ "uiStateJSON": "{}",
46
+ "description": "",
47
+ "version": 1,
48
+ "kibanaSavedObjectMeta": {
49
+ "searchSourceJSON": "{\"index\":\"heka*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
50
+ }
51
+ }
52
+ },
53
+ {
54
+ "_id": "http_status",
55
+ "_type": "visualization",
56
+ "_source": {
57
+ "title": "http_status",
58
+ "visState": "{\"title\":\"http_status\",\"type\":\"pie\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"isDonut\":false},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"http_status\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}",
59
+ "uiStateJSON": "{}",
60
+ "description": "",
61
+ "version": 1,
62
+ "kibanaSavedObjectMeta": {
63
+ "searchSourceJSON": "{\"index\":\"heka*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
64
+ }
65
+ }
66
+ },
67
+ {
68
+ "_id": "Types",
69
+ "_type": "visualization",
70
+ "_source": {
71
+ "title": "Types",
72
+ "visState": "{\"title\":\"Types\",\"type\":\"pie\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"isDonut\":false},\"aggs\":[{\"id\":\"1\",\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"type\":\"terms\",\"schema\":\"segment\",\"params\":{\"field\":\"Type\",\"size\":20,\"order\":\"desc\",\"orderBy\":\"1\"}}],\"listeners\":{}}",
73
+ "uiStateJSON": "{}",
74
+ "description": "",
75
+ "version": 1,
76
+ "kibanaSavedObjectMeta": {
77
+ "searchSourceJSON": "{\"index\":\"heka*\",\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}},\"filter\":[]}"
78
+ }
79
+ }
80
+ }
81
+ ]
@@ -0,0 +1,34 @@
1
+ user nginx;
2
+ worker_processes 1;
3
+ error_log /var/log/nginx/error.log warn;
4
+ pid /var/run/nginx.pid;
5
+
6
+ events {
7
+ worker_connections 1024;
8
+ }
9
+
10
+ http {
11
+ include /etc/nginx/mime.types;
12
+ # prevent chrome to guess the content-type
13
+ add_header X-Content-Type-Options nosniff;
14
+ default_type text/plain;
15
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
16
+ '$status $body_bytes_sent "$http_referer" '
17
+ '"$http_user_agent" "$http_x_forwarded_for"';
18
+ access_log /var/log/nginx/access.log main;
19
+ sendfile on;
20
+ keepalive_timeout 65;
21
+ server {
22
+ listen 80;
23
+ server_name localhost;
24
+ location / {
25
+ root /usr/share/nginx/html;
26
+ autoindex on;
27
+ }
28
+
29
+ error_page 500 502 503 504 /50x.html;
30
+ location = /50x.html {
31
+ root /usr/share/nginx/html;
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,18 @@
1
+ [elasticsearch_json_encoder]
2
+ type = "ESJsonEncoder"
3
+ #index = "{{ item }}"
4
+ index = "heka"
5
+ es_index_from_timestamp = true
6
+ fields = ["Timestamp", "Type", "Logger", "Severity", "Payload", "Pid", "Hostname", "DynamicFields"]
7
+
8
+ [elasticsearch_output]
9
+ type = "ElasticSearchOutput"
10
+ # elastic container is likned to heka one
11
+ server = "http://elasticsearch:9200"
12
+ message_matcher = "Type =~ /^log.*/"
13
+ encoder = "elasticsearch_json_encoder"
14
+ use_buffering = true
15
+ [elasticsearch_output.buffering]
16
+ max_buffer_size = 1073741824 # 1024 * 1024 * 1024
17
+ max_file_size = 134217728 # 128 * 1024 * 1024
18
+ full_action = "drop"
@@ -0,0 +1,10 @@
1
+ [haproxy_log_decoder]
2
+ type = "SandboxDecoder"
3
+ filename = "lua_decoders/haproxy_log.lua"
4
+
5
+ [haproxy_logstreamer_input]
6
+ type = "LogstreamerInput"
7
+ decoder = "haproxy_log_decoder"
8
+ log_directory = "/var/log/kolla"
9
+ file_match = 'haproxy/haproxy\.log'
10
+
@@ -0,0 +1,14 @@
1
+ [keystone_apache_log_decoder]
2
+ type = "SandboxDecoder"
3
+ filename = "lua_decoders/os_keystone_apache_log.lua"
4
+ [keystone_apache_log_decoder.config]
5
+ type = "log-{{ item[1] }}"
6
+ apache_log_pattern = '%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"'
7
+
8
+ [keystone_apache_logstreamer_input]
9
+ type = "LogstreamerInput"
10
+ decoder = "keystone_apache_log_decoder"
11
+ log_directory = "/var/log/kolla"
12
+ file_match = 'keystone/keystone-apache-(?P<Service>.+)-access\.log\.?(?P<Seq>\d*)$'
13
+ priority = ["^Seq"]
14
+ differentiator = ["keystone-apache-", "Service"]
@@ -0,0 +1,14 @@
1
+ [mariadb_log_decoder]
2
+ type = "SandboxDecoder"
3
+ filename = "lua_decoders/os_mysql_log.lua"
4
+
5
+ [mariadb_log_decoder.config]
6
+ type = "log-{{ item[1] }}"
7
+
8
+ [mariadb_logstreamer_input]
9
+ type = "LogstreamerInput"
10
+ decoder = "mariadb_log_decoder"
11
+ log_directory = "/var/log/kolla"
12
+ file_match = 'mariadb/mariadb\.log\.?(?P<Seq>\d*)$'
13
+ priority = ["^Seq"]
14
+ differentiator = ['mariadb']
@@ -0,0 +1,15 @@
1
+ [openstack_log_decoder]
2
+ type = "SandboxDecoder"
3
+ filename = "lua_decoders/os_openstack_log.lua"
4
+
5
+ [openstack_log_decoder.config]
6
+ type = "log-{{ item[1] }}"
7
+
8
+ [openstack_logstreamer_input]
9
+ type = "LogstreamerInput"
10
+ decoder = "openstack_log_decoder"
11
+ log_directory = "/var/log/kolla"
12
+ file_match = '(?P<Service>cloudkitty|nova|glance|keystone|neutron|ceph|cinder|heat|murano|magnum|mistral|manila|senlin)/(?P<Program>.*)\.log\.?(?P<Seq>\d*)$'
13
+ priority = ["^Seq"]
14
+ differentiator = ["Service", "_", "Program"]
15
+
@@ -0,0 +1,21 @@
1
+ [rabbitmq_log_decoder]
2
+ type = "SandboxDecoder"
3
+ filename = "lua_decoders/os_rabbitmq_log.lua"
4
+
5
+ [rabbitmq_log_decoder.config]
6
+ type = "log-{{ item[1] }}"
7
+
8
+ [rabbitmq_log_splitter]
9
+ type = "RegexSplitter"
10
+ delimiter = '\n\n(=[^=]+====)'
11
+ delimiter_eol = false
12
+ deliver_incomplete_final = true
13
+
14
+ [rabbitmq_logstreamer_input]
15
+ type = "LogstreamerInput"
16
+ decoder = "rabbitmq_log_decoder"
17
+ splitter = "rabbitmq_log_splitter"
18
+ log_directory = "/var/log/kolla"
19
+ file_match = 'rabbitmq/(?P<Service>rabbit.*)\.log\.?(?P<Seq>\d*)$'
20
+ priority = ["^Seq"]
21
+ differentiator = ["Service"]
data/results/test.rb ADDED
@@ -0,0 +1,32 @@
1
+ require 'net/ssh/gateway'
2
+ require 'net/http'
3
+ include Process
4
+
5
+ $gateway = Net::SSH::Gateway.new('access.grid5000.fr', 'msimonin')
6
+ ports = []
7
+
8
+ def close()
9
+ $gateway.shutdown!
10
+ end
11
+
12
+
13
+ # Trap ^C
14
+ Signal.trap("INT") {
15
+ close()
16
+ exit
17
+ }
18
+
19
+ # Trap ^C
20
+ Signal.trap("TERM") {
21
+ close()
22
+ exit
23
+ }
24
+
25
+ remote_host = 'parapide-9.rennes.grid5000.fr'
26
+ remote_ports = [5601, 3000]
27
+ remote_ports.each do |remote_port|
28
+ port = $gateway.open(remote_host, remote_port)
29
+ puts "localhost:#{port} forwards to #{remote_host}:#{remote_port}"
30
+ end
31
+
32
+ wait
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-g5k
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Simonin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-08 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iniparse
@@ -127,6 +127,7 @@ files:
127
127
  - LICENSE
128
128
  - README.md
129
129
  - Vagrantfile
130
+ - Vagrantfile.multisite
130
131
  - lib/vagrant-g5k.rb
131
132
  - lib/vagrant-g5k/.config.rb.swp
132
133
  - lib/vagrant-g5k/action.rb
@@ -151,6 +152,31 @@ files:
151
152
  - lib/vagrant-g5k/util/launch_vm_fwd.sh
152
153
  - lib/vagrant-g5k/version.rb
153
154
  - locales/en.yml
155
+ - results/.gitignore
156
+ - results/README.md
157
+ - results/Vagrantfile
158
+ - results/ansible.cfg
159
+ - results/boilerplate.retry
160
+ - results/boilerplate.yml
161
+ - results/files/grafana/dashboard.json
162
+ - results/files/grafana/dedicated.json
163
+ - results/files/grafana/haproxy.json
164
+ - results/files/heka/config.json
165
+ - results/files/heka/heka-globals.toml
166
+ - results/files/heka/lua_decoders/haproxy_log.lua
167
+ - results/files/heka/lua_decoders/os_keystone_apache_log.lua
168
+ - results/files/heka/lua_decoders/os_mysql_log.lua
169
+ - results/files/heka/lua_decoders/os_openstack_log.lua
170
+ - results/files/heka/lua_decoders/os_rabbitmq_log.lua
171
+ - results/files/kibana/all_objects.json
172
+ - results/files/nginx.conf
173
+ - results/templates/heka-elasticsearch.toml.j2
174
+ - results/templates/heka-haproxy.toml.j2
175
+ - results/templates/heka-keystone.toml.j2
176
+ - results/templates/heka-mariadb.toml.j2
177
+ - results/templates/heka-openstack.toml.j2
178
+ - results/templates/heka-rabbitmq.toml.j2
179
+ - results/test.rb
154
180
  - spec/vagrant-g5k/config_spec.rb
155
181
  - vagrant-g5k.gemspec
156
182
  homepage: https://github.com/msimonin/vagrant-g5k