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

orsdyne: add telemetry support #9440

Merged
merged 1 commit into from
Oct 24, 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
41 changes: 22 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ volumes:
valkey_data:
rabbitmq_data:


services:
postgres:
image: ${OSRD_POSTGIS_IMAGE:-postgis/postgis:16-3.4-alpine}
container_name: osrd-postgres
user: postgres
restart: unless-stopped
ports: ["5432:5432"]
ports: [ "5432:5432" ]
environment:
POSTGRES_PASSWORD: "password"
volumes:
- "psql_data:/var/lib/postgresql/data"
- "./docker/init_db.sql:/docker-entrypoint-initdb.d/init.sql"
healthcheck:
test: ["CMD", "pg_isready", "-d", "postgres://osrd:password@postgres/osrd"]
test: [ "CMD", "pg_isready", "-d", "postgres://osrd:password@postgres/osrd" ]
start_period: 4s
interval: 5s
retries: 20
Expand All @@ -27,13 +28,13 @@ services:
image: valkey/valkey:alpine
container_name: osrd-valkey
restart: unless-stopped
ports: ["6379:6379"]
ports: [ "6379:6379" ]
volumes:
- "valkey_data:/data"
- "./docker/valkey.conf:/etc/valkey.conf"
command: "valkey-server /etc/valkey.conf --save 30 1 --loglevel warning"
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
test: [ "CMD", "valkey-cli", "ping" ]
start_period: 4s
interval: 5s
retries: 20
Expand All @@ -51,7 +52,7 @@ services:
- "./docker/rabbitmq.conf:/etc/rabbitmq/conf.d/99-osrd.conf"
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
test: [ "CMD", "rabbitmqctl", "status" ]
interval: 5s
timeout: 5s
retries: 20
Expand All @@ -62,7 +63,7 @@ services:
image: ghcr.io/openrailassociation/osrd-edge/osrd-core:${TAG-dev}
container_name: osrd-core-dummy
depends_on:
rabbitmq: {condition: service_healthy}
rabbitmq: { condition: service_healthy }
build:
context: core
dockerfile: Dockerfile
Expand Down Expand Up @@ -93,15 +94,15 @@ services:
args:
OSRD_GIT_DESCRIBE: ${OSRD_GIT_DESCRIBE}
environment:
FRONT_PORT: 3000 # only useful with the prod config
FRONT_PORT: 3000 # only useful with the prod config
OSRD_EDITOAST_URL: /api
volumes:
- "./front:/app"
- "./tests/data:/tests/data"
restart: unless-stopped
ports: ["3000:3000"]
ports: [ "3000:3000" ]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
test: [ "CMD", "curl", "-f", "http://localhost:3000" ]
start_period: 4s
interval: 5s
retries: 6
Expand All @@ -110,9 +111,9 @@ services:
image: ghcr.io/openrailassociation/osrd-edge/osrd-editoast:${TAG-dev}
container_name: osrd-editoast
depends_on:
postgres: {condition: service_healthy}
valkey: {condition: service_healthy}
rabbitmq: {condition: service_healthy}
postgres: { condition: service_healthy }
valkey: { condition: service_healthy }
rabbitmq: { condition: service_healthy }
build:
context: editoast
dockerfile: Dockerfile
Expand All @@ -122,7 +123,7 @@ services:
args:
CARGO_PROFILE: dev
restart: unless-stopped
ports: ["8090:80"]
ports: [ "8090:80" ]
environment:
EDITOAST_PORT: 80
VALKEY_URL: "redis://valkey"
Expand All @@ -136,7 +137,7 @@ services:
- -c
- "diesel migration run && exec editoast runserver"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"]
test: [ "CMD", "curl", "-f", "http://localhost/health" ]
start_period: 4s
interval: 5s
retries: 6
Expand All @@ -153,21 +154,21 @@ services:
volumes:
- "./docker/gateway.dev.simple.toml:/gateway.toml"
restart: unless-stopped
ports: ["4000:4000"]
ports: [ "4000:4000" ]

osrd-images:
image: ghcr.io/openrailassociation/osrd-stable/osrd-images:${TAG_IMAGES-v1.0.0}
container_name: osrd-images
restart: unless-stopped
environment:
- NGINX_PORT=8080
ports: ["8080:8080"]
ports: [ "8080:8080" ]

osrdyne:
image: ghcr.io/openrailassociation/osrd-edge/osrd-osrdyne:${TAG-dev}
container_name: osrd-osrdyne
depends_on:
rabbitmq: {condition: service_healthy}
rabbitmq: { condition: service_healthy }
command: osrdyne
volumes:
- ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock
Expand All @@ -178,9 +179,11 @@ services:
args:
CARGO_PROFILE: dev
restart: unless-stopped
ports: ["4242:4242"]
ports: [ "4242:4242" ]
environment:
RUST_LOG: "info"
OSRDYNE__OPENTELEMETRY__ENDPOINT: "http://osrd-jaeger:4317"
OSRDYNE__OPENTELEMETRY__SERVICE_NAME: "osrdyne"

jaeger:
image: jaegertracing/all-in-one:latest
Expand All @@ -193,7 +196,7 @@ services:

wait-healthy:
depends_on:
editoast: {condition: service_healthy}
editoast: { condition: service_healthy }
restart: "no"
image: alpine:latest
command: "true"
1 change: 1 addition & 0 deletions docker/docker-compose.host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ services:
[ "CORE_EDITOAST_URL=http://127.0.0.1:8090", "JAVA_TOOL_OPTIONS=-javaagent:/app/opentelemetry-javaagent.jar", "CORE_MONITOR_TYPE=opentelemetry", "OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc", "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://127.0.0.1:4317", "OTEL_METRICS_EXPORTER=none", "OTEL_LOGS_EXPORTER=none" ]
OSRDYNE__AMQP_URI: "amqp://osrd:[email protected]:5672/%2f"
OSRDYNE__MANAGEMENT_URI: "http://osrd:[email protected]:15672/"
OSRDYNE__OPENTELEMETRY__ENDPOINT: "http://localhost:4317"

jaeger:
ports: []
Expand Down
32 changes: 17 additions & 15 deletions docker/docker-compose.pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ volumes:
valkey_data:
rabbitmq_data:


networks:
pr-tests:
name: osrd_pr_test
Expand All @@ -21,15 +22,15 @@ services:
container_name: osrd-postgres-pr-tests
user: postgres
restart: unless-stopped
ports: ["5433:5433"]
ports: [ "5433:5433" ]
environment:
POSTGRES_PASSWORD: "password"
command: -c port=5433
volumes:
- "psql_data:/var/lib/postgresql/data"
- "../docker/init_db.sql:/docker-entrypoint-initdb.d/init.sql"
healthcheck:
test: ["CMD", "pg_isready", "-d", "postgres://osrd:password@postgres:5433/osrd"]
test: [ "CMD", "pg_isready", "-d", "postgres://osrd:password@postgres:5433/osrd" ]
start_period: 4s
interval: 5s
retries: 20
Expand All @@ -40,13 +41,13 @@ services:
image: valkey/valkey:alpine
container_name: osrd-valkey-pr-tests
restart: unless-stopped
ports: ["6380:6380"]
ports: [ "6380:6380" ]
volumes:
- "valkey_data:/data"
- "../docker/valkey.conf:/etc/valkey.conf"
command: "valkey-server /etc/valkey.conf --port 6380 --save 30 1 --loglevel warning"
healthcheck:
test: ["CMD", "valkey-cli", "-p" , "6380", "ping"]
test: [ "CMD", "valkey-cli", "-p", "6380", "ping" ]
start_period: 4s
interval: 5s
retries: 20
Expand All @@ -68,7 +69,7 @@ services:
- rabbitmq_data:/var/lib/rabbitmq
- ../docker/rabbitmq-pr-tests.conf:/etc/rabbitmq/rabbitmq.conf
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
test: [ "CMD", "rabbitmqctl", "status" ]
interval: 5s
timeout: 5s
retries: 20
Expand All @@ -89,11 +90,11 @@ services:
platform: linux/x86_64
container_name: osrd-editoast-pr-tests
depends_on:
postgres: {condition: service_healthy}
valkey: {condition: service_healthy}
rabbitmq: {condition: service_healthy}
postgres: { condition: service_healthy }
valkey: { condition: service_healthy }
rabbitmq: { condition: service_healthy }
restart: unless-stopped
ports: ["8091:8091"]
ports: [ "8091:8091" ]
environment:
EDITOAST_PORT: 8091
ROOT_URL: "http://localhost:8091"
Expand All @@ -108,7 +109,7 @@ services:
- -c
- "diesel migration run && exec editoast runserver"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8091/health"]
test: [ "CMD", "curl", "-f", "http://localhost:8091/health" ]
start_period: 4s
interval: 5s
retries: 6
Expand All @@ -122,7 +123,7 @@ services:
restart: unless-stopped
environment:
- NGINX_PORT=8081
ports: ["8081:8081"]
ports: [ "8081:8081" ]
networks:
- pr-tests

Expand All @@ -133,7 +134,7 @@ services:
volumes:
- "../docker/gateway.pr-tests.simple.toml:/srv/gateway.toml"
restart: unless-stopped
ports: ["4001:4001"]
ports: [ "4001:4001" ]
networks:
- pr-tests

Expand All @@ -142,15 +143,16 @@ services:
platform: linux/x86_64
container_name: osrd-osrdyne-pr-tests
depends_on:
rabbitmq: {condition: service_healthy}
rabbitmq: { condition: service_healthy }
volumes:
- ${DOCKER_SOCKET:-/var/run/docker.sock}:/var/run/docker.sock
- ../docker/osrdyne-pr-tests.yml:/osrdyne.yml
command: osrdyne
restart: unless-stopped
ports: ["4243:4243"]
ports: [ "4243:4243" ]
environment:
OSRDYNE__WORKER_DRIVER__WORKER_IMAGE: "ghcr.io/openrailassociation/osrd-edge/osrd-core:${PR_NB}"
OSRDYNE__OPENTELEMETRY__ENDPOINT: "http://jaeger:4319"
RUST_LOG: "info"
networks:
- pr-tests
Expand All @@ -169,7 +171,7 @@ services:

wait-healthy:
depends_on:
editoast: {condition: service_healthy}
editoast: { condition: service_healthy }
restart: "no"
image: alpine:latest
command: "true"
Expand Down
Loading
Loading