diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 87dab50c910aa24671b50db413f4838e48d10369..4b8092d76f07ca6e4b15cde3bbec0ab3a440bfa3 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -15,7 +15,7 @@ services: restart: "no" container_name: dbrepo-metadata-db hostname: metadata-db - image: docker.io/bitnami/mariadb:11.1.3-debian-11-r6 + image: docker.io/bitnami/mariadb-galera:11.1.3-debian-11-r8 volumes: - metadata-db-data:/bitnami/mariadb - ./config/1_setup-schema.sql:/docker-entrypoint-initdb.d/1_setup-schema.sql @@ -25,6 +25,7 @@ services: environment: MARIADB_DATABASE: "${METADATA_DB:-dbrepo}" MARIADB_ROOT_PASSWORD: "${METADATA_DB_PASSWORD:-dbrepo}" + MARIADB_GALERA_MARIABACKUP_PASSWORD: "${METADATA_DB_BACKUP_PASSWORD:-dbrepobackup}" healthcheck: test: mysqladmin ping --user=root --password="${METADATA_DB_PASSWORD:-dbrepo}" --silent interval: 10s @@ -37,7 +38,7 @@ services: restart: "no" container_name: dbrepo-data-db hostname: data-db - image: docker.io/bitnami/mariadb:11.1.3-debian-11-r6 + image: docker.io/bitnami/mariadb-galera:11.1.3-debian-11-r8 volumes: - data-db-data:/bitnami/mariadb - "${SHARED_VOLUME:-/tmp}:/tmp" @@ -45,6 +46,7 @@ services: - "3307:3306" environment: MARIADB_ROOT_PASSWORD: "${DATA_DB_PASSWORD:-dbrepo}" + MARIADB_GALERA_MARIABACKUP_PASSWORD: "${DATA_DB_BACKUP_PASSWORD:-dbrepobackup}" healthcheck: test: mysqladmin ping --user=root --password="${DATA_DB_PASSWORD:-dbrepo}" --silent interval: 10s @@ -65,6 +67,7 @@ services: environment: MARIADB_DATABASE: "${AUTH_DB_NAME:-keycloak}" MARIADB_ROOT_PASSWORD: "${AUTH_DB_PASSWORD:-dbrepo}" + MARIADB_GALERA_MARIABACKUP_PASSWORD: "${AUTH_DB_BACKUP_PASSWORD:-dbrepobackup}" healthcheck: test: mysqladmin ping --user=root --password="${AUTH_DB_PASSWORD:-dbrepo}" --silent interval: 15s @@ -190,7 +193,7 @@ services: restart: "no" container_name: dbrepo-broker-service hostname: broker-service - image: docker.io/bitnami/rabbitmq:3.12-debian-12 + image: docker.io/bitnami/rabbitmq:3.13.7-debian-12-r4 ports: - 5672:5672 - 1883:1883 @@ -200,6 +203,8 @@ services: - ./config/enabled_plugins:/etc/rabbitmq/enabled_plugins - ./config/definitions.json:/app/definitions.json - broker-service-data:/bitnami/rabbitmq/mnesia + environment: + RABBITMQ_FEATURE_FLAGS: mqtt_v5 depends_on: dbrepo-identity-service: condition: service_healthy @@ -251,6 +256,11 @@ services: OPENSEARCH_USERNAME: ${SEARCH_DB_USERNAME:-admin} OPENSEARCH_PASSWORD: ${SEARCH_DB_PASSWORD:-admin} LOG_LEVEL: ${LOG_LEVEL:-info} + healthcheck: + test: curl -sSL localhost:8080/health | grep 'UP' || exit 1 + interval: 10s + timeout: 5s + retries: 12 dbrepo-data-db-sidecar: restart: "no" @@ -279,11 +289,17 @@ services: hostname: ui image: registry.datalab.tuwien.ac.at/dbrepo/ui:1.4.6 environment: + NODE_OPTIONS: "${UI_RUNTIME_OPTIONS:-}" NUXT_PUBLIC_API_CLIENT: "${BASE_URL:-http://localhost}" NUXT_PUBLIC_API_SERVER: "${BASE_URL:-http://localhost}" - NUXT_PUBLIC_UPLOAD_CLIENT: "${BASE_URL:-http://localhost}/api/upload/files/" + NUXT_PUBLIC_UPLOAD_CLIENT: "${BASE_URL:-http://localhost}/api/upload/files" + depends_on: + dbrepo-search-service: + condition: service_healthy + dbrepo-upload-service: + condition: service_healthy healthcheck: - test: wget -qO- localhost:3000 | grep "Database Repository" || exit 1 + test: curl -fsSL http://127.0.0.1:3000 && curl -fsSL http://127.0.0.1:3000/health interval: 10s timeout: 5s retries: 12 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9f414e5bc51a13701275578694efdae1cbd96ae0..0b74e7d98d71cf16aa681ff629a7dd9bd3540d0c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -304,6 +304,7 @@ test-ui: image: docker.io/docker:24-dind variables: UI_RUNTIME_OPTIONS: --max_old_space_size=256 + ENDPOINT: http://localhost:3000 needs: - build-ui dependencies: @@ -311,7 +312,7 @@ test-ui: before_script: - "apk add bash apache2-utils" - "docker compose build dbrepo-ui" - - "docker compose up -d dbrepo-ui" + - "docker run --name dbrepo-ui -p 3000:3000 -d dbrepo-ui:latest" script: - bash ./dbrepo-ui/test/test_heap.sh || exit 1 diff --git a/dbrepo-ui/test/test_heap.sh b/dbrepo-ui/test/test_heap.sh index d468c47e8734ebe49d06f70066ab82d9b1fa6bec..51acc0cf295d63ed794cb655ca8b44184b27e9b4 100755 --- a/dbrepo-ui/test/test_heap.sh +++ b/dbrepo-ui/test/test_heap.sh @@ -3,7 +3,6 @@ CALLS=1000 CONCURRENCY=10 ENDPOINT=http://localhost -sleep 10 ab -n "${CALLS}" -c "${CONCURRENCY}" "${ENDPOINT}/" ab -n "${CALLS}" -c "${CONCURRENCY}" "${ENDPOINT}/search" ab -n "${CALLS}" -c "${CONCURRENCY}" "${ENDPOINT}/login" diff --git a/docker-compose.yml b/docker-compose.yml index 7453cd261f18371e8d392f17a36c9deb16b14945..02305d60333c09a5939fca4d26bd4cc49d618b69 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,7 +23,6 @@ services: ports: - "3306:3306" environment: - BITNAMI_DEBUG: "true" MARIADB_DATABASE: "${METADATA_DB:-dbrepo}" MARIADB_ROOT_PASSWORD: "${METADATA_DB_PASSWORD:-dbrepo}" MARIADB_GALERA_MARIABACKUP_PASSWORD: "${METADATA_DB_BACKUP_PASSWORD:-dbrepobackup}" @@ -281,6 +280,11 @@ services: OPENSEARCH_USERNAME: ${SEARCH_DB_USERNAME:-admin} OPENSEARCH_PASSWORD: ${SEARCH_DB_PASSWORD:-admin} LOG_LEVEL: ${LOG_LEVEL:-info} + healthcheck: + test: curl -sSL localhost:8080/health | grep 'UP' || exit 1 + interval: 10s + timeout: 5s + retries: 12 dbrepo-data-db-sidecar: restart: "no" @@ -326,8 +330,8 @@ services: NUXT_PUBLIC_UPLOAD_CLIENT: "${BASE_URL:-http://localhost}/api/upload/files" depends_on: dbrepo-search-service: - condition: service_started - dbrepo-storage-service: + condition: service_healthy + dbrepo-upload-service: condition: service_healthy healthcheck: test: curl -fsSL http://127.0.0.1:3000 && curl -fsSL http://127.0.0.1:3000/health