From 1bfa09120350f0f071e7912cc1ad97be6c75056d Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Mon, 18 Nov 2019 07:23:47 -0600 Subject: [PATCH] Grafana: Update version This updates the Grafana version deployed by default from 5.0.0 to 6.2.0 Change-Id: I39b5405cc3f3fe7754ed6544a8388ff912a4ef58 Signed-off-by: Steve Wilkerson --- grafana/templates/bin/_grafana.sh.tpl | 2 +- grafana/templates/bin/_selenium-tests.py.tpl | 4 ++-- grafana/templates/deployment.yaml | 6 +++++- grafana/values.yaml | 6 +++--- tools/gate/selenium/grafanaSelenium.py | 14 +++++++------- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/grafana/templates/bin/_grafana.sh.tpl b/grafana/templates/bin/_grafana.sh.tpl index 5213591fa..bc2d1f573 100644 --- a/grafana/templates/bin/_grafana.sh.tpl +++ b/grafana/templates/bin/_grafana.sh.tpl @@ -19,7 +19,7 @@ set -ex COMMAND="${@:-start}" function start () { - exec /usr/sbin/grafana-server -homepath=/usr/share/grafana -config=/etc/grafana/grafana.ini + exec /usr/share/grafana/bin/grafana-server -homepath=/usr/share/grafana -config=/etc/grafana/grafana.ini } function stop () { diff --git a/grafana/templates/bin/_selenium-tests.py.tpl b/grafana/templates/bin/_selenium-tests.py.tpl index f18ecde1a..f848b1734 100644 --- a/grafana/templates/bin/_selenium-tests.py.tpl +++ b/grafana/templates/bin/_selenium-tests.py.tpl @@ -77,8 +77,8 @@ try: browser.find_element_by_name('password').send_keys(password) browser.find_element_by_css_selector( 'body > grafana-app > div.main-view > div > div:nth-child(1) > div > ' - 'div > div.login-inner-box > form > div.login-button-group > button' - ).click() + 'div > div.login-outer-box > div.login-inner-box > form > div.login-button-group > button' + ).click() logger.info("Successfully logged in to Grafana") except NoSuchElementException: logger.error("Failed to log in to Grafana") diff --git a/grafana/templates/deployment.yaml b/grafana/templates/deployment.yaml index 3b07b6461..80e7e01b0 100644 --- a/grafana/templates/deployment.yaml +++ b/grafana/templates/deployment.yaml @@ -88,6 +88,8 @@ spec: mountPath: /tmp - name: pod-etc-grafana mountPath: /etc/grafana + - name: pod-screenshots-grafana + mountPath: /var/lib/grafana/png - name: pod-provisioning-grafana mountPath: {{ .Values.conf.grafana.paths.provisioning }} - name: grafana-bin @@ -110,7 +112,7 @@ spec: mountPath: /var/lib/grafana/data {{- range $key, $value := .Values.conf.dashboards }} - name: grafana-etc - mountPath: /var/lib/grafana/dashboards/{{$key}}.json + mountPath: /etc/grafana/dashboards/{{$key}}.json subPath: {{$key}}.json {{- end }} {{ if $mounts_grafana.volumeMounts }}{{ toYaml $mounts_grafana.volumeMounts | indent 12 }}{{ end }} @@ -119,6 +121,8 @@ spec: emptyDir: {} - name: pod-etc-grafana emptyDir: {} + - name: pod-screenshots-grafana + emptyDir: {} - name: pod-provisioning-grafana emptyDir: {} - name: grafana-bin diff --git a/grafana/values.yaml b/grafana/values.yaml index 636a6cedb..fff6de0ae 100644 --- a/grafana/values.yaml +++ b/grafana/values.yaml @@ -18,7 +18,7 @@ images: tags: - grafana: docker.io/grafana/grafana:5.0.0 + grafana: docker.io/grafana/grafana:6.2.0 dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0 db_init: docker.io/openstackhelm/heat:newton-ubuntu_xenial grafana_db_session_sync: docker.io/openstackhelm/heat:newton-ubuntu_xenial @@ -428,7 +428,7 @@ conf: disableDeletion: false editable: false options: - path: /var/lib/grafana/dashboards + path: /etc/grafana/dashboards datasources: #NOTE(srwilkers): The top key for each datasource (eg: monitoring) must # map to the key name for the datasource's endpoint entry in the endpoints @@ -450,7 +450,7 @@ conf: paths: data: /var/lib/grafana/data plugins: /var/lib/grafana/plugins - provisioning: /var/lib/grafana/provisioning + provisioning: /etc/grafana/provisioning server: protocol: http http_port: 3000 diff --git a/tools/gate/selenium/grafanaSelenium.py b/tools/gate/selenium/grafanaSelenium.py index d4af182c5..ab0db9876 100755 --- a/tools/gate/selenium/grafanaSelenium.py +++ b/tools/gate/selenium/grafanaSelenium.py @@ -45,7 +45,7 @@ try: st.browser.find_element_by_name('password').send_keys(password) st.browser.find_element_by_css_selector( 'body > grafana-app > div.main-view > div > div:nth-child(1) > div > ' - 'div > div.login-inner-box > form > div.login-button-group > button' + 'div > div.login-outer-box > div.login-inner-box > form > div.login-button-group > button' ).click() st.logger.info("Successfully logged in to Grafana") except NoSuchElementException: @@ -59,9 +59,9 @@ try: st.click_link_by_name('Nodes') el = WebDriverWait(st.browser, 15).until( EC.presence_of_element_located( - (By.XPATH, '/html/body/grafana-app/div[2]/div/div[1]/div/div/' - 'div[1]/dashboard-grid/div/div[1]/div/plugin-component/' - 'panel-plugin-graph/grafana-panel/div/div[2]') + (By.XPATH, '/html/body/grafana-app/div/div/div/react-container/div' + '/div[2]/div/div[1]/div/div/div[1]/div/div/div/plugin-component' + '/panel-plugin-graph/grafana-panel/div/div[2]') ) ) st.take_screenshot('Grafana Nodes') @@ -76,9 +76,9 @@ try: st.click_link_by_name('Kubernetes Cluster Status') el = WebDriverWait(st.browser, 15).until( EC.presence_of_element_located( - (By.XPATH, '/html/body/grafana-app/div[2]/div/div[1]/div/' - 'div/div[1]/dashboard-grid/div/div[5]/div/plugin-component/' - 'panel-plugin-singlestat/grafana-panel/div') + (By.XPATH, '/html/body/grafana-app/div/div/div/react-container/div' + '/div[2]/div/div[1]/div/div/div[5]/div/div/div/plugin-component' + '/panel-plugin-singlestat/grafana-panel/div') ) ) st.take_screenshot('Grafana Cluster Status')