Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(smoketest): add additional s3 impl options #157

Merged
merged 6 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions smoketest.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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}"
Expand All @@ -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
Expand Down
38 changes: 38 additions & 0 deletions smoketest/compose/s3-cloudserver.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions smoketest/compose/s3-localstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ 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
QUARKUS_S3_AWS_CREDENTIALS_STATIC_PROVIDER_SECRET_ACCESS_KEY: unused
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"
Expand Down
2 changes: 1 addition & 1 deletion smoketest/compose/s3-minio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 33 additions & 0 deletions smoketest/compose/s3-seaweed.yml
Original file line number Diff line number Diff line change
@@ -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
Loading