Skip to content

Commit

Permalink
fix(pom): use latest jfr-datasource and grafana-dashboard (backport #774
Browse files Browse the repository at this point in the history
) (#778)

* fix(pom): use latest jfr-datasource and grafana-dashboard (#774)

* fix(pom): use latest jfr-datasource and grafana-dashboard

Fixes #772

* chore(run.sh): use versions and port numbers from pom.xml by default

* fixup! chore(run.sh): use versions and port numbers from pom.xml by default

(cherry picked from commit 0595551)

* use jfr-datasource and grafana-dashboard 2.0.0

Co-authored-by: Andrew Azores <aazores@redhat.com>
  • Loading branch information
mergify[bot] and andrewazores authored Dec 6, 2021
1 parent fe13c7b commit ca2277e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
<cryostat.itest.podName>cryostat-itests</cryostat.itest.podName>
<cryostat.itest.grafana.port>3000</cryostat.itest.grafana.port>
<cryostat.itest.grafana.imageStream>quay.io/cryostat/cryostat-grafana-dashboard</cryostat.itest.grafana.imageStream>
<cryostat.itest.grafana.version>1.0.0</cryostat.itest.grafana.version>
<cryostat.itest.grafana.version>2.0.0</cryostat.itest.grafana.version>
<cryostat.itest.jfr-datasource.port>8080</cryostat.itest.jfr-datasource.port>
<cryostat.itest.jfr-datasource.imageStream>quay.io/cryostat/jfr-datasource</cryostat.itest.jfr-datasource.imageStream>
<cryostat.itest.jfr-datasource.version>1.0.0</cryostat.itest.jfr-datasource.version>
<cryostat.itest.jfr-datasource.version>2.0.0</cryostat.itest.jfr-datasource.version>

<org.apache.maven.plugins.compiler.version>3.8.1</org.apache.maven.plugins.compiler.version>
<org.apache.maven.plugins.surefire.version>2.22.2</org.apache.maven.plugins.surefire.version>
Expand Down
6 changes: 3 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ fi
echo -e "\n\nRunning $CRYOSTAT_IMAGE ...\n\n"

if [ -z "$CRYOSTAT_RJMX_PORT" ]; then
CRYOSTAT_RJMX_PORT=9091
CRYOSTAT_RJMX_PORT="$(xpath -q -e 'project/properties/cryostat.rjmxPort/text()' pom.xml)"
fi

if [ -z "$CRYOSTAT_RMI_PORT" ]; then
CRYOSTAT_RMI_PORT="$CRYOSTAT_RJMX_PORT"
fi

if [ -z "$CRYOSTAT_WEB_HOST" ]; then
CRYOSTAT_WEB_HOST="0.0.0.0" # listens on all interfaces and hostnames for testing purposes
CRYOSTAT_WEB_HOST="$(xpath -q -e 'project/properties/cryostat.itest.webHost/text()' pom.xml)"
fi

if [ -z "$CRYOSTAT_WEB_PORT" ]; then
CRYOSTAT_WEB_PORT=8181
CRYOSTAT_WEB_PORT="$(xpath -q -e 'project/properties/cryostat.itest.webPort/text()' pom.xml)"
fi

if [ -z "$CRYOSTAT_EXT_WEB_PORT" ]; then
Expand Down
35 changes: 22 additions & 13 deletions smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ set -e

function runCryostat() {
local DIR="$(dirname "$(readlink -f "$0")")"
GRAFANA_DATASOURCE_URL="http://0.0.0.0:8080" \
GRAFANA_DASHBOARD_URL="http://0.0.0.0:3000" \
local host="$(xpath -q -e 'project/properties/cryostat.itest.webHost/text()' pom.xml)"
local datasourcePort="$(xpath -q -e 'project/properties/cryostat.itest.jfr-datasource.port/text()' pom.xml)"
local grafanaPort="$(xpath -q -e 'project/properties/cryostat.itest.grafana.port/text()' pom.xml)"
GRAFANA_DATASOURCE_URL="http://${host}:${datasourcePort}" \
GRAFANA_DASHBOARD_URL="http://${host}:${grafanaPort}" \
CRYOSTAT_RJMX_USER=smoketest \
CRYOSTAT_RJMX_PASS=smoketest \
exec "$DIR/run.sh"
Expand Down Expand Up @@ -51,31 +54,41 @@ function runDemoApps() {
}

function runJfrDatasource() {
local stream="$(xpath -q -e 'project/properties/cryostat.itest.jfr-datasource.imageStream/text()' pom.xml)"
local tag="$(xpath -q -e 'project/properties/cryostat.itest.jfr-datasource.version/text()' pom.xml)"
podman run \
--name jfr-datasource \
--pod cryostat \
--rm -d quay.io/cryostat/jfr-datasource:2.0.0
--rm -d "${stream}:${tag}"
}

function runGrafana() {
local stream="$(xpath -q -e 'project/properties/cryostat.itest.grafana.imageStream/text()' pom.xml)"
local tag="$(xpath -q -e 'project/properties/cryostat.itest.grafana.version/text()' pom.xml)"
local host="$(xpath -q -e 'project/properties/cryostat.itest.webHost/text()' pom.xml)"
local port="$(xpath -q -e 'project/properties/cryostat.itest.jfr-datasource.port/text()' pom.xml)"
podman run \
--name grafana \
--pod cryostat \
--env GF_INSTALL_PLUGINS=grafana-simple-json-datasource \
--env GF_AUTH_ANONYMOUS_ENABLED=true \
--env JFR_DATASOURCE_URL="http://0.0.0.0:8080" \
--rm -d quay.io/cryostat/cryostat-grafana-dashboard:2.0.0
--env JFR_DATASOURCE_URL="http://${host}:${port}" \
--rm -d "${stream}:${tag}"
}

function createPod() {
local jmxPort="$(xpath -q -e 'project/properties/cryostat.rjmxPort/text()' pom.xml)"
local webPort="$(xpath -q -e 'project/properties/cryostat.webPort/text()' pom.xml)"
local datasourcePort="$(xpath -q -e 'project/properties/cryostat.itest.jfr-datasource.port/text()' pom.xml)"
local grafanaPort="$(xpath -q -e 'project/properties/cryostat.itest.grafana.port/text()' pom.xml)"
podman pod create \
--replace \
--hostname cryostat \
--name cryostat \
--publish 9091:9091 \
--publish 8181:8181 \
--publish 8080:8080 \
--publish 3000:3000 \
--publish "${jmxPort}:${jmxPort}" \
--publish "${webPort}:${webPort}" \
--publish "${datasourcePort}:${datasourcePort}" \
--publish "${grafanaPort}:${grafanaPort}" \
--publish 8081:8081 \
--publish 9093:9093 \
--publish 9094:9094 \
Expand All @@ -85,10 +98,6 @@ function createPod() {
--publish 8082:8082 \
--publish 9990:9990 \
--publish 9991:9991
# 9091: Cryostat RJMX
# 8181: Cryostat web services
# 8080: jfr-datasource
# 3000: grafana
# 8081: vertx-fib-demo
# 9093: vertx-fib-demo-1 RJMX
# 9094: vertx-fib-demo-2 RJMX
Expand Down

0 comments on commit ca2277e

Please sign in to comment.