Skip to content

Commit

Permalink
test(smoketest): split up sample applications, selectable using -t (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores authored Jul 19, 2024
1 parent 7453104 commit 826f4d0
Show file tree
Hide file tree
Showing 11 changed files with 268 additions and 233 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

set -x

Expand All @@ -9,10 +9,12 @@ SSL_KEYSTORE=agent-keystore.p12

SSL_KEYSTORE_PASS_FILE=keystore.pass

AGENT_SERVER_CERT_FILE=agent_server.cer

cleanup() {
cd "$CERTS_DIR"
rm "$SSL_KEYSTORE" "$SSL_KEYSTORE_PASS_FILE" agent-server.cer
cd -
pushd "$CERTS_DIR"
rm "$SSL_KEYSTORE" "$SSL_KEYSTORE_PASS_FILE" "$AGENT_SERVER_CERT_FILE"
popd
}

case "$1" in
Expand Down Expand Up @@ -43,8 +45,8 @@ echo "$SSL_KEYSTORE_PASS" > "$SSL_KEYSTORE_PASS_FILE"

keytool \
-genkeypair -v \
-alias quarkus-test-agent \
-dname "CN=quarkus-test-agent, O=Cryostat, C=CA" \
-alias quarkus-cryostat-agent \
-dname "CN=quarkus-cryostat-agent, O=Cryostat, C=CA" \
-storetype PKCS12 \
-validity 365 \
-keyalg RSA \
Expand All @@ -53,12 +55,10 @@ keytool \

keytool \
-exportcert -v \
-alias quarkus-test-agent \
-alias quarkus-cryostat-agent \
-keystore "$SSL_KEYSTORE" \
-storepass "$SSL_KEYSTORE_PASS" \
-file agent_server.cer


-file "$AGENT_SERVER_CERT_FILE"

mkdir -p "${TRUSTSTORE_DIR}" && \
cp agent_server.cer "${TRUSTSTORE_DIR}"
2 changes: 1 addition & 1 deletion compose/auth_proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
memory: 32m
image: ${OAUTH2_PROXY_IMAGE:-quay.io/oauth2-proxy/oauth2-proxy:latest}
command:
- --alpha-config=/tmp/auth_proxy_alpha_config.yaml
- --alpha-config=/tmp/auth_proxy_alpha_config.yml
volumes:
- auth_proxy_cfg:/tmp
hostname: auth
Expand Down
File renamed without changes.
File renamed without changes.
199 changes: 0 additions & 199 deletions compose/sample-apps.yml

This file was deleted.

36 changes: 36 additions & 0 deletions compose/sample_apps/gameserver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3"
services:
gameserver:
depends_on:
cryostat:
condition: service_healthy
image: ${GAMESERVER_TEST_IMAGE:-quay.io/redhat-java-monitoring/gameserver-cryostat-agent:latest}
hostname: gameserver
ports:
- "7091"
- "9494"
- "25565:25565"
environment:
CRYOSTAT_AGENT_APP_NAME: gameserver
CRYOSTAT_AGENT_WEBSERVER_HOST: gameserver
CRYOSTAT_AGENT_WEBSERVER_PORT: 9494
CRYOSTAT_AGENT_CALLBACK: http://gameserver:9494/
CRYOSTAT_AGENT_BASEURI: ${CRYOSTAT_PROXY_PROTOCOL}://${CRYOSTAT_HTTP_HOST}:${CRYOSTAT_PROXY_PORT}/
CRYOSTAT_AGENT_BASEURI_RANGE: public
CRYOSTAT_AGENT_WEBCLIENT_TLS_TRUST_ALL: "true"
CRYOSTAT_AGENT_WEBCLIENT_TLS_VERIFY_HOSTNAME: "false"
CRYOSTAT_AGENT_AUTHORIZATION_TYPE: basic
CRYOSTAT_AGENT_AUTHORIZATION_VALUE: user:pass
CRYOSTAT_AGENT_API_WRITES_ENABLED: "true"
CRYOSTAT_AGENT_HARVESTER_TEMPLATE: Profiling
CRYOSTAT_AGENT_HARVESTER_PERIOD_MS: 300000
CRYOSTAT_AGENT_HARVESTER_MAX_FILES: 3
CRYOSTAT_AGENT_HARVESTER_EXIT_MAX_AGE_MS: 60000
CRYOSTAT_AGENT_HARVESTER_EXIT_MAX_SIZE_B: 153600 # "$(echo 1024*150 | bc)"
EULA: "true"
ONLINE_MODE: "false"
OVERRIDE_SERVER_PROPERTIES: "true"
ENABLE_JMX: "true"
JMX_HOST: gameserver
JMX_PORT: "7091"
JVM_OPTS: -javaagent:/opt/cryostat/agent.jar
6 changes: 6 additions & 0 deletions compose/opensearch.yml → compose/sample_apps/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ services:
OPENSEARCH_HOSTS: '["https://opensearch-node:9200"]'
OPENSEARCH_USERNAME: admin
OPENSEARCH_PASSWORD: password4Opense@rch
healthcheck:
test: curl --fail http://localhost:5601 || exit 1
interval: 10s
retries: 3
start_period: 30s
timeout: 5s

volumes:
opensearch-data:
47 changes: 47 additions & 0 deletions compose/sample_apps/quarkus-cryostat-agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: "3"
services:
quarkus-cryostat-agent:
image: ${QUARKUS_TEST_IMAGE:-quay.io/redhat-java-monitoring/quarkus-cryostat-agent:latest}
# do not add a depends_on:cryostat/depends_on:auth here, so that we can test that the agent is tolerant of that state
hostname: quarkus-cryostat-agent
ports:
- "10010:10010"
expose:
- "9977"
environment:
JAVA_OPTS_APPEND: >-
-Dquarkus.http.host=0.0.0.0
-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-javaagent:/deployments/app/cryostat-agent.jar
-Dcom.sun.management.jmxremote.autodiscovery=false
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=22222
-Dcom.sun.management.jmxremote.rmi.port=22222
-Djava.rmi.server.hostname=quarkus-cryostat-agent
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.local.only=false
QUARKUS_HTTP_PORT: 10010
ORG_ACME_CRYOSTATSERVICE_ENABLED: "false"
CRYOSTAT_AGENT_APP_NAME: quarkus-cryostat-agent
CRYOSTAT_AGENT_WEBSERVER_HOST: quarkus-cryostat-agent
CRYOSTAT_AGENT_WEBSERVER_PORT: 9977
CRYOSTAT_AGENT_CALLBACK: http://quarkus-cryostat-agent:9977/
CRYOSTAT_AGENT_BASEURI: ${CRYOSTAT_PROXY_PROTOCOL}://${CRYOSTAT_HTTP_HOST}:${CRYOSTAT_PROXY_PORT}/
CRYOSTAT_AGENT_BASEURI_RANGE: public
CRYOSTAT_AGENT_WEBCLIENT_TLS_TRUST_ALL: "true"
CRYOSTAT_AGENT_WEBCLIENT_TLS_VERIFY_HOSTNAME: "false"
CRYOSTAT_AGENT_AUTHORIZATION_TYPE: basic
CRYOSTAT_AGENT_AUTHORIZATION_VALUE: user:pass
CRYOSTAT_AGENT_HARVESTER_PERIOD_MS: 30000
CRYOSTAT_AGENT_HARVESTER_MAX_FILES: 3
CRYOSTAT_AGENT_HARVESTER_EXIT_MAX_AGE_MS: 60000
CRYOSTAT_AGENT_HARVESTER_EXIT_MAX_SIZE_B: 153600 # "$(echo 1024*150 | bc)"
CRYOSTAT_AGENT_API_WRITES_ENABLED: "true"
restart: always
healthcheck:
test: curl --fail http://localhost:10010 || exit 1
interval: 10s
retries: 3
start_period: 30s
timeout: 5s
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: "3"
services:
quarkus-test-agent:
quarkus-cryostat-agent:
environment:
CRYOSTAT_AGENT_CALLBACK: https://quarkus-test-agent:9977/
CRYOSTAT_AGENT_CALLBACK: https://quarkus-cryostat-agent:9977/
CRYOSTAT_AGENT_WEBSERVER_TLS_KEYSTORE_PASS: /certs/keystore.pass
CRYOSTAT_AGENT_WEBSERVER_TLS_KEYSTORE_FILE: /certs/agent-keystore.p12
CRYOSTAT_AGENT_WEBSERVER_TLS_CERT_FILE: /certs/agent_server.cer
Expand Down
Loading

0 comments on commit 826f4d0

Please sign in to comment.