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

Small fixes and improvement for mac users on the docker pr-test file and script #9343

Merged
merged 5 commits into from
Oct 21, 2024
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
7 changes: 6 additions & 1 deletion docker/docker-compose.pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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}
Expand Down Expand Up @@ -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:
Expand All @@ -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"
Expand All @@ -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}
Expand Down
4 changes: 3 additions & 1 deletion scripts/cleanup-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
Loading