Skip to content

Commit

Permalink
Update to Grafana 11.1.0 image (#99)
Browse files Browse the repository at this point in the history
* Update to Grafana 11.1.0 image

* Update Dockerfile

* Updates

* Updates
  • Loading branch information
mikhail-vl authored Jul 7, 2024
1 parent 2c151d5 commit c43b144
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 123 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Change Log

## 3.4.0 (IN PROGRESS)
## 4.0.0 (2024-07-07)

### Features / Enhancements

- Add plugin e2e tests and remove cypress (#95)
- Update to Grafana 11.1 dependencies (#97)
- Update to Business Suite (#98)
- Update to Grafana 11.1.0 image (#99)

## 3.3.0 (2023-02-01)

Expand Down
158 changes: 50 additions & 108 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM grafana/grafana-oss:10.3.1
FROM grafana/grafana-oss:11.1.0

##################################################################
## CONFIGURATION
## Configuration
##################################################################

## Set Grafana options
Expand All @@ -15,9 +15,6 @@ ENV GF_AUTH_BASIC_ENABLED=false
## Disable Sanitize
ENV GF_PANELS_DISABLE_SANITIZE_HTML=true

## Disable Explore
ENV GF_EXPLORE_ENABLED=false

# Updates Check
ENV GF_ANALYTICS_CHECK_FOR_UPDATES=false

Expand All @@ -29,7 +26,7 @@ ENV GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
ENV GF_PATHS_PLUGINS="/var/lib/grafana/plugins"

##################################################################
## COPY ARTIFACTS
## Copy Artifacts
## Required for the App plugin
##################################################################

Expand All @@ -47,7 +44,7 @@ COPY --chown=grafana:root provisioning $GF_PATHS_PROVISIONING
USER root

##################################################################
## VISUAL
## Update Image files
##################################################################

## Replace Favicon and Apple Touch
Expand All @@ -62,14 +59,12 @@ COPY img/background.svg /usr/share/grafana/public/img/g8_login_dark.svg
COPY img/background.svg /usr/share/grafana/public/img/g8_login_light.svg

##################################################################
## HANDS-ON
## Update HTML, INI files
##################################################################

# Update Title
RUN sed -i 's|<title>\[\[.AppTitle\]\]</title>|<title>Business Suite</title>|g' /usr/share/grafana/public/views/index.html

# Move Business Suite App to navigation root section
RUN sed -i 's|\[navigation.app_sections\]|\[navigation.app_sections\]\nvolkovlabs-app=root|g' /usr/share/grafana/conf/defaults.ini
RUN sed -i 's|Loading Grafana|Loading Business Suite|g' /usr/share/grafana/public/views/index.html

## Update Help menu
RUN sed -i "s|\[\[.NavTree\]\],|nav,|g; \
Expand All @@ -82,123 +77,70 @@ RUN sed -i "s|\[\[.NavTree\]\],|nav,|g; \
const connections = nav.find((element) => element.id === 'connections'); \
if (connections) { connections['url'] = '/datasources'; connections['children'].shift(); } \
const help = nav.find((element) => element.id === 'help'); \
if (help) { help['subTitle'] = 'Grafana OSS'; help['children'] = [];} \
if (help) { help['subTitle'] = 'Business Suite 4.0.0'; help['children'] = [];} \
window.grafanaBootData = {|g" \
/usr/share/grafana/public/views/index.html

## Update Title
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|AppTitle="Grafana"|AppTitle="Business Suite"|g' {} \;
# Move Business Suite App to navigation root section
RUN sed -i 's|\[navigation.app_sections\]|\[navigation.app_sections\]\nvolkovlabs-app=root|g' /usr/share/grafana/conf/defaults.ini

## Update Login Title
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|LoginTitle="Welcome to Grafana"|LoginTitle="Welcome to Business Suite"|g' {} \;
##################################################################
## Update JavaScript files
##################################################################

RUN find /usr/share/grafana/public/build/ -name *.js \
## Update Title
-exec sed -i 's|AppTitle="Grafana"|AppTitle="Business Suite"|g' {} \; \
## Update Login Title
-exec sed -i 's|LoginTitle="Welcome to Grafana"|LoginTitle="Business Suite for Grafana"|g' {} \; \
## Remove Documentation, Support, Community in the Footer
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|\[{target:"_blank",id:"documentation".*grafana_footer"}\]|\[\]|g' {} \;

-exec sed -i 's|\[{target:"_blank",id:"documentation".*grafana_footer"}\]|\[\]|g' {} \; \
## Remove Edition in the Footer
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|({target:"_blank",id:"license",.*licenseUrl})|()|g' {} \;

-exec sed -i 's|({target:"_blank",id:"license",.*licenseUrl})|()|g' {} \; \
## Remove Version in the Footer
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|({target:"_blank",id:"version",.*CHANGELOG.md":void 0})|()|g' {} \;

-exec sed -i 's|({target:"_blank",id:"version",.*CHANGELOG.md":void 0})|()|g' {} \; \
## Remove News icon
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|..createElement(....,{className:.,onClick:.,iconOnly:!0,icon:"rss","aria-label":"News"})|null|g' {} \;

-exec sed -i 's|..createElement(....,{className:.,onClick:.,iconOnly:!0,icon:"rss","aria-label":"News"})|null|g' {} \; \
## Remove Open Source icon
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|.push({target:"_blank",id:"version",text:`${..edition}${.}`,url:..licenseUrl,icon:"external-link-alt"})||g' {} \;
-exec sed -i 's|.push({target:"_blank",id:"version",text:`${..edition}${.}`,url:..licenseUrl,icon:"external-link-alt"})||g' {} \;

##################################################################
## CLEANING Remove Native Data Sources
## Remove Native Data Sources
##################################################################

## Time series databases / Elasticsearch
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/elasticsearch
RUN rm -rf /usr/share/grafana/public/build/elasticsearch*

## Time series databases / Graphite
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/graphite
RUN rm -rf /usr/share/grafana/public/build/graphite*

## Time series databases / OpenTSDB
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/opentsdb
RUN rm -rf /usr/share/grafana/public/build/opentsdb*

## Time series databases / InfluxDB
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/influxdb
RUN rm -rf /usr/share/grafana/public/build/influxdb*

## SQL / Microsoft SQL Server
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/mssql
RUN rm -rf /usr/share/grafana/public/build/mssql*

## SQL / MySQL
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/mysql
RUN rm -rf /usr/share/grafana/public/build/mysql*

## Distributed tracing / Tempo
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/tempo
RUN rm -rf /usr/share/grafana/public/build/tempo*

## Distributed tracing / Jaeger
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/jaeger
RUN rm -rf /usr/share/grafana/public/build/jaeger*

## Distributed tracing / Zipkin
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/zipkin
RUN rm -rf /usr/share/grafana/public/build/zipkin*

## Cloud / Azure Monitor
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/azuremonitor
RUN rm -rf /usr/share/grafana/public/build/azureMonitor*

## Cloud / CloudWatch
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/cloudwatch
RUN rm -rf /usr/share/grafana/public/build/cloudwatch*

## Cloud / Google Cloud Monitoring
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/cloud-monitoring
RUN rm -rf /usr/share/grafana/public/build/cloudMonitoring*

## Profiling / Parca
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/parca
RUN rm -rf /usr/share/grafana/public/build/parca*

## Profiling / Phlare
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/phlare
RUN rm -rf /usr/share/grafana/public/build/phlare*

## Profiling / Pyroscope
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/grafana-pyroscope-datasource
RUN rm -rf /usr/share/grafana/public/build/pyroscope*
RUN rm -rf /usr/share/grafana/public/app/plugins/datasource/elasticsearch /usr/share/grafana/public/build/elasticsearch* \
/usr/share/grafana/public/app/plugins/datasource/graphite /usr/share/grafana/public/build/graphite* \
/usr/share/grafana/public/app/plugins/datasource/opentsdb /usr/share/grafana/public/build/opentsdb* \
/usr/share/grafana/public/app/plugins/datasource/influxdb /usr/share/grafana/public/build/influxdb* \
/usr/share/grafana/public/app/plugins/datasource/mssql /usr/share/grafana/public/build/mssql* \
/usr/share/grafana/public/app/plugins/datasource/mysql /usr/share/grafana/public/build/mysql* \
/usr/share/grafana/public/app/plugins/datasource/tempo /usr/share/grafana/public/build/tempo* \
/usr/share/grafana/public/app/plugins/datasource/jaeger /usr/share/grafana/public/build/jaeger* \
/usr/share/grafana/public/app/plugins/datasource/zipkin /usr/share/grafana/public/build/zipkin* \
/usr/share/grafana/public/app/plugins/datasource/azuremonitor /usr/share/grafana/public/build/azureMonitor* \
/usr/share/grafana/public/app/plugins/datasource/cloudwatch /usr/share/grafana/public/build/cloudwatch* \
/usr/share/grafana/public/app/plugins/datasource/cloud-monitoring /usr/share/grafana/public/build/cloudMonitoring* \
/usr/share/grafana/public/app/plugins/datasource/parca /usr/share/grafana/public/build/parca* \
/usr/share/grafana/public/app/plugins/datasource/phlare /usr/share/grafana/public/build/phlare* \
/usr/share/grafana/public/app/plugins/datasource/grafana-pyroscope-datasource /usr/share/grafana/public/build/pyroscope*

## Remove Cloud and Enterprise categories
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|.id==="enterprise"|.id==="notanenterprise"|g' {} \;
RUN find /usr/share/grafana/public/build/ -name *.js -exec sed -i 's|.id==="cloud"|.id==="notacloud"|g' {} \;
RUN find /usr/share/grafana/public/build/ -name *.js \
-exec sed -i 's|.id==="enterprise"|.id==="notanenterprise"|g' {} \; \
-exec sed -i 's|.id==="cloud"|.id==="notacloud"|g' {} \;

##################################################################
## CLEANING Remove Native Panels
## Remove Native Panels
##################################################################

## Alert list
RUN rm -rf /usr/share/grafana/public/app/plugins/panel/alertlist

## Annotations list
RUN rm -rf /usr/share/grafana/public/app/plugins/panel/annolist

## Dashboard list
RUN rm -rf /usr/share/grafana/public/app/plugins/panel/dashlist

## News
RUN rm -rf /usr/share/grafana/public/app/plugins/panel/news

## Table (old)
RUN rm -rf /usr/share/grafana/public/app/plugins/panel/table-old

## Traces
RUN rm -rf /usr/share/grafana/public/app/plugins/panel/traces

## Flamegraph
RUN rm -rf /usr/share/grafana/public/app/plugins/panel/flamegraph
RUN rm -rf /usr/share/grafana/public/app/plugins/panel/alertlist \
/usr/share/grafana/public/app/plugins/panel/annolist \
/usr/share/grafana/public/app/plugins/panel/dashlist \
/usr/share/grafana/public/app/plugins/panel/news \
/usr/share/grafana/public/app/plugins/panel/geomap \
/usr/share/grafana/public/app/plugins/panel/table-old \
/usr/share/grafana/public/app/plugins/panel/traces \
/usr/share/grafana/public/app/plugins/panel/flamegraph

##################################################################

Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Volkov Labs App for Grafana
# Business Suite App for Grafana

![App](https://raw.githubusercontent.com/volkovlabs/volkovlabs-app/main/img/app.png)

![Grafana 10](https://img.shields.io/badge/Grafana-10.3-orange)
![Grafana](https://img.shields.io/badge/Grafana-11.1-orange)
[![YouTube](https://img.shields.io/badge/YouTube-Channel-red)](https://youtube.com/@volkovlabs)
![CI](https://github.com/volkovlabs/volkovlabs-app/workflows/CI/badge.svg)
![E2E](https://github.com/volkovlabs/volkovlabs-app/workflows/E2E/badge.svg)
Expand All @@ -11,7 +11,7 @@

## Introduction

The Volkov Labs App includes a Docker image with customized Grafana and an App plugin with information about Business Suite for Grafana.
The Business Suite App includes a Docker image with customized Grafana and an application plugin.

## Customization

Expand All @@ -27,13 +27,6 @@ We use the custom Docker image for all our projects and keep it up-to-date with
docker pull ghcr.io/volkovlabs/app:latest
```

## Bundle

App plugin includes:

- [Business News data source](https://volkovlabs.io/plugins/volkovlabs-rss-datasource)
- [Business Text panel](https://volkovlabs.io/plugins/volkovlabs-dynamictext-panel)

## Feedback

Subscribe to our [YouTube Channel](https://www.youtube.com/@volkovlabs) and leave a comment.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@
"test:ci": "jest --maxWorkers 4 --coverage",
"upgrade": "npm upgrade --save"
},
"version": "3.4.0"
"version": "4.0.0"
}
2 changes: 1 addition & 1 deletion provisioning/dashboards/business.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
},
"timepicker": {},
"timezone": "",
"title": "Volkov Labs News",
"title": "Business Suite",
"uid": "O4tc_E6Gz",
"version": 1,
"weekStart": ""
Expand Down
2 changes: 1 addition & 1 deletion src/components/Config/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const Config: React.FC<Props> = () => {
return (
<FieldSet data-testid={TEST_IDS.config.root}>
<h2>{APP_INFO.name}</h2>
<p>The Volkov Labs App includes Docker image and App plugin with information about Business Suite for Grafana.</p>
<p>The Business Suite App includes Docker image and an application plugin.</p>
</FieldSet>
);
};
2 changes: 1 addition & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/grafana/grafana/master/docs/sources/developers/plugins/plugin.schema.json",
"autoEnabled": true,
"dependencies": {
"grafanaDependency": ">=10.0.0",
"grafanaDependency": ">=11.0.0",
"plugins": []
},
"id": "volkovlabs-app",
Expand Down

0 comments on commit c43b144

Please sign in to comment.