Skip to content
Merged
10 changes: 10 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ S3_REGION=us-east-1
DB_UI_MAIL=dummy@pyronear.com
DB_UI_PWD=strong-password

# Temporal model validation gate (pyro-api PR #615).
# Empty = disabled (pyro-api fails open). `make run-temporal` auto-sets this to
# http://temporal_model_api:8000; set it here only to enable via other targets.
TEMPORAL_API_URL=
TEMPORAL_MODEL_THRESHOLD=0.45
# Shared bearer token for the temporal API. Empty = auth disabled on both the
# server (temporal_model_api) and the client (pyro-api). `make run-temporal`
# auto-sets a dev token; set the same value here to require auth on other targets.
TEMPORAL_API_TOKEN=

# only usefull to download some real sequences from real/distant Pyronear alert API
DISTANT_API_URL=''
DISTANT_ALERT_API_LOGIN=''
Expand Down
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ help:
@echo " run-tools-and-engine Start base services plus tools and engine profiles"
@echo " run-tools Start base services plus tools profile"
@echo " run Start base services plus front and tools profiles"
@echo " run-temporal Same as run (front + tools) plus temporal model API"
@echo " stop-temporal Stop only the temporal model API"
@echo " stop-engine Stop only engine services (engine + pyro_camera_api)"
@echo " restart-engine Restart engine services without re-running init_script"
@echo " stop Stop and remove all services and volumes"
Expand Down Expand Up @@ -70,14 +72,25 @@ run-tools:
run:
docker compose --profile front --profile tools up -d

# Same as `run` (front + tools) plus the temporal model API, with validation + auth enabled.
# Points pyro-api at the temporal service and shares a token with both.
# Override either: TEMPORAL_API_URL=... TEMPORAL_API_TOKEN=... make run-temporal
TEMPORAL_API_URL ?= http://temporal_model_api:8000
TEMPORAL_API_TOKEN ?= dev-temporal-token
run-temporal:
TEMPORAL_API_URL=$(TEMPORAL_API_URL) TEMPORAL_API_TOKEN=$(TEMPORAL_API_TOKEN) docker compose --profile front --profile tools --profile temporal up -d

stop-temporal:
docker compose --profile temporal stop temporal_model_api

stop-engine:
docker compose --profile engine stop engine pyro_camera_api

restart-engine: stop-engine
docker compose --profile engine up -d engine pyro_camera_api --no-deps

stop:
docker compose --profile front --profile engine --profile tools down -v
docker compose --profile front --profile engine --profile tools --profile temporal down -v

ps:
docker compose ps
Expand Down
2 changes: 1 addition & 1 deletion containers/init_script/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pandas
python-dotenv==1.0.1
python-dotenv==1.2.2
boto3==1.34.90
requests
pillow
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ services:
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_REGION=${S3_REGION}
- SERVER_NAME=${SERVER_NAME}
- PLATFORM_URL=${PLATFORM_URL:-http://0.0.0.0:8050}
- TEMPORAL_API_URL=${TEMPORAL_API_URL:-}
- TEMPORAL_MODEL_THRESHOLD=${TEMPORAL_MODEL_THRESHOLD:-0.45}
- TEMPORAL_API_TOKEN=${TEMPORAL_API_TOKEN:-}
healthcheck:
test: ["CMD-SHELL", "curl -X 'GET' 'http://pyro_api:5050/status' -H 'accept: application/json'"]
interval: 20s
Expand Down Expand Up @@ -91,6 +95,25 @@ services:
max-size: 100m
max-file: '5'

temporal_model_api:
container_name: temporal_model_api
image: pyronear/temporal-model-api:latest
profiles:
- temporal
ports:
- 8000:8000
environment:
# Bucket is supplied per request by pyro-api (per-org alert buckets).
- TEMPORAL_API_S3_ENDPOINT_URL=${S3_ENDPOINT_URL}
- TEMPORAL_API_S3_REGION=${S3_REGION}
- AWS_ACCESS_KEY_ID=${S3_ACCESS_KEY}
- AWS_SECRET_ACCESS_KEY=${S3_SECRET_KEY}
# Empty = auth disabled; set the same value as pyro-api to require a token.
- TEMPORAL_API_TOKEN=${TEMPORAL_API_TOKEN:-}
depends_on:
minio:
condition: service_healthy

etl_scripts:
container_name: etl
image: pyronear/pyro-etl:latest
Expand Down
4 changes: 2 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
psycopg2-binary==2.9.9
pytest==8.1.1
python-dotenv==1.0.1
pytest==9.0.3
python-dotenv==1.2.2
boto3==1.34.90
Loading