diff --git a/docker/docker-compose.pr-tests.yml b/docker/docker-compose.pr-tests.yml index ad13c9e1d14..7888ce5bf54 100644 --- a/docker/docker-compose.pr-tests.yml +++ b/docker/docker-compose.pr-tests.yml @@ -54,7 +54,7 @@ services: - pr-tests rabbitmq: - image: rabbitmq:3-management + image: rabbitmq:4-management container_name: osrd-rabbitmq-pr-tests ports: - "5673:5673" @@ -77,6 +77,7 @@ services: core: image: ghcr.io/openrailassociation/osrd-edge/osrd-core:${PR_NB} + platform: linux/x86_64 container_name: osrd-core-dummy-pr-tests restart: "no" command: "true" @@ -85,6 +86,7 @@ services: editoast: image: ghcr.io/openrailassociation/osrd-edge/osrd-editoast:${PR_NB} + platform: linux/x86_64 container_name: osrd-editoast-pr-tests depends_on: postgres: {condition: service_healthy} @@ -115,6 +117,7 @@ services: osrd-images: image: ghcr.io/openrailassociation/osrd-stable/osrd-images:${TAG_IMAGES-v1.0.0} + platform: linux/x86_64 container_name: osrd-images-pr-tests restart: unless-stopped environment: @@ -125,6 +128,7 @@ services: gateway: image: ghcr.io/openrailassociation/osrd-edge/osrd-gateway:${PR_NB}-front + platform: linux/x86_64 container_name: osrd-gateway-pr-tests volumes: - "../docker/gateway.pr-tests.simple.toml:/srv/gateway.toml" @@ -135,6 +139,7 @@ services: osrdyne: image: ghcr.io/openrailassociation/osrd-edge/osrd-osrdyne:${PR_NB} + platform: linux/x86_64 container_name: osrd-osrdyne-pr-tests depends_on: rabbitmq: {condition: service_healthy} diff --git a/scripts/cleanup-db.sh b/scripts/cleanup-db.sh index 9a2f35ced4e..c2e4704194a 100755 --- a/scripts/cleanup-db.sh +++ b/scripts/cleanup-db.sh @@ -18,12 +18,14 @@ fi OSRD_POSTGRES="osrd-postgres" OSRD_EDITOAST="osrd-editoast" OSRD_VALKEY="osrd-valkey" +OSRD_VALKEY_VOLUME="osrd_valkey_data" OSRD_POSTGRES_PORT=5432 OSRD_VALKEY_PORT=6379 if [ "$PR_TEST" -eq 1 ]; then OSRD_POSTGRES="osrd-postgres-pr-tests" OSRD_EDITOAST="osrd-editoast-pr-tests" OSRD_VALKEY="osrd-valkey-pr-tests" + OSRD_VALKEY_VOLUME="osrd-pr-tests_valkey_data" OSRD_POSTGRES_PORT=5433 OSRD_VALKEY_PORT=6380 fi @@ -71,7 +73,7 @@ docker exec "$OSRD_POSTGRES" psql -p "$OSRD_POSTGRES_PORT" -f //tmp/init.sql > / # Clear Valkey Cache echo "Deleting valkey cache..." -docker exec "$OSRD_VALKEY" valkey-cli -p "$OSRD_VALKEY_PORT" FLUSHALL > /dev/null 2>&1 || docker volume rm -f osrd_valkey_data > /dev/null +docker exec "$OSRD_VALKEY" valkey-cli -p "$OSRD_VALKEY_PORT" FLUSHALL > /dev/null 2>&1 || docker volume rm -f $OSRD_VALKEY_VOLUME > /dev/null echo "Cleanup done!\n" echo "You may want to apply migrations if you don't load a backup:" diff --git a/scripts/pr-infra-compose.sh b/scripts/pr-tests-compose.sh similarity index 82% rename from scripts/pr-infra-compose.sh rename to scripts/pr-tests-compose.sh index 2ed7c04a0f8..20cd474f7a5 100755 --- a/scripts/pr-infra-compose.sh +++ b/scripts/pr-tests-compose.sh @@ -7,6 +7,12 @@ set -e +# For Macos ARM chip users set a postgis image compiled to run on ARM, it makes their DB runs faster as their computer don't have to emulate x86_64's architecture. +case "$(uname -s)" in + Darwin*) export OSRD_POSTGIS_IMAGE='nickblah/postgis:16-postgis-3';; + *) :;; +esac + # Usage if { @@ -36,7 +42,7 @@ if [ "$2" = "up" ] || [ "$2" = "up-and-load-backup" ]; then docker compose \ -p "osrd-pr-tests" \ -f "docker/docker-compose.pr-tests.yml" \ - up -d postgres valkey + up --wait postgres -d # Load backup export PR_TEST=1