Merge ~sergiodj/ubuntu-docker-images/+git/grafana:8.1-21.10 into ~ubuntu-docker-images/ubuntu-docker-images/+git/grafana:7.4-21.04

Proposed by Sergio Durigan Junior
Status: Merged
Merge reported by: Sergio Durigan Junior
Merged at revision: 1a1e4ffaf026f16c9e1a57b62fd92e9b2cb96d45
Proposed branch: ~sergiodj/ubuntu-docker-images/+git/grafana:8.1-21.10
Merge into: ~ubuntu-docker-images/ubuntu-docker-images/+git/grafana:7.4-21.04
Diff against target: 170 lines (+43/-42)
4 files modified
Dockerfile (+36/-35)
HACKING.md (+2/-2)
README.md (+3/-3)
data/grafana.yaml (+2/-2)
Reviewer Review Type Date Requested Status
Athos Ribeiro Approve
Bryce Harrington Pending
Canonical Server Pending
Review via email: mp+407706@code.launchpad.net

Description of the change

This MP updates the Dockerfile to 21.10. I took this opportunity to also bring the Dockerfile up to our current standards.

This has been built locally and tested using our unittest. The MP is targeting the 21.04 branch to facilitate the review process, but a new 21.10 branch will be created from it.

To post a comment you must log in.
1a1e4ff... by Sergio Durigan Junior

Update documentation

Reflect the bump to 21.10 and the new grafana version.

Signed-off-by: Sergio Durigan Junior <email address hidden>

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Hi Sergio,

The changes LGTM.

I did build and run the image, and can confirm Grafana starts and is available in port 3000.

I did see one odd thing during startup though: the logs show the following error:

EROR[08-26|12:33:37] Failed to read plugin provisioning files from directory logger=provisioning.plugins path=/etc/grafana/provisioning/plugins error="open /etc/grafana/provisioning/plugins: no such file or directory"

While I understand this could (should?) be set as a volume by users in case they want to load their custom configurations, should we create that directory for a clean startup otherwise?

Also, see https://github.com/grafana/grafana/pull/29570

review: Needs Information
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Thursday, August 26 2021, Athos Ribeiro wrote:

> Hi Sergio,
>
> The changes LGTM.

Thanks for the review, Athos.

> I did build and run the image, and can confirm Grafana starts and is available in port 3000.
>
> I did see one odd thing during startup though: the logs show the following error:
>
> EROR[08-26|12:33:37] Failed to read plugin provisioning files from
> directory logger=provisioning.plugins
> path=/etc/grafana/provisioning/plugins error="open
> /etc/grafana/provisioning/plugins: no such file or directory"
>
> While I understand this could (should?) be set as a volume by users in case they want to load their custom configurations, should we create that directory for a clean startup otherwise?
>
> Also, see https://github.com/grafana/grafana/pull/29570

Very good catch! Thanks a lot for looking into this, and indeed, I
totally agree with your comment. I've now adjusted the Dockerfile to
make it create the directory automatically, and force-pushed the branch.

Let me know if that solves the problem for you.

Thanks,

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Sergio!

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks, Athos. Branch created.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Dockerfile b/Dockerfile
2index 737ab2e..88d9fc7 100644
3--- a/Dockerfile
4+++ b/Dockerfile
5@@ -4,21 +4,21 @@
6 # and adapted to use the grafana snap built from
7 # https://github.com/auria/snap-grafana and installed from
8 # https://snapcraft.io/grafana
9-FROM ubuntu:hirsute AS snap-installer
10+FROM ubuntu:impish AS snap-installer
11
12-RUN apt-get update && \
13- DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y && \
14- DEBIAN_FRONTEND=noninteractive apt-get install -y \
15- jq curl ca-certificates squashfs-tools
16+RUN set -eux; \
17+ apt-get update; \
18+ DEBIAN_FRONTEND=noninteractive apt-get full-upgrade -y; \
19+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
20+ jq curl ca-certificates squashfs-tools
21
22 # taken from https://snapcraft.io/docs/build-on-docker
23 # Alternatively, we can install snapd, and issue `snap download grafana`
24-RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: $(dpkg --print-architecture)" 'https://api.snapcraft.io/api/v1/snaps/details/grafana?channel=21.04/edge' | jq '.download_url' -r) --output grafana.snap
25+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: $(dpkg --print-architecture)" 'https://api.snapcraft.io/api/v1/snaps/details/grafana?channel=21.10/edge' | jq '.download_url' -r) --output grafana.snap
26
27 RUN mkdir -p /snap && unsquashfs -d /snap/grafana grafana.snap
28
29-
30-FROM ubuntu:hirsute
31+FROM ubuntu:impish
32
33 EXPOSE 3000
34 LABEL maintainer="Ubuntu Server team <ubuntu-server@lists.ubuntu.com>"
35@@ -27,12 +27,12 @@ ARG GF_UID="472"
36 ARG GF_GID="472"
37
38 ENV PATH="/usr/share/grafana/bin:$PATH" \
39- GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \
40- GF_PATHS_DATA="/var/lib/grafana" \
41- GF_PATHS_HOME="/usr/share/grafana" \
42- GF_PATHS_LOGS="/var/log/grafana" \
43- GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \
44- GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
45+ GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \
46+ GF_PATHS_DATA="/var/lib/grafana" \
47+ GF_PATHS_HOME="/usr/share/grafana" \
48+ GF_PATHS_LOGS="/var/log/grafana" \
49+ GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \
50+ GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
51
52 WORKDIR $GF_PATHS_HOME
53
54@@ -41,27 +41,28 @@ COPY --from=snap-installer /snap/grafana/conf conf
55 ENV TZ UTC
56
57 # curl should be part of the image
58-RUN apt-get update && \
59- DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y && \
60- DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates curl tzdata && \
61- rm -rf /var/lib/apt/lists/*
62-
63-RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
64- addgroup --system --gid $GF_GID grafana && \
65- adduser --uid $GF_UID --system --ingroup grafana grafana && \
66- mkdir -p "$GF_PATHS_PROVISIONING/datasources" \
67- "$GF_PATHS_PROVISIONING/dashboards" \
68- "$GF_PATHS_PROVISIONING/notifiers" \
69- "$GF_PATHS_LOGS" \
70- "$GF_PATHS_PLUGINS" \
71- "$GF_PATHS_DATA" && \
72- cp conf/defaults.ini "$GF_PATHS_CONFIG" && \
73- chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
74- chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
75- mkdir -p /usr/share/rocks
76-
77-# XXX - removed from above RUN, not in the snap yet
78-RUN if [ -f conf/ldap.toml ]; then cp conf/ldap.toml /etc/grafana/ldap.toml; fi
79+RUN set -eux; \
80+ apt-get update; \
81+ DEBIAN_FRONTEND=noninteractive apt-get full-upgrade -y; \
82+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
83+ ca-certificates curl tzdata; \
84+ DEBIAN_FRONTEND=noninteractive apt-get remove --purge --auto-remove -y; \
85+ rm -rf /var/lib/apt/lists/*; \
86+ mkdir -p "$GF_PATHS_HOME/.aws"; \
87+ addgroup --system --gid $GF_GID grafana; \
88+ adduser --uid $GF_UID --system --ingroup grafana grafana; \
89+ mkdir -p "$GF_PATHS_PROVISIONING/datasources" \
90+ "$GF_PATHS_PROVISIONING/dashboards" \
91+ "$GF_PATHS_PROVISIONING/notifiers" \
92+ "$GF_PATHS_PROVISIONING/plugins" \
93+ "$GF_PATHS_LOGS" \
94+ "$GF_PATHS_PLUGINS" \
95+ "$GF_PATHS_DATA"; \
96+ cp conf/defaults.ini "$GF_PATHS_CONFIG"; \
97+ cp conf/ldap.toml /etc/grafana/ldap.toml; \
98+ chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"; \
99+ chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"; \
100+ mkdir -p /usr/share/rocks
101
102 COPY --from=snap-installer /snap/grafana/bin/grafana-server /snap/grafana/bin/grafana-cli bin/
103 COPY --from=snap-installer /snap/grafana/public public
104diff --git a/HACKING.md b/HACKING.md
105index 9448300..1622367 100644
106--- a/HACKING.md
107+++ b/HACKING.md
108@@ -7,7 +7,7 @@ In order to contribute to the Grafana OCI image do the following:
109 * Build a new image with your changes. You can use the following command:
110
111 ```
112-$ docker build -t ubuntu/grafana:test
113+$ docker build -t ubuntu/grafana:test .
114 ```
115
116 * Test the new image. Run it in some way that exercise your changes, you can also check th README.md file.
117@@ -41,6 +41,6 @@ The repository containing the templates is located at:
118 https://code.launchpad.net/~canonical-server/ubuntu-docker-images/+git/templates
119
120 The specific data for this image's template can be found inside the
121-`data/` directory.
122+`data/` directory, in the image's own repository.
123
124
125diff --git a/README.md b/README.md
126index 2f3e897..65c6d91 100644
127--- a/README.md
128+++ b/README.md
129@@ -19,7 +19,7 @@ _Tags in italics are not available in ubuntu/grafana but are shown here for comp
130
131 | Channel Tag | | | Currently | Architectures |
132 |---|---|---|---|---|
133-| **`7.4-21.04_beta`** &nbsp;&nbsp; | | | Grafana 7.4.1 on Ubuntu 21.04 | `amd64`, `arm64`, `ppc64el`, `s390x` |
134+| **`8.1-21.10_beta`** &nbsp;&nbsp; | | | Grafana 8.1.1 on Ubuntu 21.10 | `amd64`, `arm64`, `ppc64el`, `s390x` |
135 | _`track_risk`_ |
136
137 Channel tag shows the most stable channel for that track ordered `stable`, `candidate`, `beta`, `edge`. More risky channels are always implicitly available. So if `beta` is listed, you can also pull `edge`. If `candidate` is listed, you can pull `beta` and `edge`. When `stable` is listed, all four are available. Images are guaranteed to progress through the sequence `edge`, `beta`, `candidate` before `stable`.
138@@ -30,7 +30,7 @@ Channel tag shows the most stable channel for that track ordered `stable`, `cand
139 Launch this image locally:
140
141 ```sh
142-docker run -d --name grafana-container -e TZ=UTC -p 30000:3000 ubuntu/grafana:7.4-21.04_beta
143+docker run -d --name grafana-container -e TZ=UTC -p 30000:3000 ubuntu/grafana:8.1-21.10_beta
144 ```
145 Access your Grafana server at `localhost:30000`.
146
147@@ -65,7 +65,7 @@ Works with any Kubernetes; if you don't have one, we recommend you [install Micr
148
149 Download
150 [datasource.yml](https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/grafana/plain/examples/config/datasource.yml), [dashboard.yml](https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/grafana/plain/examples/config/dashboard.yml), [system-stats-dashboard.json](https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/grafana/plain/examples/config/system-stats-dashboard.json) and
151-[grafana-deployment.yml](https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/grafana/plain/examples/grafana-deployment.yml) and set `containers.grafana.image` in `grafana-deployment.yml` to your chosen channel tag (e.g. `ubuntu/grafana:7.4-21.04_beta`), then:
152+[grafana-deployment.yml](https://git.launchpad.net/~canonical-server/ubuntu-docker-images/+git/grafana/plain/examples/grafana-deployment.yml) and set `containers.grafana.image` in `grafana-deployment.yml` to your chosen channel tag (e.g. `ubuntu/grafana:8.1-21.10_beta`), then:
153
154 ```sh
155 kubectl create configmap grafana-config --from-file=grafana-datasource=datasource.yml --from-file=grafana-dashboard-definition=dashboard.yml --from-file=grafana-dashboard=system-stats-dashboard.json
156diff --git a/data/grafana.yaml b/data/grafana.yaml
157index efcd5f5..efcae61 100644
158--- a/data/grafana.yaml
159+++ b/data/grafana.yaml
160@@ -4,8 +4,8 @@ repo: grafana
161 description: >
162 Grafana is a feature rich metrics dashboard and graph editor for Cloudwatch, Elasticsearch, Graphite, InfluxDB, OpenTSB, Prometheus, and Hosted Metrics.
163 Read more on the [Grafana website](https://grafana.com/docs/).
164-version: 7.4.1
165-base: Ubuntu 21.04
166+version: 8.1.1
167+base: Ubuntu 21.10
168 architectures:
169 - amd64
170 - arm64

Subscribers

People subscribed via source and target branches