Skip to content

Commit 6e313e7

Browse files
marefrkylebrandtaknuds1oddlittlebird
authored
Image Rendering: Remove PhantomJS support (grafana#23460)
Removes all references and usage of PhantomJS grafana#23375. Remove direct link rendered image e2e smoke test for now. Docker: Fix installing chrome in ubuntu custom docker image. Improve handling of image renderer not available/installed grafana#23593. Add PhantomJS breaking change and upgrading notes. Use grabpl v0.2.10. Closes grafana#13802 Co-authored-by: Kyle Brandt <kyle@grafana.com> Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
1 parent 0a1ab60 commit 6e313e7

File tree

38 files changed

+108
-479
lines changed

38 files changed

+108
-479
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ commands:
5050
- run:
5151
name: "Install Grafana build pipeline tool"
5252
command: |
53-
VERSION=0.2.9
53+
VERSION=0.2.10
5454
curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v${VERSION}/grabpl
5555
chmod +x grabpl
5656
mv grabpl /tmp

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 7.0.0 (unreleased)
2+
3+
## Breaking changes
4+
5+
- **Removed PhantomJS**: PhantomJS was deprecated in [Grafana v6.4](https://grafana.com/docs/grafana/latest/guides/whats-new-in-v6-4/#phantomjs-deprecation) and starting from Grafana v7.0.0, all PhantomJS support has been removed. This means that Grafana no longer ships with a built-in image renderer, and we advise you to install the [Grafana Image Renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer).
6+
17
# 6.7.2 (2020-04-02)
28

39
### Bug Fixes
@@ -6,7 +12,7 @@
612
- **Dashboard**: Fixed issue with saving new dashboard after changing title . [#23104](https://github.com/grafana/grafana/pull/23104), [@dprokop](https://github.com/dprokop)
713
- **DataLinks**: make sure we use the correct datapoint when dataset contains null value.. [#22981](https://github.com/grafana/grafana/pull/22981), [@mckn](https://github.com/mckn)
814
- **Plugins**: Fixed issue for plugins that imported dateMath util . [#23069](https://github.com/grafana/grafana/pull/23069), [@mckn](https://github.com/mckn)
9-
- **Security**: Fix for dashboard snapshot original dashboard link could contain XSS vulnerability in url. [#23254](https://github.com/grafana/grafana/pull/23254), [@torkelo](https://github.com/torkelo). Big thanks to Ahmed A. Sherif for reporting this issue.
15+
- **Security**: Fix for dashboard snapshot original dashboard link could contain XSS vulnerability in url. [#23254](https://github.com/grafana/grafana/pull/23254), [@torkelo](https://github.com/torkelo). Big thanks to Ahmed A. Sherif for reporting this issue.
1016
- **Variables**: Fixes issue with too many queries being issued for nested template variables after value change. [#23220](https://github.com/grafana/grafana/pull/23220), [@torkelo](https://github.com/torkelo)
1117
- **Plugins**: Expose promiseToDigest. [#23249](https://github.com/grafana/grafana/pull/23249), [@torkelo](https://github.com/torkelo)
1218
- **Reporting (Enterprise)**: Fixes issue updating a report created by someone else

Dockerfile

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ RUN go run build.go build
1818
# Node build container
1919
FROM node:12.13.0-alpine
2020

21-
# PhantomJS
22-
RUN apk add --no-cache curl &&\
23-
cd /tmp && curl -Ls https://github.com/dustinblackman/phantomized/releases/download/2.1.1/dockerized-phantomjs.tar.gz | tar xz &&\
24-
cp -R lib lib64 / &&\
25-
cp -R usr/lib/x86_64-linux-gnu /usr/lib &&\
26-
cp -R usr/share /usr/share &&\
27-
cp -R etc/fonts /etc &&\
28-
curl -k -Ls https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar -jxf - &&\
29-
cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
30-
3121
WORKDIR /usr/src/app/
3222

3323
COPY package.json yarn.lock ./
@@ -80,18 +70,9 @@ RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
8070
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
8171
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"
8272

83-
# PhantomJS
84-
COPY --from=1 /tmp/lib /lib
85-
COPY --from=1 /tmp/lib64 /lib64
86-
COPY --from=1 /tmp/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
87-
COPY --from=1 /tmp/usr/share /usr/share
88-
COPY --from=1 /tmp/etc/fonts /etc/fonts
89-
COPY --from=1 /usr/local/bin/phantomjs /usr/local/bin
90-
9173
COPY --from=0 /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-server /go/src/github.com/grafana/grafana/bin/linux-amd64/grafana-cli ./bin/
9274
COPY --from=1 /usr/src/app/public ./public
9375
COPY --from=1 /usr/src/app/tools ./tools
94-
COPY tools/phantomjs/render.js ./tools/phantomjs/render.js
9576

9677
EXPOSE 3000
9778

Dockerfile.ubuntu

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ RUN go run build.go build
1414

1515
FROM node:12.13 AS js-builder
1616

17-
# PhantomJS
18-
RUN apt-get update && apt-get install -y curl &&\
19-
curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar xj &&\
20-
cp phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
21-
2217
WORKDIR /usr/src/app/
2318

2419
COPY package.json yarn.lock ./
@@ -54,8 +49,8 @@ WORKDIR $GF_PATHS_HOME
5449

5550
COPY conf conf
5651

57-
# We need font libs for phantomjs, and curl should be part of the image
58-
RUN apt-get update && apt-get upgrade -y && apt-get install -y ca-certificates libfontconfig1 curl
52+
# curl should be part of the image
53+
RUN apt-get update && apt-get upgrade -y && apt-get install -y ca-certificates curl
5954

6055
RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
6156
addgroup --system --gid $GF_GID grafana && \
@@ -71,14 +66,11 @@ RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
7166
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
7267
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"
7368

74-
# PhantomJS
75-
COPY --from=js-builder /usr/local/bin/phantomjs /usr/local/bin/
7669

7770
COPY --from=go-builder /src/grafana/bin/linux-amd64/grafana-server /src/grafana/bin/linux-amd64/grafana-cli bin/
7871
COPY --from=js-builder /usr/src/app/public public
7972
COPY --from=js-builder /usr/src/app/tools tools
8073

81-
COPY tools/phantomjs/render.js tools/phantomjs/
8274
COPY packaging/docker/run.sh /
8375

8476
USER grafana

Gruntfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ module.exports = function (grunt) {
3535
config.libc = grunt.option('libc');
3636
}
3737

38-
config.phjs = grunt.option('phjsToRelease');
3938
config.pkg.version = grunt.option('pkgVer') || config.pkg.version;
4039

4140
console.log('Version', config.pkg.version);

build.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ var (
4040
linuxPackageVersion string = "v1"
4141
linuxPackageIteration string = ""
4242
race bool
43-
phjsToRelease string
4443
workingDir string
4544
includeBuildId bool = true
4645
buildId string = "0"
@@ -69,7 +68,6 @@ func main() {
6968
flag.StringVar(&libc, "libc", "", "LIBC")
7069
flag.BoolVar(&cgo, "cgo-enabled", cgo, "Enable cgo")
7170
flag.StringVar(&pkgArch, "pkg-arch", "", "PKG ARCH")
72-
flag.StringVar(&phjsToRelease, "phjs", "", "PhantomJS binary")
7371
flag.BoolVar(&race, "race", race, "Use race detector")
7472
flag.BoolVar(&modVendor, "modVendor", modVendor, "Go modules use vendor folder")
7573
flag.BoolVar(&includeBuildId, "includeBuildId", includeBuildId, "IncludeBuildId in package name")
@@ -459,9 +457,6 @@ func gruntBuildArg(task string) []string {
459457
if libc != "" {
460458
args = append(args, fmt.Sprintf("--libc=%s", libc))
461459
}
462-
if phjsToRelease != "" {
463-
args = append(args, fmt.Sprintf("--phjsToRelease=%v", phjsToRelease))
464-
}
465460
if enterprise {
466461
args = append(args, "--enterprise")
467462
}

docs/sources/administration/image_rendering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ The following example describes how to build and run the remote HTTP rendering s
108108

109109
## PhantomJS
110110

111-
> PhantomJS is deprecated since Grafana v6.4 and will be removed in a future release. Please migrate to the Grafana Image Renderer plugin or remote rendering service.
111+
> Starting from Grafana v7.0.0, all PhantomJS support has been removed. Please use the Grafana Image Renderer plugin or remote rendering service.
112112

113113
## Troubleshoot image rendering
114114

docs/sources/installation/upgrading.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,9 @@ Due to this change in Chrome, the `[security]` setting `cookie_samesite` configu
238238

239239
This version of Chrome also rejects insecure `SameSite=None` cookies. See https://www.chromestatus.com/feature/5633521622188032 for more information. Make sure that you
240240
change the `[security]` setting `cookie_secure` to `true` and use HTTPS when `cookie_samesite` is configured to `none`, otherwise authentication in Grafana won't work properly.
241+
242+
## Upgrading to v7.0
243+
244+
### PhantomJS removed
245+
246+
PhantomJS was deprecated in [Grafana v6.4](https://grafana.com/docs/grafana/latest/guides/whats-new-in-v6-4/#phantomjs-deprecation) and starting from Grafana v7.0.0, all PhantomJS support has been removed. This means that Grafana no longer ships with a built-in image renderer, and we adwise you to install the [Grafana Image Renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer).
-26.4 KB
Binary file not shown.

e2e/suite1/specs/smoketests.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ e2e.scenario({
2121
.contains('Show')
2222
.click();
2323

24-
e2e.pages.Components.BackButton.backArrow().click();
25-
2624
// e2e.pages.Dashboard.Panels.Panel.title('Panel Title').click();
2725
// e2e.pages.Dashboard.Panels.Panel.headerItems('Inspect').click();
2826
},

0 commit comments

Comments
 (0)