hybrid_platforms_conductor 32.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/check-node +24 -0
- data/bin/deploy +12 -0
- data/bin/dump_nodes_json +12 -0
- data/bin/free_ips +23 -0
- data/bin/free_veids +17 -0
- data/bin/get_impacted_nodes +43 -0
- data/bin/last_deploys +56 -0
- data/bin/nodes_to_deploy +104 -0
- data/bin/report +10 -0
- data/bin/run +39 -0
- data/bin/setup +11 -0
- data/bin/ssh_config +14 -0
- data/bin/test +13 -0
- data/bin/topograph +54 -0
- data/lib/hybrid_platforms_conductor/action.rb +82 -0
- data/lib/hybrid_platforms_conductor/actions_executor.rb +307 -0
- data/lib/hybrid_platforms_conductor/bitbucket.rb +123 -0
- data/lib/hybrid_platforms_conductor/cmd_runner.rb +188 -0
- data/lib/hybrid_platforms_conductor/cmdb.rb +34 -0
- data/lib/hybrid_platforms_conductor/common_config_dsl/bitbucket.rb +78 -0
- data/lib/hybrid_platforms_conductor/common_config_dsl/confluence.rb +43 -0
- data/lib/hybrid_platforms_conductor/common_config_dsl/file_system_tests.rb +110 -0
- data/lib/hybrid_platforms_conductor/common_config_dsl/idempotence_tests.rb +38 -0
- data/lib/hybrid_platforms_conductor/config.rb +263 -0
- data/lib/hybrid_platforms_conductor/confluence.rb +119 -0
- data/lib/hybrid_platforms_conductor/connector.rb +84 -0
- data/lib/hybrid_platforms_conductor/credentials.rb +127 -0
- data/lib/hybrid_platforms_conductor/current_dir_monitor.rb +42 -0
- data/lib/hybrid_platforms_conductor/deployer.rb +598 -0
- data/lib/hybrid_platforms_conductor/executable.rb +145 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/action/bash.rb +44 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/action/interactive.rb +44 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/action/my_action.rb.sample +79 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/action/remote_bash.rb +63 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/action/ruby.rb +69 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/action/scp.rb +61 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/config.rb +78 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_ip.rb +104 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/host_keys.rb +114 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/my_cmdb.rb.sample +129 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/cmdb/platform_handlers.rb +66 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/connector/my_connector.rb.sample +156 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/connector/ssh.rb +702 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/platform_handler/platform_handler_plugin.rb.sample +292 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/docker.rb +148 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/my_provisioner.rb.sample +103 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/podman.rb +125 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox.rb +522 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/proxmox_waiter.rb +707 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/provisioner/proxmox/reserve_proxmox_container +122 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/confluence.rb +69 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/mediawiki.rb +164 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/my_report_plugin.rb.sample +88 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/stdout.rb +61 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/report/templates/confluence_inventory.html.erb +33 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/bitbucket_conf.rb +137 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/can_be_checked.rb +21 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/check_deploy_and_idempotence.rb +112 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/check_from_scratch.rb +35 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/connection.rb +28 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_freshness.rb +44 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_from_scratch.rb +36 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/deploy_removes_root_access.rb +49 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/divergence.rb +25 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/executables.rb +46 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system.rb +45 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/file_system_hdfs.rb +45 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/hostname.rb +25 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/idempotence.rb +77 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ip.rb +38 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_conf.rb +56 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/jenkins_ci_masters_ok.rb +54 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/linear_strategy.rb +47 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/local_users.rb +82 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/mounts.rb +120 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/my_test_plugin.rb.sample +143 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/orphan_files.rb +74 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/ports.rb +85 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/private_ips.rb +38 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/public_ips.rb +38 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/spectre-meltdown-checker.sh +1930 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/spectre.rb +56 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/veids.rb +31 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test/vulnerabilities.rb +159 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/confluence.rb +122 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/my_test_report.rb.sample +48 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/stdout.rb +120 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/templates/_confluence_errors_status.html.erb +46 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/templates/_confluence_gauge.html.erb +49 -0
- data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/templates/confluence.html.erb +242 -0
- data/lib/hybrid_platforms_conductor/io_router.rb +70 -0
- data/lib/hybrid_platforms_conductor/json_dumper.rb +88 -0
- data/lib/hybrid_platforms_conductor/logger_helpers.rb +319 -0
- data/lib/hybrid_platforms_conductor/mutex_dir +76 -0
- data/lib/hybrid_platforms_conductor/nodes_handler.rb +597 -0
- data/lib/hybrid_platforms_conductor/parallel_threads.rb +97 -0
- data/lib/hybrid_platforms_conductor/platform_handler.rb +188 -0
- data/lib/hybrid_platforms_conductor/platforms_handler.rb +118 -0
- data/lib/hybrid_platforms_conductor/plugin.rb +53 -0
- data/lib/hybrid_platforms_conductor/plugins.rb +101 -0
- data/lib/hybrid_platforms_conductor/provisioner.rb +181 -0
- data/lib/hybrid_platforms_conductor/report.rb +31 -0
- data/lib/hybrid_platforms_conductor/reports_handler.rb +84 -0
- data/lib/hybrid_platforms_conductor/services_handler.rb +274 -0
- data/lib/hybrid_platforms_conductor/test.rb +141 -0
- data/lib/hybrid_platforms_conductor/test_by_service.rb +22 -0
- data/lib/hybrid_platforms_conductor/test_report.rb +282 -0
- data/lib/hybrid_platforms_conductor/tests_runner.rb +590 -0
- data/lib/hybrid_platforms_conductor/thycotic.rb +92 -0
- data/lib/hybrid_platforms_conductor/topographer.rb +859 -0
- data/lib/hybrid_platforms_conductor/topographer/plugin.rb +20 -0
- data/lib/hybrid_platforms_conductor/topographer/plugins/graphviz.rb +127 -0
- data/lib/hybrid_platforms_conductor/topographer/plugins/json.rb +72 -0
- data/lib/hybrid_platforms_conductor/topographer/plugins/my_topographer_output_plugin.rb.sample +37 -0
- data/lib/hybrid_platforms_conductor/topographer/plugins/svg.rb +30 -0
- data/lib/hybrid_platforms_conductor/version.rb +5 -0
- data/spec/hybrid_platforms_conductor_test.rb +159 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/bash_spec.rb +43 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/interactive_spec.rb +18 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/remote_bash_spec.rb +102 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/ruby_spec.rb +108 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions/scp_spec.rb +79 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/actions_spec.rb +199 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connection_spec.rb +212 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/cli_options_spec.rb +125 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/config_dsl_spec.rb +50 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connectable_nodes_spec.rb +28 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/connections_spec.rb +448 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/global_helpers_spec.rb +313 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/node_helpers_spec.rb +32 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/connectors/ssh/remote_actions_spec.rb +134 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/logging_spec.rb +256 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/parallel_spec.rb +338 -0
- data/spec/hybrid_platforms_conductor_test/api/actions_executor/timeout_spec.rb +101 -0
- data/spec/hybrid_platforms_conductor_test/api/cmd_runner_spec.rb +165 -0
- data/spec/hybrid_platforms_conductor_test/api/config_spec.rb +238 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/check_spec.rb +9 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/deploy_spec.rb +243 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/parse_deploy_output_spec.rb +104 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioner_spec.rb +131 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/docker/Dockerfile +10 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/docker_spec.rb +123 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/podman_spec.rb +211 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/config_dsl_spec.rb +126 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/create_spec.rb +290 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/destroy_spec.rb +43 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/ip_spec.rb +60 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/proxmox.json +3 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/destroy_vm_spec.rb +82 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/expired_containers_spec.rb +786 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/ips_assignment_spec.rb +112 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/other_lxc_containers_resources_spec.rb +190 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/pve_node_resources_spec.rb +200 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/retries_spec.rb +35 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/reserve_proxmox_container/vm_ids_assignment_spec.rb +67 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/start_spec.rb +79 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/state_spec.rb +28 -0
- data/spec/hybrid_platforms_conductor_test/api/deployer/provisioners/proxmox/stop_spec.rb +41 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/config_spec.rb +33 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_ip_spec.rb +64 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/host_keys_spec.rb +133 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs/platform_handlers_spec.rb +19 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/cmdbs_plugins_api_spec.rb +446 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/common_spec.rb +127 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/git_diff_impacts_spec.rb +318 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/nodes_selectors_spec.rb +132 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/platform_handlers_plugins_api_spec.rb +60 -0
- data/spec/hybrid_platforms_conductor_test/api/nodes_handler/several_platforms_spec.rb +58 -0
- data/spec/hybrid_platforms_conductor_test/api/platform_handler_spec.rb +97 -0
- data/spec/hybrid_platforms_conductor_test/api/platforms_handler_spec.rb +104 -0
- data/spec/hybrid_platforms_conductor_test/api/plugins_spec.rb +243 -0
- data/spec/hybrid_platforms_conductor_test/api/reports_handler_spec.rb +44 -0
- data/spec/hybrid_platforms_conductor_test/api/services_handler/actions_to_deploy_spec.rb +121 -0
- data/spec/hybrid_platforms_conductor_test/api/services_handler/deploy_allowed_spec.rb +142 -0
- data/spec/hybrid_platforms_conductor_test/api/services_handler/log_info_spec.rb +101 -0
- data/spec/hybrid_platforms_conductor_test/api/services_handler/package_spec.rb +388 -0
- data/spec/hybrid_platforms_conductor_test/api/services_handler/parse_deploy_output_spec.rb +274 -0
- data/spec/hybrid_platforms_conductor_test/api/services_handler/prepare_for_deploy_spec.rb +264 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/common_spec.rb +194 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/global_spec.rb +37 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_check_spec.rb +194 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_spec.rb +137 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/node_ssh_spec.rb +257 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/platform_spec.rb +110 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/reports_spec.rb +367 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_plugins/bitbucket_conf_spec.rb +111 -0
- data/spec/hybrid_platforms_conductor_test/api/tests_runner/test_reports_plugins/confluence_spec.rb +29 -0
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb.rb +166 -0
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb2.rb +93 -0
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others.rb +60 -0
- data/spec/hybrid_platforms_conductor_test/cmdb_plugins/test_cmdb_others2.rb +58 -0
- data/spec/hybrid_platforms_conductor_test/executables/check-node_spec.rb +35 -0
- data/spec/hybrid_platforms_conductor_test/executables/deploy_spec.rb +35 -0
- data/spec/hybrid_platforms_conductor_test/executables/get_impacted_nodes_spec.rb +158 -0
- data/spec/hybrid_platforms_conductor_test/executables/last_deploys_spec.rb +173 -0
- data/spec/hybrid_platforms_conductor_test/executables/nodes_to_deploy_spec.rb +283 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/actions_executor_spec.rb +28 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/cmd_runner_spec.rb +28 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/common_spec.rb +67 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/deployer_spec.rb +251 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/nodes_handler_spec.rb +111 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/nodes_selectors_spec.rb +71 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/reports_handler_spec.rb +54 -0
- data/spec/hybrid_platforms_conductor_test/executables/options/tests_runner_spec.rb +139 -0
- data/spec/hybrid_platforms_conductor_test/executables/report_spec.rb +60 -0
- data/spec/hybrid_platforms_conductor_test/executables/run_spec.rb +173 -0
- data/spec/hybrid_platforms_conductor_test/executables/ssh_config_spec.rb +35 -0
- data/spec/hybrid_platforms_conductor_test/executables/test_spec.rb +41 -0
- data/spec/hybrid_platforms_conductor_test/helpers/actions_executor_helpers.rb +98 -0
- data/spec/hybrid_platforms_conductor_test/helpers/cmd_runner_helpers.rb +92 -0
- data/spec/hybrid_platforms_conductor_test/helpers/cmdb_helpers.rb +37 -0
- data/spec/hybrid_platforms_conductor_test/helpers/config_helpers.rb +20 -0
- data/spec/hybrid_platforms_conductor_test/helpers/connector_ssh_helpers.rb +130 -0
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_helpers.rb +149 -0
- data/spec/hybrid_platforms_conductor_test/helpers/deployer_test_helpers.rb +812 -0
- data/spec/hybrid_platforms_conductor_test/helpers/executables_helpers.rb +96 -0
- data/spec/hybrid_platforms_conductor_test/helpers/nodes_handler_helpers.rb +20 -0
- data/spec/hybrid_platforms_conductor_test/helpers/platform_handler_helpers.rb +35 -0
- data/spec/hybrid_platforms_conductor_test/helpers/platforms_handler_helpers.rb +127 -0
- data/spec/hybrid_platforms_conductor_test/helpers/plugins_helpers.rb +48 -0
- data/spec/hybrid_platforms_conductor_test/helpers/provisioner_proxmox_helpers.rb +789 -0
- data/spec/hybrid_platforms_conductor_test/helpers/reports_handler_helpers.rb +29 -0
- data/spec/hybrid_platforms_conductor_test/helpers/services_handler_helpers.rb +20 -0
- data/spec/hybrid_platforms_conductor_test/helpers/tests_runner_helpers.rb +38 -0
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/test_plugin_id1.rb +22 -0
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem/hpc_plugins/test_plugin_type/test_plugin_id2.rb +22 -0
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/test_plugin_type/test_plugin_id3.rb +26 -0
- data/spec/hybrid_platforms_conductor_test/mocked_lib/my_test_gem2/sub_dir/hpc_plugins/test_plugin_type2/test_plugin_id4.rb +26 -0
- data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/test.rb +225 -0
- data/spec/hybrid_platforms_conductor_test/platform_handler_plugins/test2.rb +11 -0
- data/spec/hybrid_platforms_conductor_test/report_plugin.rb +35 -0
- data/spec/hybrid_platforms_conductor_test/test_action.rb +66 -0
- data/spec/hybrid_platforms_conductor_test/test_connector.rb +151 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/global.rb +30 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/node.rb +53 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/node_check.rb +47 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/node_ssh.rb +42 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/platform.rb +50 -0
- data/spec/hybrid_platforms_conductor_test/test_plugins/several_checks.rb +50 -0
- data/spec/hybrid_platforms_conductor_test/test_provisioner.rb +95 -0
- data/spec/hybrid_platforms_conductor_test/tests_report_plugin.rb +49 -0
- data/spec/spec_helper.rb +111 -0
- metadata +566 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
<%# Partial template used to display a status.
|
2
|
+
# Expects the following variables to be set:
|
3
|
+
# * *@status_test_name* (String): The test name
|
4
|
+
# * *@status_test_criteria* (Hash<Symbol,Object>): The test criteria (options to give to the signatures of methods retrieving test data, like errors_for)
|
5
|
+
# * *@max_errors* (Integer): Number max of errors to be displayed
|
6
|
+
%>
|
7
|
+
<% if should_have_been_tested?(@status_test_name, **@status_test_criteria) %>
|
8
|
+
<%
|
9
|
+
errors = errors_for(@status_test_name, **@status_test_criteria)
|
10
|
+
color, title =
|
11
|
+
if missing_tests_for(@status_test_name, **@status_test_criteria)
|
12
|
+
['Grey', 'Not run']
|
13
|
+
elsif errors.empty?
|
14
|
+
['Green', 'Success']
|
15
|
+
elsif select_tests(@status_test_name, **@status_test_criteria).any? { |test| test.expected_failure.nil? && !test.errors.empty? }
|
16
|
+
['Red', 'Errors']
|
17
|
+
else
|
18
|
+
['Yellow', 'Expected errors']
|
19
|
+
end
|
20
|
+
%>
|
21
|
+
<div class="content-wrapper">
|
22
|
+
<p>
|
23
|
+
<ac:structured-macro ac:name="status" ac:schema-version="1">
|
24
|
+
<ac:parameter ac:name="colour"><%= color %></ac:parameter>
|
25
|
+
<ac:parameter ac:name="title"><%= title %></ac:parameter>
|
26
|
+
</ac:structured-macro>
|
27
|
+
<% unless errors.empty? %>
|
28
|
+
<ac:structured-macro ac:name="expand" ac:schema-version="1">
|
29
|
+
<ac:parameter ac:name="title">Errors</ac:parameter>
|
30
|
+
<ac:rich-text-body>
|
31
|
+
<div style="text-align: left;">
|
32
|
+
<ul>
|
33
|
+
<% errors[0..@max_errors - 1].each do |error| %>
|
34
|
+
<li><%= CGI.escapeHTML(error[0..@max_error_message_length - 1]) %></li>
|
35
|
+
<% end %>
|
36
|
+
<% if errors.size > @max_errors %>
|
37
|
+
<li>...</li>
|
38
|
+
<% end %>
|
39
|
+
</ul>
|
40
|
+
</div>
|
41
|
+
</ac:rich-text-body>
|
42
|
+
</ac:structured-macro>
|
43
|
+
<% end %>
|
44
|
+
</p>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
data/lib/hybrid_platforms_conductor/hpc_plugins/test_report/templates/_confluence_gauge.html.erb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
<%# Partial template used to display a gauge.
|
2
|
+
# Expects the following variables to be set:
|
3
|
+
# * *@gauge_success* (Integer): Number of tests in success
|
4
|
+
# * *@gauge_unexpected_error* (Integer): Number of tests in unexpected error
|
5
|
+
# * *@gauge_expected_error* (Integer): Number of tests in expected error
|
6
|
+
# * *@gauge_not_run* (Integer): Number of tests not run
|
7
|
+
%>
|
8
|
+
<% gauge_total = @gauge_success + @gauge_unexpected_error + @gauge_expected_error + @gauge_not_run %>
|
9
|
+
<% unless gauge_total == 0 %>
|
10
|
+
<%= (@gauge_success*100.0/gauge_total).to_i %> %
|
11
|
+
<br/>
|
12
|
+
<ac:structured-macro ac:name="chart" ac:schema-version="1">
|
13
|
+
<ac:parameter ac:name="imageFormat">png</ac:parameter>
|
14
|
+
<ac:parameter ac:name="showShapes">false</ac:parameter>
|
15
|
+
<ac:parameter ac:name="forgive">false</ac:parameter>
|
16
|
+
<ac:parameter ac:name="legend">false</ac:parameter>
|
17
|
+
<ac:parameter ac:name="width">200</ac:parameter>
|
18
|
+
<ac:parameter ac:name="dataOrientation">vertical</ac:parameter>
|
19
|
+
<ac:parameter ac:name="colors">#14892C,#FFD351,#D04437,#CCCCCC</ac:parameter>
|
20
|
+
<ac:parameter ac:name="height">200</ac:parameter>
|
21
|
+
<ac:parameter ac:name="pieSectionLabel">%1%</ac:parameter>
|
22
|
+
<ac:rich-text-body>
|
23
|
+
<table>
|
24
|
+
<tbody>
|
25
|
+
<tr>
|
26
|
+
<th>Label</th>
|
27
|
+
<th>Value</th>
|
28
|
+
</tr>
|
29
|
+
<tr>
|
30
|
+
<td>Success</td>
|
31
|
+
<td><%= @gauge_success %></td>
|
32
|
+
</tr>
|
33
|
+
<tr>
|
34
|
+
<td>Expected error</td>
|
35
|
+
<td><%= @gauge_expected_error %></td>
|
36
|
+
</tr>
|
37
|
+
<tr>
|
38
|
+
<td>Unexpected error</td>
|
39
|
+
<td><%= @gauge_unexpected_error %></td>
|
40
|
+
</tr>
|
41
|
+
<tr>
|
42
|
+
<td>Missing</td>
|
43
|
+
<td><%= @gauge_not_run %></td>
|
44
|
+
</tr>
|
45
|
+
</tbody>
|
46
|
+
</table>
|
47
|
+
</ac:rich-text-body>
|
48
|
+
</ac:structured-macro>
|
49
|
+
<% end %>
|
@@ -0,0 +1,242 @@
|
|
1
|
+
<ac:structured-macro ac:name="toc" ac:schema-version="1"/>
|
2
|
+
<h1>Summary</h1>
|
3
|
+
<table>
|
4
|
+
<tbody>
|
5
|
+
<% # Compute the global counters of tests
|
6
|
+
global_info = classify_tests(global_tests)
|
7
|
+
platform_info = classify_tests(platform_tests)
|
8
|
+
node_info = classify_tests(node_tests)
|
9
|
+
success_percentage = 100.0 * (global_info[:success].size + platform_info[:success].size + node_info[:success].size).to_f / (global_tests.size + platform_tests.size + node_tests.size)
|
10
|
+
%>
|
11
|
+
<tr>
|
12
|
+
<th style="text-align: center; vertical-align: middle;">Global-level tests</th>
|
13
|
+
<th style="text-align: center; vertical-align: middle;">Platforms/repositories tests</th>
|
14
|
+
<th style="text-align: center; vertical-align: middle;">Nodes tests</th>
|
15
|
+
</tr>
|
16
|
+
<tr>
|
17
|
+
<td style="text-align: center; vertical-align: middle;">
|
18
|
+
<ac:structured-macro ac:name="status" ac:schema-version="1">
|
19
|
+
<ac:parameter ac:name="colour"><%= status_color(global_info[:status]) %></ac:parameter>
|
20
|
+
</ac:structured-macro>
|
21
|
+
</td>
|
22
|
+
<td style="text-align: center; vertical-align: middle;">
|
23
|
+
<ac:structured-macro ac:name="status" ac:schema-version="1">
|
24
|
+
<ac:parameter ac:name="colour"><%= status_color(platform_info[:status]) %></ac:parameter>
|
25
|
+
</ac:structured-macro>
|
26
|
+
</td>
|
27
|
+
<td style="text-align: center; vertical-align: middle;">
|
28
|
+
<ac:structured-macro ac:name="status" ac:schema-version="1">
|
29
|
+
<ac:parameter ac:name="colour"><%= status_color(node_info[:status]) %></ac:parameter>
|
30
|
+
</ac:structured-macro>
|
31
|
+
</td>
|
32
|
+
</tr>
|
33
|
+
<tr>
|
34
|
+
<td style="text-align: center; vertical-align: middle;"><%= render_gauge(global_info) %></td>
|
35
|
+
<td style="text-align: center; vertical-align: middle;"><%= render_gauge(platform_info) %></td>
|
36
|
+
<td style="text-align: center; vertical-align: middle;"><%= render_gauge(node_info) %></td>
|
37
|
+
</tr>
|
38
|
+
</tbody>
|
39
|
+
</table>
|
40
|
+
<h1>Evolution</h1>
|
41
|
+
<ac:structured-macro ac:name="chart" ac:schema-version="1">
|
42
|
+
<ac:parameter ac:name="imageFormat">png</ac:parameter>
|
43
|
+
<ac:parameter ac:name="timeSeries">true</ac:parameter>
|
44
|
+
<ac:parameter ac:name="dateFormat">yyyy-MM-dd HH:mm:ss</ac:parameter>
|
45
|
+
<ac:parameter ac:name="forgive">false</ac:parameter>
|
46
|
+
<ac:parameter ac:name="timePeriod">Second</ac:parameter>
|
47
|
+
<ac:parameter ac:name="width">800</ac:parameter>
|
48
|
+
<ac:parameter ac:name="dataOrientation">vertical</ac:parameter>
|
49
|
+
<ac:parameter ac:name="type">timeSeries</ac:parameter>
|
50
|
+
<ac:parameter ac:name="yLabel">% success</ac:parameter>
|
51
|
+
<ac:parameter ac:name="height">300</ac:parameter>
|
52
|
+
<ac:rich-text-body>
|
53
|
+
<table>
|
54
|
+
<tbody>
|
55
|
+
<tr>
|
56
|
+
<th>Time</th>
|
57
|
+
<th>% success</th>
|
58
|
+
</tr>
|
59
|
+
<% (@previous_success_percentages + [[Time.now.utc, success_percentage]]).each do |time, percentage| %>
|
60
|
+
<tr>
|
61
|
+
<td><%= time.strftime('%F %T') %></td>
|
62
|
+
<td><%= percentage %></td>
|
63
|
+
</tr>
|
64
|
+
<% end %>
|
65
|
+
</tbody>
|
66
|
+
</table>
|
67
|
+
</ac:rich-text-body>
|
68
|
+
</ac:structured-macro>
|
69
|
+
<h1>Platforms used for those tests</h1>
|
70
|
+
<table>
|
71
|
+
<tbody>
|
72
|
+
<tr>
|
73
|
+
<th>Platform</th>
|
74
|
+
<th>Commit title</th>
|
75
|
+
<th>Commit date</th>
|
76
|
+
<th>Commit hash</th>
|
77
|
+
<th>Commit author</th>
|
78
|
+
</tr>
|
79
|
+
<% @tests.map { |test| test.platform }.uniq.compact.sort.each do |platform| %>
|
80
|
+
<% platform_info = platform.info %>
|
81
|
+
<tr>
|
82
|
+
<td><strong><%= platform.name %></strong></td>
|
83
|
+
<td><%= CGI.escapeHTML(platform_info[:commit][:message]) %></td>
|
84
|
+
<td><%= platform_info[:commit][:date].strftime('%F %T') %></td>
|
85
|
+
<td><%= platform_info[:commit][:id] %></td>
|
86
|
+
<td><%= CGI.escapeHTML(platform_info[:commit][:author][:name]) %> (<%= CGI.escapeHTML(platform_info[:commit][:author][:email]) %>)</td>
|
87
|
+
</tr>
|
88
|
+
<% end %>
|
89
|
+
</tbody>
|
90
|
+
</table>
|
91
|
+
<h1>Stats by nodes list</h1>
|
92
|
+
<table>
|
93
|
+
<tbody>
|
94
|
+
<tr>
|
95
|
+
<th style="vertical-align: middle;">Nodes list</th>
|
96
|
+
<th style="text-align: center; vertical-align: middle;">Status</th>
|
97
|
+
<th style="text-align: center; vertical-align: middle;"></th>
|
98
|
+
</tr>
|
99
|
+
<% nodes_by_nodes_list.each do |nodes_list, nodes_info| %>
|
100
|
+
<tr>
|
101
|
+
<td style="vertical-align: middle;">
|
102
|
+
<strong><%= nodes_list %></strong>
|
103
|
+
<br/>
|
104
|
+
<ac:structured-macro ac:name="status" ac:schema-version="1">
|
105
|
+
<ac:parameter ac:name="colour"><%=
|
106
|
+
if nodes_info[:tested_nodes].empty?
|
107
|
+
'Grey'
|
108
|
+
elsif nodes_info[:tested_nodes_in_error].empty?
|
109
|
+
'Green'
|
110
|
+
else
|
111
|
+
'Red'
|
112
|
+
end %></ac:parameter>
|
113
|
+
</ac:structured-macro>
|
114
|
+
</td>
|
115
|
+
<td style="text-align: center; vertical-align: middle;">
|
116
|
+
Total: <%= nodes_info[:nodes].size %> (<%= nodes_info[:tested_nodes].size %> tested) / Errors: <%= nodes_info[:tested_nodes_in_error].size %> (<%= nodes_info[:tested_nodes_in_error_as_expected].size %> expected)
|
117
|
+
<br/>
|
118
|
+
<% unless nodes_info[:nodes].empty? %>
|
119
|
+
<table>
|
120
|
+
<tbody>
|
121
|
+
<tr>
|
122
|
+
<% ((nodes_info[:tested_nodes_in_error_as_expected].size * @nbr_cells_in_status_bars.to_f) / nodes_info[:nodes].size).round.times do %>
|
123
|
+
<td bgcolor="#FFD351">
|
124
|
+
<br/>
|
125
|
+
</td>
|
126
|
+
<% end %>
|
127
|
+
<% (((nodes_info[:tested_nodes_in_error].size - nodes_info[:tested_nodes_in_error_as_expected].size).abs * @nbr_cells_in_status_bars.to_f) / nodes_info[:nodes].size).round.times do %>
|
128
|
+
<td bgcolor="#D04437">
|
129
|
+
<br/>
|
130
|
+
</td>
|
131
|
+
<% end %>
|
132
|
+
<% (((nodes_info[:tested_nodes].size - nodes_info[:tested_nodes_in_error].size) * @nbr_cells_in_status_bars.to_f) / nodes_info[:nodes].size).round.times do %>
|
133
|
+
<td bgcolor="#14892C">
|
134
|
+
<br/>
|
135
|
+
</td>
|
136
|
+
<% end %>
|
137
|
+
<% (((nodes_info[:nodes].size - nodes_info[:tested_nodes].size) * @nbr_cells_in_status_bars.to_f) / nodes_info[:nodes].size).round.times do %>
|
138
|
+
<td bgcolor="#CCCCCC">
|
139
|
+
<br/>
|
140
|
+
</td>
|
141
|
+
<% end %>
|
142
|
+
</tr>
|
143
|
+
</tbody>
|
144
|
+
</table>
|
145
|
+
<% end %>
|
146
|
+
</td>
|
147
|
+
<td style="text-align: center; vertical-align: middle;">
|
148
|
+
<% unless (nodes_info[:tested_nodes_in_error] - nodes_info[:tested_nodes_in_error_as_expected]).empty? %>
|
149
|
+
<ac:structured-macro ac:name="expand" ac:schema-version="1">
|
150
|
+
<ac:parameter ac:name="title">Unexpected nodes in error</ac:parameter>
|
151
|
+
<ac:rich-text-body>
|
152
|
+
<div style="text-align: left;">
|
153
|
+
<ul>
|
154
|
+
<% (nodes_info[:tested_nodes_in_error] - nodes_info[:tested_nodes_in_error_as_expected]).sort.each do |node| %>
|
155
|
+
<li><%= node %></li>
|
156
|
+
<% end %>
|
157
|
+
</ul>
|
158
|
+
</div>
|
159
|
+
</ac:rich-text-body>
|
160
|
+
</ac:structured-macro>
|
161
|
+
<% end %>
|
162
|
+
</td>
|
163
|
+
</tr>
|
164
|
+
<% end %>
|
165
|
+
</tbody>
|
166
|
+
</table>
|
167
|
+
<h1>Global tests</h1>
|
168
|
+
<table>
|
169
|
+
<tbody>
|
170
|
+
<tr>
|
171
|
+
<th style="text-align: center; vertical-align: middle;">Test</th>
|
172
|
+
<% @global_test_names.each do |test_name| %>
|
173
|
+
<th style="text-align: center; vertical-align: middle;"><%= test_name %></th>
|
174
|
+
<% end %>
|
175
|
+
</tr>
|
176
|
+
<tr>
|
177
|
+
<td style="text-align: center; vertical-align: middle;"></td>
|
178
|
+
<% @global_test_names.each do |test_name| %>
|
179
|
+
<td style="text-align: center; vertical-align: middle;">
|
180
|
+
<%= render_status(test_name, {}) %>
|
181
|
+
</td>
|
182
|
+
<% end %>
|
183
|
+
</tr>
|
184
|
+
</tbody>
|
185
|
+
</table>
|
186
|
+
<h1>Platform tests</h1>
|
187
|
+
<table>
|
188
|
+
<tbody>
|
189
|
+
<tr>
|
190
|
+
<th style="vertical-align: middle;">Platforms \ Test</th>
|
191
|
+
<% @platform_test_names.each do |test_name| %>
|
192
|
+
<th style="text-align: center; vertical-align: middle;"><%= test_name %></th>
|
193
|
+
<% end %>
|
194
|
+
</tr>
|
195
|
+
<% @tested_platforms.each do |platform| %>
|
196
|
+
<tr>
|
197
|
+
<td style="vertical-align: middle;">
|
198
|
+
<ac:structured-macro ac:name="status" ac:schema-version="1">
|
199
|
+
<ac:parameter ac:name="colour"><%= group_errors(platform_tests.select { |test| test.platform == platform }, :test_name).empty? ? 'Green' : 'Red' %></ac:parameter>
|
200
|
+
</ac:structured-macro>
|
201
|
+
<strong><%= platform.name %></strong>
|
202
|
+
</td>
|
203
|
+
<% @platform_test_names.each do |test_name| %>
|
204
|
+
<td style="text-align: center; vertical-align: middle;">
|
205
|
+
<%= render_status(test_name, { platform: platform }) %>
|
206
|
+
</td>
|
207
|
+
<% end %>
|
208
|
+
</tr>
|
209
|
+
<% end %>
|
210
|
+
</tbody>
|
211
|
+
</table>
|
212
|
+
<h1>Node tests</h1>
|
213
|
+
<table>
|
214
|
+
<tbody>
|
215
|
+
<tr>
|
216
|
+
<th style="vertical-align: middle;">Nodes \ Test</th>
|
217
|
+
<% @node_test_names.each do |test_name| %>
|
218
|
+
<th style="text-align: center; vertical-align: middle;"><%= test_name %></th>
|
219
|
+
<% end %>
|
220
|
+
</tr>
|
221
|
+
<% @tested_nodes.each do |node| %>
|
222
|
+
<tr>
|
223
|
+
<td style="vertical-align: middle;">
|
224
|
+
<ac:structured-macro ac:name="status" ac:schema-version="1">
|
225
|
+
<ac:parameter ac:name="colour"><%= group_errors(node_tests.select { |test| test.node == node }, :test_name).empty? ? 'Green' : 'Red' %></ac:parameter>
|
226
|
+
</ac:structured-macro>
|
227
|
+
<strong><%= node %></strong>
|
228
|
+
</td>
|
229
|
+
<% @node_test_names.each do |test_name| %>
|
230
|
+
<td style="text-align: center; vertical-align: middle;">
|
231
|
+
<%= render_status(test_name, { node: node }) %>
|
232
|
+
</td>
|
233
|
+
<% end %>
|
234
|
+
</tr>
|
235
|
+
<% end %>
|
236
|
+
</tbody>
|
237
|
+
</table>
|
238
|
+
<p>
|
239
|
+
<br/>
|
240
|
+
Generated at <%= Time.now.utc.strftime('%F %T') %> UTC by <a href="https://www.site.my_company.net/git/projects/PROJECTrepos/hybrid_platforms_conductor/browse">Hybrid Platforms Conductor</a>.
|
241
|
+
<br/>
|
242
|
+
</p>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module HybridPlatformsConductor
|
2
|
+
|
3
|
+
# Simple router of IO and queue streams from som inputs to outputs, asynchronous
|
4
|
+
class IoRouter
|
5
|
+
|
6
|
+
# Create an IO router and make sure it is freed when client code has finished
|
7
|
+
#
|
8
|
+
# Parameters::
|
9
|
+
# * *routes* (Hash<IO or Queue, Array<IO> >): List of destination IOs that should receive content per source IO.
|
10
|
+
# * Proc: Client code
|
11
|
+
def self.with_io_router(routes)
|
12
|
+
io_router = IoRouter.new(routes)
|
13
|
+
begin
|
14
|
+
io_router.start
|
15
|
+
yield
|
16
|
+
ensure
|
17
|
+
io_router.stop
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
# Constructor
|
22
|
+
#
|
23
|
+
# Parameters::
|
24
|
+
# * *routes* (Hash<IO or Queue, Array<IO> >): List of destination IOs that should receive content per source IO.
|
25
|
+
def initialize(routes)
|
26
|
+
@routes = routes
|
27
|
+
@reading_thread = nil
|
28
|
+
end
|
29
|
+
|
30
|
+
# Start routing messages asynchronously
|
31
|
+
def start
|
32
|
+
raise 'IO router is already started. Can\'t start it again.' unless @reading_thread.nil?
|
33
|
+
@end_read = false
|
34
|
+
# Create a thread to handle routes asynchronously
|
35
|
+
@reading_thread = Thread.new do
|
36
|
+
loop do
|
37
|
+
need_to_stop = @end_read.clone
|
38
|
+
data_found = false
|
39
|
+
@routes.each do |src_io, dst_ios|
|
40
|
+
if src_io.is_a?(Queue)
|
41
|
+
queue_size = src_io.size
|
42
|
+
if queue_size > 0
|
43
|
+
# There is data to be read from src_io
|
44
|
+
data_found = true
|
45
|
+
data_chunk_str = queue_size.times.map { src_io.pop }.join
|
46
|
+
dst_ios.each do |dst_io|
|
47
|
+
dst_io << data_chunk_str
|
48
|
+
dst_io.flush if dst_io.respond_to?(:flush)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
else
|
52
|
+
raise "Unknown type of source IO: #{src_io}"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
break if need_to_stop && !data_found
|
56
|
+
sleep 0.1
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Stop routing messages asynchronously
|
62
|
+
def stop
|
63
|
+
raise 'IO router is not started. Can\'t stop it.' if @reading_thread.nil?
|
64
|
+
@end_read = true
|
65
|
+
@reading_thread.join
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'logger'
|
3
|
+
require 'hybrid_platforms_conductor/logger_helpers'
|
4
|
+
require 'hybrid_platforms_conductor/nodes_handler'
|
5
|
+
require 'hybrid_platforms_conductor/deployer'
|
6
|
+
|
7
|
+
module HybridPlatformsConductor
|
8
|
+
|
9
|
+
# Gives ways to dump nodes info into JSON files
|
10
|
+
class JsonDumper
|
11
|
+
|
12
|
+
include LoggerHelpers
|
13
|
+
|
14
|
+
# The output JSON directory
|
15
|
+
# String
|
16
|
+
attr_accessor :dump_dir
|
17
|
+
|
18
|
+
# Constructor
|
19
|
+
#
|
20
|
+
# Parameters::
|
21
|
+
# * *logger* (Logger): Logger to be used [default = Logger.new(STDOUT)]
|
22
|
+
# * *logger_stderr* (Logger): Logger to be used for stderr [default = Logger.new(STDERR)]
|
23
|
+
# * *config* (Config): Config to be used. [default = Config.new]
|
24
|
+
# * *nodes_handler* (NodesHandler): Nodes handler to be used. [default = NodesHandler.new]
|
25
|
+
# * *deployer* (Deployer): Deployer to be used. [default = Deployer.new]
|
26
|
+
def initialize(logger: Logger.new(STDOUT), logger_stderr: Logger.new(STDERR), config: Config.new, nodes_handler: NodesHandler.new, deployer: Deployer.new)
|
27
|
+
init_loggers(logger, logger_stderr)
|
28
|
+
@config = config
|
29
|
+
@nodes_handler = nodes_handler
|
30
|
+
@deployer = deployer
|
31
|
+
# Default values
|
32
|
+
@skip_run = false
|
33
|
+
@dump_dir = 'nodes_json'
|
34
|
+
end
|
35
|
+
|
36
|
+
# Complete an option parser with ways to tune the way to dump nodes json
|
37
|
+
#
|
38
|
+
# Parameters::
|
39
|
+
# * *options_parser* (OptionParser): The option parser to complete
|
40
|
+
def options_parse(options_parser)
|
41
|
+
options_parser.separator ''
|
42
|
+
options_parser.separator 'JSON dump options:'
|
43
|
+
options_parser.on('-k', '--skip-run', 'Skip the actual gathering of dumps in run_logs. If set, the current run_logs content will be used.') do
|
44
|
+
@skip_run = true
|
45
|
+
end
|
46
|
+
options_parser.on('-j', '--json-dir DIRECTORY', "Specify the output directory in which JSON files are being written. Defaults to #{@dump_dir}.") do |dir|
|
47
|
+
@dump_dir = dir
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Dump JSON files containing description of the given nodes
|
52
|
+
#
|
53
|
+
# Parameters::
|
54
|
+
# * *nodes_selectors* (Array<object>): List of nodes selectors to dump files for
|
55
|
+
def dump_json_for(nodes_selectors)
|
56
|
+
nodes = @nodes_handler.select_nodes(nodes_selectors)
|
57
|
+
unless @skip_run
|
58
|
+
nodes.map { |node| @nodes_handler.platform_for(node) }.uniq.each.each do |platform_handler|
|
59
|
+
platform_handler.prepare_why_run_deploy_for_json_dump
|
60
|
+
end
|
61
|
+
@deployer.concurrent_execution = true
|
62
|
+
@deployer.use_why_run = true
|
63
|
+
@deployer.deploy_on(nodes)
|
64
|
+
end
|
65
|
+
# Parse the logs
|
66
|
+
FileUtils.mkdir_p @dump_dir
|
67
|
+
nodes.each do |node|
|
68
|
+
stdout_file_name = "#{@config.hybrid_platforms_dir}/run_logs/#{node}.stdout"
|
69
|
+
if File.exist?(stdout_file_name)
|
70
|
+
stdout = File.read(stdout_file_name).split("\n")
|
71
|
+
dump_begin_idx = stdout.index('===== Node JSON dump BEGIN =====')
|
72
|
+
dump_end_idx = stdout.index('===== Node JSON dump END =====')
|
73
|
+
if dump_begin_idx.nil? || dump_end_idx.nil?
|
74
|
+
out "[ #{node} ] - Error while dumping JSON. Check #{stdout_file_name}"
|
75
|
+
else
|
76
|
+
json_file_name = "#{@dump_dir}/#{node}.json"
|
77
|
+
File.write(json_file_name, stdout[dump_begin_idx+1..dump_end_idx-1].join("\n"))
|
78
|
+
out "[ #{node} ] - OK. Check #{json_file_name}"
|
79
|
+
end
|
80
|
+
else
|
81
|
+
out "[ #{node} ] - Error while dumping JSON. File #{stdout_file_name} does not exist."
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|