Jelajahi Sumber

Merge pull request #830 from sakshiarora13/devel

Issue#829: Parallel-coordinate dashboard for grafana
Sujit Jadhav 3 tahun lalu
induk
melakukan
2308104bc8

+ 1 - 1
control_plane/roles/webui_grafana/tasks/plugins.yml

@@ -17,7 +17,7 @@
   ansible.builtin.git:
     repo: "{{ grafana_plugins_github_repo }}"
     dest: "{{ mount_location + grafana_plugins_folder_name }}"
-    version: main
+    version: "{{ grafana_plugins_stable_commit }}"
 
 - name: Wait for grafana pod to come to ready state
   command: kubectl wait --for=condition=ready --timeout="{{ grafana_pod_timeout }}" -n "{{ grafana_namespace }}" pod -l app="{{ grafana_k8s }}"

+ 1 - 0
control_plane/roles/webui_grafana/vars/main.yml

@@ -44,3 +44,4 @@ plugins_name:
   - stream-net.zip
 grafana_plugins_folder_name: github-grafana-plugins/
 grafana_plugins_github_repo: https://github.com/nsfcac/grafana-plugin.git
+grafana_plugins_stable_commit: "947da4f"

+ 1 - 1
telemetry/input_params/base_vars.yml

@@ -15,7 +15,7 @@
 
 # At this location all telemetry related files will be stored and
 # both timescale and mysql databases will be mounted.
-mount_location: /mnt/omnia/
+mount_location: /opt/omnia/
 
 # This variable is used to enable iDRAC telemetry support and visualizations
 # Accepted values:  "true" or "false"

+ 2 - 2
telemetry/roles/grafana_config/files/parallel-coordinate.json

@@ -314,8 +314,8 @@
   },
   "timepicker": {},
   "timezone": "",
-  "title": "iDRAC-and-Slurm-Telemetry",
+  "title": "Parallel-Coordinate",
   "uid": "pArBHUtnk",
   "version": 6,
   "weekStart": ""
-}
+}

+ 24 - 0
telemetry/roles/grafana_config/tasks/add_dashboards.yml

@@ -0,0 +1,24 @@
+# Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+---
+
+- name: Import dashboards for visualizations
+  community.grafana.grafana_dashboard:
+    grafana_url: "http://{{ grafana_svc_ip.stdout }}:{{ grafana_svc_port.stdout }}"
+    grafana_user: "{{ grafana_username }}"
+    grafana_password: "{{ grafana_password }}"
+    state: present
+    overwrite: yes
+    path: "{{ playbook_dir }}/roles/grafana_config/files/{{ dashboards }}"
+  no_log: true

+ 5 - 4
telemetry/roles/grafana_config/tasks/add_datasource.yml

@@ -24,12 +24,12 @@
   register: grafana_svc_port
 
 - name: Get timescaleDB svc IP
-  command: kubectl get svc -n "{{ namespace }}" -o=jsonpath='{.items[0].spec.clusterIP}'
+  command: kubectl get svc "{{ timescaledb_k8s_name }}" -n "{{ namespace }}" -o=jsonpath='{.spec.clusterIP}'
   changed_when: false
   register: timescale_svc_ip
 
 - name: Get timescaleDB svc port
-  command: kubectl get svc -n "{{ namespace }}" -o=jsonpath='{.items[0].spec.ports[0].port}'
+  command: kubectl get svc "{{ timescaledb_k8s_name }}" -n "{{ namespace }}" -o=jsonpath='{.spec.ports[0].port}'
   changed_when: false
   register: timescale_svc_port
 
@@ -44,11 +44,12 @@
     grafana_user: "{{ grafana_username }}"
     grafana_password: "{{ grafana_password }}"
     ds_type: "postgres"
-    ds_url: "http://{{ timescale_svc_ip.stdout }}:{{ timescale_svc_port.stdout }}"
+    database: "{{ timescaledb_name }}"
+    ds_url: "{{ timescale_svc_ip.stdout }}:{{ timescale_svc_port.stdout }}"
     user: "{{ timescaledb_user }}"
     sslmode: "disable"
     additional_json_data:
-      postgresVersion: 12
+      postgresVersion: 12+
       timescaledb: true
     additional_secure_json_data:
       password: "{{ timescaledb_password }}"

+ 7 - 4
telemetry/roles/grafana_config/tasks/main.yml

@@ -13,8 +13,11 @@
 # limitations under the License.
 ---
 
-- name: Add telemetry datasource on grafana
-  include_tasks: add_datasource.yml
+- name: Configure grafana for telemetry
+  block:
+  - name: Add telemetry datasource on grafana
+    include_tasks: add_datasource.yml
 
-#- name: Add dashboards on grafana
-#  include_tasks: add_dashboards.yml
+  - name: Add dashboards on grafana
+    include_tasks: add_dashboards.yml
+  when: idrac_telemetry_support is true

+ 1 - 0
telemetry/roles/grafana_config/vars/main.yml

@@ -15,3 +15,4 @@
 
 grafana_k8s: grafana
 grafana_namespace: grafana
+dashboards: parallel-coordinate.json

+ 5 - 4
telemetry/roles/idrac_telemetry/tasks/initiate_telemetry.yml

@@ -38,7 +38,7 @@
       tower_config_file: "{{ playbook_dir }}/../control_plane/roles/webui_awx/files/.tower_cli.cfg"
       tower_vault_file: "{{ playbook_dir }}/../control_plane/roles/webui_awx/files/.tower_vault_key"
       idrac_telemetry_scripting_repo: "https://github.com/dell/iDRAC-Telemetry-Scripting.git"
-      idrac_telemetry_scripting_branch: master
+      idrac_telemetry_scripting_stable_commit: "1f4bb26"
       idrac_telemetry_scripting_folder: iDRAC-Telemetry-Scripting
       idrac_login_input_filename: "{{ playbook_dir }}/../control_plane/input_params/login_vars.yml"
       idrac_login_vault_filename: "{{ playbook_dir }}/../control_plane/input_params/.login_vault_key"
@@ -213,7 +213,7 @@
       ansible.builtin.git:
         repo: "{{ idrac_telemetry_scripting_repo }}"
         dest: "{{ mount_location + idrac_telemetry_scripting_folder }}"
-        version: "{{ idrac_telemetry_scripting_branch }}"
+        version: "{{ idrac_telemetry_scripting_stable_commit }}"
       register: telemetry_collection
 
     - name: Enable telemetry collection on iDRACs
@@ -221,12 +221,13 @@
       args:
         chdir: "{{ mount_location + idrac_telemetry_scripting_folder }}"
       with_items: "{{ telemetry_idrac }}"
+      changed_when: false
       no_log: true
     when: telemetry_idrac is defined and (telemetry_idrac |length>0)
     rescue:
       - name: Show failure msg
-        fail:
-          msg: "Enabling telemetry on iDRAC failed"
+        debug:
+          msg: "Enabling telemetry on an iDRAC failed"
 
   - name: Add iDRAC details in mysqldb
     block:

+ 1 - 1
telemetry/roles/timescaledb/tasks/main.yml

@@ -23,7 +23,7 @@
   ansible.builtin.git:
     repo: "{{ idrac_telemetry_github }}"
     dest: "{{ mount_location + idrac_telemetry_folder_name }}"
-    version: master
+    version: "{{ reference_tools_stable_commit }}"
 
 - name: Create timescaledb pod
   include_tasks: timescaledb_pod.yml

+ 1 - 0
telemetry/roles/timescaledb/vars/main.yml

@@ -23,3 +23,4 @@ timescaledb_k8s_name: timescaledb
 timescaledb_container_port: 5432
 retries: 10
 delay: 10
+reference_tools_stable_commit: "0016fcb"