Skip to content

Commit

Permalink
test(smoketest): add native image sample app (backport #1525) (#1538)
Browse files Browse the repository at this point in the history
* test(smoketest): add native image sample app (#1525)
(cherry picked from commit f0884a6)

---------

Co-authored-by: Andrew Azores <aazores@redhat.com>
  • Loading branch information
mergify[bot] and andrewazores authored Jun 13, 2023
1 parent 90a09d4 commit 3a16747
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 36 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<com.google.dagger.version>2.45</com.google.dagger.version>
<com.google.dagger.compiler.version>2.45</com.google.dagger.compiler.version>

<io.cryostat.core.version>2.20.0</io.cryostat.core.version>
<io.cryostat.core.version>2.21.0</io.cryostat.core.version>

<org.openjdk.nashorn.core.version>15.4</org.openjdk.nashorn.core.version>
<org.apache.commons.lang3.version>3.12.0</org.apache.commons.lang3.version>
Expand Down
84 changes: 49 additions & 35 deletions smoketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,44 +96,77 @@ runPostgres() {
}

runDemoApps() {
local webPort;
if [ -z "$CRYOSTAT_WEB_PORT" ]; then
webPort="$(getPomProperty cryostat.itest.webPort)"
else
webPort="${CRYOSTAT_WEB_PORT}"
fi
if [ -z "$CRYOSTAT_DISABLE_SSL" ]; then
local protocol="https"
else
local protocol="http"
fi

podman run \
--name jmxquarkus \
--pod cryostat-pod \
--label io.cryostat.connectUrl="service:jmx:rmi:///jndi/rmi://localhost:51423/jmxrmi" \
--rm -d quay.io/roberttoyonaga/jmx:jmxquarkus@sha256:b067f29faa91312d20d43c55d194a2e076de7d0d094da3d43ee7d2b2b5a6f100

podman run \
--name vertx-fib-demo-1 \
--env HTTP_PORT=8081 \
--env JMX_PORT=9093 \
--env CRYOSTAT_AGENT_APP_NAME="vertx-fib-demo-1" \
--env CRYOSTAT_AGENT_WEBCLIENT_SSL_TRUST_ALL="true" \
--env CRYOSTAT_AGENT_WEBCLIENT_SSL_VERIFY_HOSTNAME="false" \
--env CRYOSTAT_AGENT_WEBSERVER_HOST="localhost" \
--env CRYOSTAT_AGENT_WEBSERVER_PORT="8910" \
--env CRYOSTAT_AGENT_CALLBACK="http://localhost:8910/" \
--env CRYOSTAT_AGENT_BASEURI="${protocol}://localhost:${webPort}/" \
--env CRYOSTAT_AGENT_TRUST_ALL="true" \
--env CRYOSTAT_AGENT_AUTHORIZATION="Basic $(echo user:pass | base64)" \
--pod cryostat-pod \
--label io.cryostat.connectUrl="service:jmx:rmi:///jndi/rmi://localhost:9093/jmxrmi" \
--rm -d quay.io/andrewazores/vertx-fib-demo:0.9.1
--rm -d quay.io/andrewazores/vertx-fib-demo:0.12.3

podman run \
--name vertx-fib-demo-2 \
--env HTTP_PORT=8082 \
--env JMX_PORT=9094 \
--env USE_AUTH=true \
--env CRYOSTAT_AGENT_APP_NAME="vertx-fib-demo-2" \
--env CRYOSTAT_AGENT_WEBCLIENT_SSL_TRUST_ALL="true" \
--env CRYOSTAT_AGENT_WEBCLIENT_SSL_VERIFY_HOSTNAME="false" \
--env CRYOSTAT_AGENT_WEBSERVER_HOST="localhost" \
--env CRYOSTAT_AGENT_WEBSERVER_PORT="8911" \
--env CRYOSTAT_AGENT_CALLBACK="http://localhost:8911/" \
--env CRYOSTAT_AGENT_BASEURI="${protocol}://localhost:${webPort}/" \
--env CRYOSTAT_AGENT_TRUST_ALL="true" \
--env CRYOSTAT_AGENT_AUTHORIZATION="Basic $(echo user:pass | base64)" \
--pod cryostat-pod \
--label io.cryostat.connectUrl="service:jmx:rmi:///jndi/rmi://localhost:9094/jmxrmi" \
--rm -d quay.io/andrewazores/vertx-fib-demo:0.9.1
--rm -d quay.io/andrewazores/vertx-fib-demo:0.12.3

podman run \
--name vertx-fib-demo-3 \
--env HTTP_PORT=8083 \
--env JMX_PORT=9095 \
--env USE_SSL=true \
--env USE_AUTH=true \
--env CRYOSTAT_AGENT_APP_NAME="vertx-fib-demo-3" \
--env CRYOSTAT_AGENT_WEBCLIENT_SSL_TRUST_ALL="true" \
--env CRYOSTAT_AGENT_WEBCLIENT_SSL_VERIFY_HOSTNAME="false" \
--env CRYOSTAT_AGENT_WEBSERVER_HOST="localhost" \
--env CRYOSTAT_AGENT_WEBSERVER_PORT="8912" \
--env CRYOSTAT_AGENT_CALLBACK="http://localhost:8912/" \
--env CRYOSTAT_AGENT_BASEURI="${protocol}://localhost:${webPort}/" \
--env CRYOSTAT_AGENT_TRUST_ALL="true" \
--env CRYOSTAT_AGENT_AUTHORIZATION="Basic $(echo user:pass | base64)" \
--pod cryostat-pod \
--label io.cryostat.connectUrl="service:jmx:rmi:///jndi/rmi://localhost:9095/jmxrmi" \
--rm -d quay.io/andrewazores/vertx-fib-demo:0.9.1

local webPort;
if [ -z "$CRYOSTAT_WEB_PORT" ]; then
webPort="$(getPomProperty cryostat.itest.webPort)"
else
webPort="${CRYOSTAT_WEB_PORT}"
fi
if [ -z "$CRYOSTAT_DISABLE_SSL" ]; then
local protocol="https"
else
local protocol="http"
fi
--rm -d quay.io/andrewazores/vertx-fib-demo:0.12.3

# this config is broken on purpose (missing required env vars) to test the agent's behaviour
# when not properly set up
Expand Down Expand Up @@ -251,49 +284,30 @@ runReportGenerator() {
}

createPod() {
local jmxPort; local webPort; local datasourcePort; local grafanaPort;
jmxPort="$(getPomProperty cryostat.rjmxPort)"
local webPort; local datasourcePort; local grafanaPort;
webPort="$(getPomProperty cryostat.webPort)"
datasourcePort="$(getPomProperty cryostat.itest.jfr-datasource.port)"
grafanaPort="$(getPomProperty cryostat.itest.grafana.port)"
podman pod create \
--replace \
--hostname cryostat \
--name cryostat-pod \
--publish "${jmxPort}:${jmxPort}" \
--publish "${webPort}:${webPort}" \
--publish "${datasourcePort}:${datasourcePort}" \
--publish "${grafanaPort}:${grafanaPort}" \
--publish 5432:5432 \
--publish 8081:8081 \
--publish 8082:8082 \
--publish 8083:8083 \
--publish 9093:9093 \
--publish 9094:9094 \
--publish 9095:9095 \
--publish 9096:9096 \
--publish 9999:9999 \
--publish 8082:8082 \
--publish 9990:9990 \
--publish 9991:9991 \
--publish 10000:10000 \
--publish 10001:10001 \
--publish 10010:10010
# 5432: postgres
# 8081: vertx-fib-demo-1 HTTP
# 8082: vertx-fib-demo-2 HTTP
# 8083: vertx-fib-demo-3 HTTP
# 9093: vertx-fib-demo-1 RJMX
# 9094: vertx-fib-demo-2 RJMX
# 9095: vertx-fib-demo-3 RJMX
# 9097: quarkus-test-agent-1 RJMX
# 9098: quarkus-test-agent-2 RJMX
# 8082: Wildfly HTTP
# 9990: Wildfly Admin Console
# 9991: Wildfly RJMX
# 9977: quarkus-test-agent-1 Agent-HTTP
# 9988: quarkus-test-agent-2 Agent-HTTP
# 10000: cryostat-reports RJMX
# 10001: cryostat-reports HTTP
# 10010: quarkus-test-agent-1 HTTP
# 10011: quarkus-test-agent-2 HTTP
Expand Down

0 comments on commit 3a16747

Please sign in to comment.