diff --git a/smoketest.bash b/smoketest.bash index 22ef61c96..588825136 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} @@ -16,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|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 @@ -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 diff --git a/smoketest/compose/s3-cloudserver.yml b/smoketest/compose/s3-cloudserver.yml new file mode 100644 index 000000000..f1313367f --- /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 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 + 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 diff --git a/smoketest/compose/s3-localstack.yml b/smoketest/compose/s3-localstack.yml index 6b1564f23..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 @@ -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" 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 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