From c25c4a75e4eec59f562913f87c3ba393bafde13e Mon Sep 17 00:00:00 2001 From: Thuan Vo Date: Fri, 19 Jul 2024 11:04:24 -0700 Subject: [PATCH] test(smoketest): add Opensearch as a sample app (#570) Signed-off-by: Thuan Vo --- .gitignore | 11 ++++--- compose/agent_certs/generate-agent-certs.sh | 6 +++- compose/opensearch.yml | 36 +++++++++++++++++++++ smoketest.bash | 12 +++---- 4 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 compose/opensearch.yml diff --git a/.gitignore b/.gitignore index 8b9eace37d..332fcab656 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/compose/agent_certs/generate-agent-certs.sh b/compose/agent_certs/generate-agent-certs.sh index 65c38a8095..556fa0a1e8 100755 --- a/compose/agent_certs/generate-agent-certs.sh +++ b/compose/agent_certs/generate-agent-certs.sh @@ -3,6 +3,7 @@ set -x CERTS_DIR="$(realpath "$(dirname "$0")")" +TRUSTSTORE_DIR="$CERTS_DIR/../../truststore/" SSL_KEYSTORE=agent-keystore.p12 @@ -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}" diff --git a/compose/opensearch.yml b/compose/opensearch.yml new file mode 100644 index 0000000000..60ab45f6ff --- /dev/null +++ b/compose/opensearch.yml @@ -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: diff --git a/smoketest.bash b/smoketest.bash index 1047853d82..46f5f7a69e 100755 --- a/smoketest.bash +++ b/smoketest.bash @@ -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 @@ -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