Skip to content

Commit 27c8ea6

Browse files
authored
Merge pull request #64 from Helene/v7.0.6
publish V7.0.6
2 parents 9bfc76d + f121d2c commit 27c8ea6

File tree

8 files changed

+93
-26
lines changed

8 files changed

+93
-26
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: ''
5+
labels: bug
66
assignees: Helene
77

88
---
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: Helene
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

Dockerfile

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
ARG BASE=registry.access.redhat.com/ubi8/ubi:8.5
22
FROM $BASE
33

4+
LABEL com.ibm.name="IBM Spectrum Scale bridge for Grafana"
5+
LABEL com.ibm.vendor="IBM"
6+
LABEL com.ibm.description="This tool translates the IBM Spectrum Scale performance data collected internally \
7+
to the query requests acceptable by the Grafana integrated openTSDB plugin"
8+
LABEL com.ibm.summary="It allows the IBM Spectrum Scale users to perform performance monitoring for IBM Spectrum Scale devices using Grafana"
9+
410
COPY ./requirements/requirements_ubi8.txt /root/requirements_ubi8.txt
511

612
RUN yum install -y python36 python36-devel
@@ -13,11 +19,14 @@ RUN echo "Installed python packages: $(/usr/bin/pip3 list)"
1319
USER root
1420

1521
RUN mkdir -p /opt/IBM/bridge
16-
COPY ./source/ /opt/IBM/bridge
17-
COPY LICENSE /opt/IBM/bridge
18-
19-
RUN mkdir -p /var/mmfs/gen
2022
RUN mkdir -p /opt/IBM/zimon
23+
RUN mkdir -p /var/mmfs/gen
24+
RUN mkdir -p /etc/ssl/certs
25+
RUN mkdir -p /etc/perfmon-api-keys
26+
27+
COPY LICENSE /licenses/
28+
29+
COPY ./source/ /opt/IBM/bridge
2130
COPY ./source/gpfsConfig/mmsdrfs* /var/mmfs/gen/
2231
COPY ./source/gpfsConfig/ZIMon* /opt/IBM/zimon/
2332

@@ -33,8 +42,9 @@ ARG PERFMONPORT=9980
3342
ENV SERVERPORT=$PERFMONPORT
3443
RUN echo "the PERFMONPORT port is set to $SERVERPORT"
3544

36-
ARG CERTPATH=None
45+
ARG CERTPATH='/etc/bridge_ssl/certs'
3746
ENV TLSKEYPATH=$CERTPATH
47+
RUN mkdir -p $CERTPATH
3848

3949
ARG KEYFILE=None
4050
ENV TLSKEYFILE=$KEYFILE
@@ -47,6 +57,7 @@ ENV APIKEYNAME=$KEYNAME
4757

4858
ARG KEYVALUE=None
4959
ENV APIKEYVALUE=$KEYVALUE
60+
RUN if [ "${APIKEYVALUE:0:1}" = "/" ]; then ln -s $APIKEYVALUE /etc/perfmon-api-keys; echo "APIKEYVALUE is a PATH"; else echo "APIKEYVALUE not a PATH"; fi
5061

5162
RUN if [ -z "$TLSKEYPATH" ] || [ -z "$TLSCERTFILE" ] || [ -z "$TLSKEYFILE" ] && [ "$PROTOCOL" = "https" ]; then echo "TLSKEYPATH FOR SSL CONNECTION NOT SET - ERROR"; exit 1; else echo "PASS"; fi
5263
RUN echo "the ssl certificates path is set to $TLSKEYPATH"
@@ -55,23 +66,33 @@ ARG PMCOLLECTORIP=0.0.0.0
5566
ENV SERVER=$PMCOLLECTORIP
5667
RUN echo "the pmcollector server ip is set to $SERVER"
5768

69+
ARG DEFAULTLOGPATH='/var/log/ibm_bridge_for_grafana'
70+
ENV LOGPATH=$DEFAULTLOGPATH
71+
RUN mkdir -p $LOGPATH
72+
RUN echo "the log will use $LOGPATH"
5873

74+
# Switch to the working directory
5975
WORKDIR /opt/IBM/bridge
60-
61-
ARG DEFAULTLOGPATH='/var/log/ibm_bridge_for_grafana/install.log'
62-
ENV LOGPATH=$DEFAULTLOGPATH
63-
RUN mkdir -p $(dirname $LOGPATH)
64-
RUN echo "the log will use $(dirname $LOGPATH)"
6576
RUN echo "$(pwd)"
6677

67-
RUN touch $LOGPATH
68-
RUN echo "log path: $(dirname $LOGPATH)" >> $LOGPATH
69-
RUN echo "pmcollector_server: $SERVER" >> $LOGPATH
70-
RUN echo "ssl certificates location: $TLSKEYPATH" >> $LOGPATH
71-
RUN echo "HTTP/S port: $PORT" >> $LOGPATH
78+
# Create a user 'bridge' under 'root' group
79+
RUN groupadd -g 2099 bridge
80+
RUN useradd -rm -d /home/2001 -s /bin/bash -g 2099 -u 2001 bridge
81+
82+
# Chown all the files to the grafanabridge 'bridge' user
83+
RUN chown -R 2001:2099 /opt/IBM/bridge
84+
RUN chown -R 2001:2099 /opt/IBM/zimon
85+
RUN chown -R 2001:2099 /var/mmfs/gen
86+
RUN chown -R 2001:2099 /etc/ssl/certs
87+
RUN chown -R 2001:2099 /etc/perfmon-api-keys
88+
RUN chown -R 2001:2099 $TLSKEYPATH
89+
RUN chown -R 2001:2099 $LOGPATH
90+
91+
# Switch to user 'bridge'
92+
USER 2001
7293

7394

74-
CMD ["sh", "-c", "python3 zimonGrafanaIntf.py -c 10 -s $SERVER -r $PROTOCOL -p $PORT -P $SERVERPORT -t $TLSKEYPATH --tlsKeyFile $TLSKEYFILE --tlsCertFile $TLSCERTFILE --apiKeyName $APIKEYNAME --apiKeyValue $APIKEYVALUE"]
95+
CMD ["sh", "-c", "python3 zimonGrafanaIntf.py -c 10 -s $SERVER -r $PROTOCOL -p $PORT -P $SERVERPORT -t $TLSKEYPATH -l $LOGPATH --tlsKeyFile $TLSKEYFILE --tlsCertFile $TLSCERTFILE --apiKeyName $APIKEYNAME --apiKeyValue $APIKEYVALUE"]
7596

7697
EXPOSE 4242 8443
7798

docs/CHANGELOG.md renamed to docs/RELEASE_NOTES.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
# Version 7.0.6 (04/12/2022)
2+
Fetch raw data for GPFSDiskCap metrics as workaround for the zimon issue not returning all capacity metrics results. \
3+
Added non root user to the Dockerfile. This way the main process will be started with a non-root user when running in a container. \
4+
Added labels to the Dockerfile
5+
6+
Tested with Grafana version 8.0.3
7+
Tested with RedHat community-powered Grafana operator v.4.1
8+
9+
10+
111
# Version 7.0.5 (02/10/2022)
2-
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi:8.5
3-
Added 'caCertPath' to the configurable parameters, which allows the user to enable or disable CA certificate verification for the REST API HTTPS connections to the pmcollector.
12+
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi:8.5 \
13+
Added 'caCertPath' to the configurable parameters, which allows the user to enable or disable CA certificate verification for the REST API HTTPS connections to the pmcollector. \
414
Added 'retryDelay' to the configurable parameters. Using this parameter the user can control how long the bridge should sleep before re-attempting to query the MetaData, in case no data was returned by pmcollector through the initial bridge startup
515

616
Tested with Grafana version 7.5.1 and 8.0.3
@@ -9,7 +19,7 @@ Tested with RedHat community-powered Grafana operator v.4.1
919

1020

1121
# Version 7.0.4 (09/22/2021)
12-
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi:8.4-209
22+
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi:8.4-209 \
1323
Moved out the documentation files from the repository content. They have been placed on the [project Wiki](https://github.com/IBM/ibm-spectrum-scale-bridge-for-grafana/wiki).
1424

1525
Tested with Grafana version 7.5.1 and 8.0.3
@@ -18,7 +28,7 @@ Tested with RedHat community-powered Grafana operator v.3.10.3
1828

1929

2030
# Version 7.0.3 (08/13/2021)
21-
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi:8.4-206
31+
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi:8.4-206 \
2232
Added requirements_ubi8.txt file including the python versions packages needed to be installed to run the bridge in an OpenShift production environment, on top of the redhat UBI8 image
2333

2434
Tested with Grafana version 7.5.1 and 8.0.3
@@ -27,7 +37,7 @@ Tested with RedHat community-powered Grafana operator v.3.10.3
2737

2838

2939
# Version 7.0.2 (08/02/2021)
30-
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi
40+
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi \
3141
Changed the sleep time = 60 seconds for re-attempting to get the MetaData from the pmcollector in case no data have been returned during the bridge start instead of stopping the process directly
3242

3343
Tested with Grafana version 7.5.1 and 8.0.3

docs/SUPPORT_MATRIX.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
The following matrix gives a quick overview of the supported software for the IBM Spectrum Scale bridge for Grafana packages by version number:
22

3+
# Version 7.0.6 (04/12/2022)
4+
Classic Scale:
5+
- Python 3.6
6+
- CherryPy 18.6.1
7+
- IBM Spectrum Scale system must run 5.1.3.1 and above
8+
- Grafana 8.0.0 and above
9+
10+
Cloud native:
11+
- IBM Spectrum Scale Container Native Storage Access(CNSA) devices having minReleaseLevel 5.1.3.1
12+
- RedHat community-powered Grafana-Operator v4.1
13+
314
# Version 7.0.5 (02/10/2022)
415
Classic Scale:
516
- Python 3.6

source/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
@author: HWASSMAN
2121
'''
2222

23-
__version__ = '7.0.5'
23+
__version__ = '7.0.6'

source/queryHandler/PerfmonRESTclient.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,12 @@ def doRequest(self):
8888
res = requests.Response()
8989
res.status_code = 503
9090
res.reason = "Connection refused from server"
91-
res.content = None
9291
return res
9392
except requests.exceptions.RequestException as e:
9493
self.logger.debug('doRequest __ RequestException. Request data: {}, Response data: {}'.format(e.request, e.response))
9594
res = requests.Response()
9695
res.status_code = 404
9796
res.reason = "The request could not be processed from server"
98-
res.content = None
9997
return res
10098
else:
10199
raise TypeError('doRequest __ Error: request data wrong format')

source/queryHandler/Query.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,14 @@ def addMeasurement(self, meassure):
182182
return self
183183

184184
def __str__(self):
185-
dd = '-a' if self.includeDiskData else ''
185+
# dd = '-a' if self.includeDiskData else ''
186+
# Workaround for RTC Defect 280368: Zimon capacity query does not return all results (seen on CNSA)
187+
if (self.metrics and any('gpfs_disk_' in metric for metric in self.metrics)) or (self.sensor and self.sensor == "GPFSDiskCap"):
188+
dd = '-ar'
189+
elif self.includeDiskData:
190+
dd = '-a'
191+
else:
192+
dd = ''
186193

187194
if self.sensor is not None:
188195
queryString = 'get -j {0} group {1} bucket_size {2} {3}'.format(

0 commit comments

Comments
 (0)