Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
<cryostat.itest.containerName>cryostat-itest</cryostat.itest.containerName>
<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>latest</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>latest</cryostat.itest.jfr-datasource.version>

<io.reactiverse.plugin.version>1.0.25</io.reactiverse.plugin.version>
<org.apache.maven.plugins.compiler.version>3.8.1</org.apache.maven.plugins.compiler.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