Skip to content

Commit c1d518e

Browse files
authored
Merge pull request #86 from Helene/v7.0.8
publish V7.0.8
2 parents e0a475f + 2ddfdc6 commit c1d518e

File tree

17 files changed

+181
-63
lines changed

17 files changed

+181
-63
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
name: Test
2323
command: |
2424
. venv/bin/activate
25-
flake8 --max-line-length=999 --ignore=E731,E741,E712,E722 --exclude=venv* --statistics
25+
flake8 --max-line-length=999 --ignore=E731,E741,E712,E722,W503 --exclude=venv* --statistics
2626
nose2
2727
- setup_remote_docker:
28-
version: 19.03.13
28+
version: 20.10.17
2929
- run:
3030
name: Build Docker image
3131
command: |

Dockerfile

Lines changed: 72 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
1-
ARG BASE=registry.access.redhat.com/ubi8/ubi:8.5
1+
ARG BASE=registry.access.redhat.com/ubi8/ubi:8.7
22
FROM $BASE
33

44
LABEL com.ibm.name="IBM Spectrum Scale bridge for Grafana"
5-
LABEL com.ibm.vendor="IBM"
5+
LABEL com.ibm.vendor="IBM"
6+
LABEL com.ibm.version="7.0.8"
7+
LABEL com.ibm.url="https://github.com/IBM/ibm-spectrum-scale-bridge-for-grafana"
68
LABEL com.ibm.description="This tool translates the IBM Spectrum Scale performance data collected internally \
79
to the query requests acceptable by the Grafana integrated openTSDB plugin"
810
LABEL com.ibm.summary="It allows the IBM Spectrum Scale users to perform performance monitoring for IBM Spectrum Scale devices using Grafana"
911

10-
COPY ./requirements/requirements_ubi8.txt /root/requirements_ubi8.txt
11-
12-
RUN yum install -y python36 python36-devel
13-
RUN /usr/bin/pip3 install --upgrade pip
12+
ENV PYTHONDONTWRITEBYTECODE 1
13+
ENV PYTHONUNBUFFERED 1
1414

15-
RUN /usr/bin/pip3 install -r /root/requirements_ubi8.txt
16-
RUN echo "Installed python version: $(/usr/bin/python3 -V)"
17-
RUN echo "Installed python packages: $(/usr/bin/pip3 list)"
15+
ARG USERNAME=bridge
16+
ENV USER=$USERNAME
1817

19-
USER root
18+
ARG GROUPNAME=bridge
19+
ENV GROUP=$GROUPNAME
2020

21-
RUN mkdir -p /opt/IBM/bridge
22-
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
21+
ARG USERID=2001
22+
ENV UID=$USERID
2623

27-
COPY LICENSE /licenses/
28-
29-
COPY ./source/ /opt/IBM/bridge
30-
COPY ./source/gpfsConfig/mmsdrfs* /var/mmfs/gen/
31-
COPY ./source/gpfsConfig/ZIMon* /opt/IBM/zimon/
24+
ARG GROUPID=0
25+
ENV GID=$GROUPID
3226

3327
ARG HTTPPROTOCOL=http
3428
ENV PROTOCOL=$HTTPPROTOCOL
@@ -44,7 +38,6 @@ RUN echo "the PERFMONPORT port is set to $SERVERPORT"
4438

4539
ARG CERTPATH='/etc/bridge_ssl/certs'
4640
ENV TLSKEYPATH=$CERTPATH
47-
RUN mkdir -p $CERTPATH
4841

4942
ARG KEYFILE=None
5043
ENV TLSKEYFILE=$KEYFILE
@@ -57,40 +50,77 @@ ENV APIKEYNAME=$KEYNAME
5750

5851
ARG KEYVALUE=None
5952
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
61-
62-
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
63-
RUN echo "the ssl certificates path is set to $TLSKEYPATH"
6453

6554
ARG PMCOLLECTORIP=0.0.0.0
6655
ENV SERVER=$PMCOLLECTORIP
6756
RUN echo "the pmcollector server ip is set to $SERVER"
6857

6958
ARG DEFAULTLOGPATH='/var/log/ibm_bridge_for_grafana'
7059
ENV LOGPATH=$DEFAULTLOGPATH
71-
RUN mkdir -p $LOGPATH
7260
RUN echo "the log will use $LOGPATH"
7361

74-
# Switch to the working directory
75-
WORKDIR /opt/IBM/bridge
76-
RUN echo "$(pwd)"
62+
COPY ./requirements/requirements_ubi8.txt /root/requirements_ubi8.txt
7763

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
64+
RUN yum install -y python36 python36-devel && \
65+
/usr/bin/pip3 install --upgrade pip && \
66+
/usr/bin/pip3 install -r /root/requirements_ubi8.txt && \
67+
echo "Installed python version: $(/usr/bin/python3 -V)" && \
68+
echo "Installed python packages: $(/usr/bin/pip3 list)"
8169

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
70+
USER root
71+
72+
RUN mkdir -p /opt/IBM/bridge /opt/IBM/zimon /var/mmfs/gen && \
73+
mkdir -p /etc/ssl/certs /etc/perfmon-api-keys $CERTPATH $LOGPATH
74+
75+
COPY LICENSE /licenses/
9076

91-
# Switch to user 'bridge'
92-
USER 2001
77+
COPY ./source/ /opt/IBM/bridge
78+
COPY ./source/gpfsConfig/mmsdrfs* /var/mmfs/gen/
79+
COPY ./source/gpfsConfig/ZIMon* /opt/IBM/zimon/
80+
81+
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 && \
82+
if [ -z "$TLSKEYPATH" ] || [ -z "$TLSCERTFILE" ] || [ -z "$TLSKEYFILE" ] && [ "$PROTOCOL" = "https" ]; then echo "TLSKEYPATH FOR SSL CONNECTION NOT SET - ERROR"; exit 1; else echo "PASS"; fi
83+
RUN echo "the ssl certificates path is set to $TLSKEYPATH"
84+
85+
# Switch to the working directory
86+
WORKDIR /opt/IBM/bridge
87+
RUN echo "$(pwd)"
9388

89+
# Create a container user
90+
RUN if [ "$GID" -gt "0" ]; then groupadd -g $GID $GROUP; else echo "Since root GID specified skipping groupadd"; fi && \
91+
useradd -rm -d /home/$UID -s /bin/bash -g $GID -u $UID $USER
92+
93+
# Change group ownership
94+
RUN chgrp -R $GID /opt/IBM/bridge && \
95+
chgrp -R $GID /opt/IBM/zimon && \
96+
chgrp -R $GID /var/mmfs/gen && \
97+
chgrp -R $GID /etc/ssl/certs && \
98+
chgrp -R $GID /var/mmfs/gen && \
99+
chgrp -R $GID /etc/perfmon-api-keys && \
100+
chgrp -R $GID $TLSKEYPATH && \
101+
chgrp -R $GID $LOGPATH
102+
103+
# Set group permissions
104+
RUN chmod -R g=u /opt/IBM/bridge && \
105+
chmod -R g=u /opt/IBM/zimon && \
106+
chmod -R g=u /var/mmfs/gen && \
107+
chmod -R g=u /etc/ssl/certs && \
108+
chmod -R g=u /var/mmfs/gen && \
109+
chmod -R g=u /etc/perfmon-api-keys && \
110+
chmod -R g=u $TLSKEYPATH && \
111+
chmod -R g=u $LOGPATH
112+
113+
# Chown all needed files
114+
RUN chown -R $UID:$GID /opt/IBM/bridge && \
115+
chown -R $UID:$GID /opt/IBM/zimon && \
116+
chown -R $UID:$GID /var/mmfs/gen && \
117+
chown -R $UID:$GID /etc/ssl/certs && \
118+
chown -R $UID:$GID /etc/perfmon-api-keys && \
119+
chown -R $UID:$GID $TLSKEYPATH && \
120+
chown -R $UID:$GID $LOGPATH
121+
122+
# Switch user
123+
USER $GID
94124

95125
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"]
96126

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
[![CircleCI](https://circleci.com/gh/IBM/ibm-spectrum-scale-bridge-for-grafana.svg?style=svg)](https://app.circleci.com/pipelines/github/IBM/ibm-spectrum-scale-bridge-for-grafana?branch=master)
3-
3+
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5787/badge)](https://bestpractices.coreinfrastructure.org/projects/5787)
44

55
The ***IBM Spectrum Scale bridge for Grafana*** could be used for exploring IBM Spectrum Scale performance data on [Grafana dashboards](https://grafana.com/grafana/).
66

docs/RELEASE_NOTES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# Version 7.0.8 (12/06/2022)
2+
Changed the Dockerfile parent image to the registry.access.redhat.com/ubi8/ubi:8.7 \
3+
Made Dockerfile compatibe with OpenShift style allowing to specify user/group settings at the image build time. \
4+
Added Workaround for Disk Capacity sensors allowing to query and fetch data from the archived (on disk data). \
5+
6+
Tested with Grafana version 7.5.17 and 9.0.0
7+
Tested with RedHat community-powered Grafana operator v.4.8
8+
9+
10+
111
# Version 7.0.7 (09/21/2022)
212
Fixed issue in parsing zimon sensors config, having new filter format for Network sensor
313

docs/SUPPORT_MATRIX.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
The following matrix gives a quick overview of the supported software for the IBM Spectrum Scale bridge for Grafana packages by version number:
2+
# Version 7.0.8 (12/06/2022)
3+
Classic Scale:
4+
- Python 3.8
5+
- CherryPy 18.6.1
6+
- IBM Spectrum Scale system must run 5.1.5.1 and above
7+
- Grafana 9.0.0 and above
8+
9+
Cloud native:
10+
- IBM Spectrum Scale Container Native Storage Access(CNSA) devices having minReleaseLevel 5.1.5
11+
- RedHat community-powered Grafana-Operator v4.8
212

313
# Version 7.0.7 (09/21/2022)
414
Classic Scale:

docs/bridge_overview.PNG

75.1 KB
Loading
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# Example deployment of a GrafanaDataSource instance in a k8s/OCP environment
22

33

4-
Using the scripts in this folder you can deploy a GrafanaDataSource instance for the IBM Spectrum Scale Performance Monitoring Bridge for Grafana running in container
4+
Using the scripts in this folder you can deploy a GrafanaDataSource instance for the IBM Spectrum Scale Performance Monitoring Bridge for Grafana running in in the project 'grafana-for-cnsa'
55

6+
```
7+
NAMESPACE=grafana-for-cnsa
8+
```
9+
```
10+
echo $NAMESPACE
11+
```
612
```
713
oc adm policy add-cluster-role-to-user ibm-spectrum-scale-operator -z grafana-serviceaccount
8-
oc apply -f grafana-bridge-datasource.yaml
9-
oc describe GrafanaDataSource bridge-grafanadatasource
10-
14+
```
15+
```
16+
oc apply -f grafana-bridge-datasource.yaml --namespace=$NAMESPACE
17+
```
18+
```
19+
oc describe GrafanaDataSource bridge-grafanadatasource --namespace=$NAMESPACE
1120
```
1221

1322
For complete deployment examples please check the project [Wiki](https://github.com/IBM/ibm-spectrum-scale-bridge-for-grafana/wiki)

examples/openshift_deployment_scripts/grafana_datasource_deployment/grafana-bridge-datasource.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
kind: GrafanaDataSource
33
metadata:
44
name: bridge-grafanadatasource
5-
namespace: grafana-for-cnsa
65
spec:
76
datasources:
87
- access: proxy

examples/openshift_deployment_scripts/grafana_deployment/README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44
Using the scripts in this folder you can deploy a Grafana instance in the project 'grafana-for-cnsa'
55

66
```
7-
oc new-project grafana-for-cnsa
8-
oc apply -f operator-group.yaml
9-
oc apply -f grafana-operator-subscription.yaml
10-
oc apply -f grafana-instance-for-cnsa.yaml
11-
7+
NAMESPACE=grafana-for-cnsa
8+
```
9+
```
10+
echo $NAMESPACE
11+
```
12+
```
13+
oc new-project $NAMESPACE
14+
```
15+
```
16+
oc apply -f operator-group.yaml --namespace=$NAMESPACE
17+
```
18+
```
19+
oc apply -f grafana-operator-subscription.yaml --namespace=$NAMESPACE
20+
```
21+
```
22+
oc apply -f grafana-instance-for-cnsa.yaml --namespace=$NAMESPACE
1223
```
1324

1425
Alternatively you can install a Grafana instance using the OpenShift Container Platform web console. Please check the instructions described in the deployment examples stored in the project [Wiki](/docs/grafana_deployment_ocp.md)

examples/openshift_deployment_scripts/grafana_deployment/grafana-instance-for-cnsa.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apiVersion: integreatly.org/v1alpha1
22
kind: Grafana
33
metadata:
4-
namespace: grafana-for-cnsa
54
name: grafana-for-cnsa
65
spec:
76
config:

0 commit comments

Comments
 (0)