Skip to content

Commit

Permalink
test(smoketest): cleanup, add config to run without S3 (#472)
Browse files Browse the repository at this point in the history
* chore(smoketest): move service dependency declarations into correct files

* test(smoketest): add configuration for no configured S3 provider
  • Loading branch information
andrewazores authored May 30, 2024
1 parent 212be10 commit 72dbe66
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 10 deletions.
5 changes: 0 additions & 5 deletions compose/cryostat.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
version: "3"
services:
cryostat:
depends_on:
db:
condition: service_healthy
s3:
condition: service_healthy
deploy:
resources:
limits:
Expand Down
3 changes: 3 additions & 0 deletions compose/db.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: "3"
services:
cryostat:
depends_on:
db:
condition: service_healthy
environment:
QUARKUS_HIBERNATE_ORM_DATABASE_GENERATION: ${DATABASE_GENERATION:-drop-and-create}
QUARKUS_DATASOURCE_USERNAME: cryostat3
Expand Down
3 changes: 3 additions & 0 deletions compose/s3-cloudserver.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: "3"
services:
cryostat:
depends_on:
s3:
condition: service_healthy
environment:
STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings
QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:8000
Expand Down
3 changes: 3 additions & 0 deletions compose/s3-localstack.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: "3"
services:
cryostat:
depends_on:
s3:
condition: service_healthy
environment:
STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings
QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:4566
Expand Down
3 changes: 3 additions & 0 deletions compose/s3-minio.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: "3"
services:
cryostat:
depends_on:
s3:
condition: service_healthy
environment:
STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings
QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:9000
Expand Down
12 changes: 12 additions & 0 deletions compose/s3-none.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: "3"
services:
cryostat:
environment:
QUARKUS_S3_ENDPOINT_OVERRIDE: http://s3:4566
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
3 changes: 3 additions & 0 deletions compose/s3-seaweed.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: "3"
services:
cryostat:
depends_on:
s3:
condition: service_healthy
environment:
STORAGE_BUCKETS_ARCHIVES_NAME: archivedrecordings
CRYOSTAT_SERVICES_REPORTS_STORAGE_CACHE_NAME: archivedreports
Expand Down
16 changes: 11 additions & 5 deletions smoketest.bash
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ if [ "${USE_PROXY}" = "true" ]; then
CRYOSTAT_HTTP_PORT=8181
GRAFANA_DASHBOARD_EXT_URL=http://localhost:8080/grafana/
else
FILES+=("${DIR}/compose/no_proxy.yml" "${DIR}/compose/s3_no_proxy.yml")
FILES+=("${DIR}/compose/no_proxy.yml")
if [ "${s3}" != "none" ]; then
FILES+=("${DIR}/compose/s3_no_proxy.yml")
fi
if [ "${DEPLOY_GRAFANA}" = "true" ]; then
FILES+=("${DIR}/compose/grafana_no_proxy.yml")
fi
Expand All @@ -115,16 +118,19 @@ export GRAFANA_DASHBOARD_EXT_URL
export DATABASE_GENERATION

s3Manifest="${DIR}/compose/s3-${s3}.yml"
STORAGE_PORT="$(yq '.services.*.expose[0]' "${s3Manifest}" | grep -v null)"
export STORAGE_PORT
export PRECREATE_BUCKETS

if [ ! -f "${s3Manifest}" ]; then
echo "Unknown S3 selection: ${s3}"
display_usage
exit 2
fi
FILES+=("${s3Manifest}")
if [ "${s3}" = "none" ]; then
STORAGE_PORT="4566"
else
STORAGE_PORT="$(yq '.services.*.expose[0]' "${s3Manifest}" | grep -v null)"
fi
export STORAGE_PORT
export PRECREATE_BUCKETS

unshift() {
local -n ary=$1;
Expand Down

0 comments on commit 72dbe66

Please sign in to comment.