Skip to content

Commit

Permalink
test(smoketest): add Opensearch as a sample app (cryostatio#570)
Browse files Browse the repository at this point in the history
Signed-off-by: Thuan Vo <[email protected]>
  • Loading branch information
tthvo authored Jul 19, 2024
1 parent 604ebf3 commit c25c4a7
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 12 deletions.
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ nb-configuration.xml
.env

.quinoa/
truststore/
templates/
certs/*.p12
certs/*.pass
*.jfr
.quarkus/
compose/auth_certs/*.key
compose/auth_certs/*.pem
truststore/
compose/**/*.key
compose/**/*.pem
compose/**/*.p12
compose/**/*.pass
compose/**/*.cer
6 changes: 5 additions & 1 deletion compose/agent_certs/generate-agent-certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -x

CERTS_DIR="$(realpath "$(dirname "$0")")"
TRUSTSTORE_DIR="$CERTS_DIR/../../truststore/"

SSL_KEYSTORE=agent-keystore.p12

Expand Down Expand Up @@ -57,4 +58,7 @@ keytool \
-storepass "$SSL_KEYSTORE_PASS" \
-file agent_server.cer

cp agent_server.cer "$CERTS_DIR/../../truststore/quarkus-test-agent.cer"


mkdir -p "${TRUSTSTORE_DIR}" && \
cp agent_server.cer "${TRUSTSTORE_DIR}"
36 changes: 36 additions & 0 deletions compose/opensearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: "3"
services:
opensearch-node:
image: docker.io/opensearchproject/opensearch:latest
hostname: opensearch-node
environment:
discovery.type: single-node
# Reference: https://opensearch.org/docs/latest/security/configuration/demo-configuration/#setting-up-a-custom-admin-password
OPENSEARCH_INITIAL_ADMIN_PASSWORD: password4Opense@rch
OPENSEARCH_JAVA_OPTS: >
-Dcom.sun.management.jmxremote.autodiscovery=true
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9292
-Dcom.sun.management.jmxremote.rmi.port=9292
-Djava.rmi.server.hostname=opensearch-node
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.local.only=false
volumes:
- opensearch-data:/usr/share/opensearch/data
expose:
- "9200" # REST API
# - "9600" # Performance Analyzer

opensearch-dashboards:
image: docker.io/opensearchproject/opensearch-dashboards:latest
hostname: opensearch-dashboards
ports:
- 5601:5601
environment:
OPENSEARCH_HOSTS: '["https://opensearch-node:9200"]'
OPENSEARCH_USERNAME: admin
OPENSEARCH_PASSWORD: password4Opense@rch

volumes:
opensearch-data:
12 changes: 6 additions & 6 deletions smoketest.bash
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ if [ "${DEPLOY_GRAFANA}" = "true" ]; then
fi

if [ "${INCLUDE_SAMPLE_APPS}" = "true" ]; then
FILES+=("${DIR}/compose/sample-apps.yml")
FILES+=("${DIR}/compose/opensearch.yml" "${DIR}/compose/sample-apps.yml")
if [ "${SAMPLE_APPS_USE_TLS}" = "true" ]; then
FILES+=("${DIR}/compose/sample-apps_https.yml")
fi
Expand Down Expand Up @@ -207,13 +207,13 @@ cleanup() {
${container_engine} volume rm auth_proxy_certs || true
fi
if [ "${INCLUDE_SAMPLE_APPS}" = "true" ] && [ "${SAMPLE_APPS_USE_TLS}" = "true" ]; then
rm "${DIR}/compose/agent_certs/agent_server.cer"
rm "${DIR}/compose/agent_certs/agent-keystore.p12"
rm "${DIR}/compose/agent_certs/keystore.pass"
rm "${DIR}/compose/agent_certs/agent_server.cer" || true
rm "${DIR}/compose/agent_certs/agent-keystore.p12" || true
rm "${DIR}/compose/agent_certs/keystore.pass" || true
fi
if [ "${USE_TLS}" = "true" ]; then
rm "${DIR}/compose/auth_certs/certificate.pem"
rm "${DIR}/compose/auth_certs/private.key"
rm "${DIR}/compose/auth_certs/certificate.pem" || true
rm "${DIR}/compose/auth_certs/private.key" || true
fi
if [ "${s3}" = "localstack" ]; then
${container_engine} rm localstack_cfg_helper || true
Expand Down

0 comments on commit c25c4a7

Please sign in to comment.