From 6df9ea7c186e084e5f3904e47f127be52a187ab8 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 9 Nov 2023 14:02:10 -0500 Subject: [PATCH 1/6] test(smoketest): clean up relative paths, make s3 selection more flexible --- smoketest.bash | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/smoketest.bash b/smoketest.bash index 22ef61c96..5124291e5 100755 --- a/smoketest.bash +++ b/smoketest.bash @@ -5,8 +5,10 @@ if ! command -v yq; then exit 1 fi +DIR="$(dirname "$(readlink -f "$0")")" + FILES=( - ./smoketest/compose/db.yml + "${DIR}/smoketest/compose/db.yml" ) USE_USERHOSTS=${USE_USERHOSTS:-true} @@ -39,10 +41,10 @@ while getopts "hs:gtOVXcb" opt; do s3="${OPTARG}" ;; g) - FILES+=('./smoketest/compose/cryostat-grafana.yml' './smoketest/compose/jfr-datasource.yml') + FILES+=("${DIR}/smoketest/compose/cryostat-grafana.yml" "${DIR}/smoketest/compose/jfr-datasource.yml") ;; t) - FILES+=('./smoketest/compose/sample-apps.yml') + FILES+=("${DIR}/smoketest/compose/sample-apps.yml") ;; O) PULL_IMAGES=false @@ -51,7 +53,7 @@ while getopts "hs:gtOVXcb" opt; do KEEP_VOLUMES=true ;; X) - FILES+=('./smoketest/compose/db-viewer.yml') + FILES+=("${DIR}/smoketest/compose/db-viewer.yml") ;; c) ce="${OPTARG}" @@ -66,20 +68,19 @@ while getopts "hs:gtOVXcb" opt; do esac done -if [ "${s3}" = "minio" ]; then - FILES+=('./smoketest/compose/s3-minio.yml') -elif [ "${s3}" = "localstack" ]; then - FILES+=('./smoketest/compose/s3-localstack.yml') -else +s3Manifest="${DIR}/smoketest/compose/s3-${s3}.yml" + +if [ ! -f "${s3Manifest}" ]; then echo "Unknown S3 selection: ${s3}" display_usage exit 2 fi +FILES+=("${s3Manifest}") if [ "${ce}" = "podman" ]; then - FILES+=('./smoketest/compose/cryostat.yml') + FILES+=("${DIR}/smoketest/compose/cryostat.yml") elif [ "${ce}" = "docker" ]; then - FILES+=('./smoketest/compose/cryostat_docker.yml') + FILES+=("${DIR}/smoketest/compose/cryostat_docker.yml") else echo "Unknown Container Engine selection: ${ce}" display_usage From 627f9e017a9834fe8abf2fee721311b11784314f Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 9 Nov 2023 14:30:35 -0500 Subject: [PATCH 2/6] use latest localstack --- smoketest/compose/s3-localstack.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smoketest/compose/s3-localstack.yml b/smoketest/compose/s3-localstack.yml index 6b1564f23..df17567ff 100644 --- a/smoketest/compose/s3-localstack.yml +++ b/smoketest/compose/s3-localstack.yml @@ -12,7 +12,7 @@ services: AWS_ACCESS_KEY_ID: unused AWS_SECRET_ACCESS_KEY: unused s3: - image: docker.io/localstack/localstack:1.4.0 + image: docker.io/localstack/localstack:latest hostname: s3 expose: - "4566" From 70469fdad8afe31185da0502d451026197cf127d Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 9 Nov 2023 14:31:03 -0500 Subject: [PATCH 3/6] add cloudserver s3 implementation option --- smoketest.bash | 2 +- smoketest/compose/s3-cloudserver.yml | 38 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 smoketest/compose/s3-cloudserver.yml diff --git a/smoketest.bash b/smoketest.bash index 5124291e5..dac617b47 100755 --- a/smoketest.bash +++ b/smoketest.bash @@ -20,7 +20,7 @@ display_usage() { echo "Usage:" echo -e "\t-h\t\t\t\tprint this Help text." echo -e "\t-O\t\t\t\tOffline mode, do not attempt to pull container images." - echo -e "\t-s [minio|localstack]\t\tS3 implementation to spin up (default \"minio\")." + echo -e "\t-s [minio|cloudserver|localstack]\t\tS3 implementation to spin up (default \"minio\")." echo -e "\t-g\t\t\t\tinclude Grafana dashboard and jfr-datasource in deployment." echo -e "\t-t\t\t\t\tinclude sample applications for Testing." echo -e "\t-V\t\t\t\tdo not discard data storage Volumes on exit." diff --git a/smoketest/compose/s3-cloudserver.yml b/smoketest/compose/s3-cloudserver.yml new file mode 100644 index 000000000..78987705b --- /dev/null +++ b/smoketest/compose/s3-cloudserver.yml @@ -0,0 +1,38 @@ +version: "3" +services: + cryostat: + environment: + STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings + QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:8000 + QUARKUS_S3_PATH_STYLE_ACCESS: "true" # needed for cloudserver, but if the environment and specific S3 impl supports DNS subdomain style access then that should be preferred + QUARKUS_S3_AWS_REGION: us-east-1 + QUARKUS_S3_AWS_CREDENTIALS_TYPE: static + QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_ACCESS_KEY_ID: accessKey1 + QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_SECRET_ACCESS_KEY: verySecretKey1 + AWS_ACCESS_KEY_ID: accessKey1 + AWS_SECRET_ACCESS_KEY: verySecretKey1 + s3: + image: docker.io/zenko/cloudserver:latest + hostname: s3 + expose: + - "8000" + environment: + S3BACKEND: mem + ENDPOINT: s3 + LOG_LEVEL: debug + REMOTE_MANAGEMENT_DISABLE: 1 + SCALITY_ACCESS_KEY_ID: accessKey1 + SCALITY_SECRET_ACCESS_KEY: verySecretKey1 + labels: + kompose.service.expose: "cloudserver" + restart: always + # healthcheck: + # test: + # - CMD-SHELL + # - curl + # - --fail + # - http://localhost:8000/ + # interval: 10s + # retries: 3 + # start_period: 10s + # timeout: 5s From f8053c462ac87cb6a0834db5b78b55bf3dac67bd Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 9 Nov 2023 16:24:27 -0500 Subject: [PATCH 4/6] clarify comment --- smoketest/compose/s3-cloudserver.yml | 2 +- smoketest/compose/s3-localstack.yml | 2 +- smoketest/compose/s3-minio.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/smoketest/compose/s3-cloudserver.yml b/smoketest/compose/s3-cloudserver.yml index 78987705b..f1313367f 100644 --- a/smoketest/compose/s3-cloudserver.yml +++ b/smoketest/compose/s3-cloudserver.yml @@ -4,7 +4,7 @@ services: environment: STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:8000 - QUARKUS_S3_PATH_STYLE_ACCESS: "true" # needed for cloudserver, but if the environment and specific S3 impl supports DNS subdomain style access then that should be preferred + QUARKUS_S3_PATH_STYLE_ACCESS: "true" # needed since compose setup does not support DNS subdomain resolution QUARKUS_S3_AWS_REGION: us-east-1 QUARKUS_S3_AWS_CREDENTIALS_TYPE: static QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_ACCESS_KEY_ID: accessKey1 diff --git a/smoketest/compose/s3-localstack.yml b/smoketest/compose/s3-localstack.yml index df17567ff..7f967ebea 100644 --- a/smoketest/compose/s3-localstack.yml +++ b/smoketest/compose/s3-localstack.yml @@ -4,7 +4,7 @@ services: environment: STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:4566 - QUARKUS_S3_PATH_STYLE_ACCESS: "true" # needed in smoketest, but if the environment and specific S3 impl supports DNS subdomain style access then that should be preferred + QUARKUS_S3_PATH_STYLE_ACCESS: "true" # needed since compose setup does not support DNS subdomain resolution QUARKUS_S3_AWS_REGION: us-east-1 QUARKUS_S3_AWS_CREDENTIALS_TYPE: static QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_ACCESS_KEY_ID: unused diff --git a/smoketest/compose/s3-minio.yml b/smoketest/compose/s3-minio.yml index 47ff66b77..46fe83b44 100644 --- a/smoketest/compose/s3-minio.yml +++ b/smoketest/compose/s3-minio.yml @@ -4,7 +4,7 @@ services: environment: STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:9000 - QUARKUS_S3_PATH_STYLE_ACCESS: "true" # needed for Minio, but if the environment and specific S3 impl supports DNS subdomain style access then that should be preferred + QUARKUS_S3_PATH_STYLE_ACCESS: "true" # needed since compose setup does not support DNS subdomain resolution QUARKUS_S3_AWS_REGION: us-east-1 QUARKUS_S3_AWS_CREDENTIALS_TYPE: static QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_ACCESS_KEY_ID: minioroot From 2f39dc93ca4486a437ac5df929875ce6e97d050b Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 9 Nov 2023 16:24:42 -0500 Subject: [PATCH 5/6] add seaweedfs s3 impl option --- smoketest.bash | 2 +- smoketest/compose/s3-seaweed.yml | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 smoketest/compose/s3-seaweed.yml diff --git a/smoketest.bash b/smoketest.bash index dac617b47..c3954081c 100755 --- a/smoketest.bash +++ b/smoketest.bash @@ -20,7 +20,7 @@ display_usage() { echo "Usage:" echo -e "\t-h\t\t\t\tprint this Help text." echo -e "\t-O\t\t\t\tOffline mode, do not attempt to pull container images." - echo -e "\t-s [minio|cloudserver|localstack]\t\tS3 implementation to spin up (default \"minio\")." + echo -e "\t-s [minio|seaweed|cloudserver|localstack]\t\tS3 implementation to spin up (default \"minio\")." echo -e "\t-g\t\t\t\tinclude Grafana dashboard and jfr-datasource in deployment." echo -e "\t-t\t\t\t\tinclude sample applications for Testing." echo -e "\t-V\t\t\t\tdo not discard data storage Volumes on exit." diff --git a/smoketest/compose/s3-seaweed.yml b/smoketest/compose/s3-seaweed.yml new file mode 100644 index 000000000..7de0854d6 --- /dev/null +++ b/smoketest/compose/s3-seaweed.yml @@ -0,0 +1,33 @@ +version: "3" +services: + cryostat: + environment: + STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings + QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:8333 + QUARKUS_S3_PATH_STYLE_ACCESS: "true" # needed since compose setup does not support DNS subdomain resolution + QUARKUS_S3_AWS_REGION: us-east-1 + QUARKUS_S3_AWS_CREDENTIALS_TYPE: static + QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_ACCESS_KEY_ID: unused + QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_SECRET_ACCESS_KEY: unused + AWS_ACCESS_KEY_ID: unused + AWS_SECRET_ACCESS_KEY: unused + s3: + image: docker.io/chrislusf/seaweedfs:latest + command: server -s3 + hostname: s3 + expose: + - "8333" + labels: + kompose.service.expose: "seaweed" + restart: always + healthcheck: + test: + - CMD-SHELL + - wget + - --tries=1 + - --spider + - http://s3:8333/ + interval: 10s + retries: 3 + start_period: 30s + timeout: 5s From db166aa4495b83c386f5c1cbc9fcd3498c0bd3e1 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 9 Nov 2023 16:35:13 -0500 Subject: [PATCH 6/6] fix help text indentation --- smoketest.bash | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/smoketest.bash b/smoketest.bash index c3954081c..588825136 100755 --- a/smoketest.bash +++ b/smoketest.bash @@ -18,15 +18,15 @@ OPEN_TABS=${OPEN_TABS:-false} display_usage() { echo "Usage:" - echo -e "\t-h\t\t\t\tprint this Help text." - echo -e "\t-O\t\t\t\tOffline mode, do not attempt to pull container images." - echo -e "\t-s [minio|seaweed|cloudserver|localstack]\t\tS3 implementation to spin up (default \"minio\")." - echo -e "\t-g\t\t\t\tinclude Grafana dashboard and jfr-datasource in deployment." - echo -e "\t-t\t\t\t\tinclude sample applications for Testing." - echo -e "\t-V\t\t\t\tdo not discard data storage Volumes on exit." - echo -e "\t-X\t\t\t\tdeploy additional development aid tools." - echo -e "\t-c [podman|docker]\t\tUse Podman or Docker Container Engine (default \"podman\")." - echo -e "\t-b\t\t\t\tOpen a Browser tab for each running service's first mapped port (ex. Cryostat web client, Minio console)" + echo -e "\t-h\t\t\t\t\t\tprint this Help text." + echo -e "\t-O\t\t\t\t\t\tOffline mode, do not attempt to pull container images." + echo -e "\t-s [minio|seaweed|cloudserver|localstack]\tS3 implementation to spin up (default \"minio\")." + echo -e "\t-g\t\t\t\t\t\tinclude Grafana dashboard and jfr-datasource in deployment." + echo -e "\t-t\t\t\t\t\t\tinclude sample applications for Testing." + echo -e "\t-V\t\t\t\t\t\tdo not discard data storage Volumes on exit." + echo -e "\t-X\t\t\t\t\t\tdeploy additional development aid tools." + echo -e "\t-c [podman|docker]\t\t\t\tUse Podman or Docker Container Engine (default \"podman\")." + echo -e "\t-b\t\t\t\t\t\tOpen a Browser tab for each running service's first mapped port (ex. Cryostat web client, Minio console)" } s3=minio