mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 11:36:32 +00:00
be4cab4fcb
- Added `/detect/video` endpoint for true streaming video detection, allowing inference to start as upload bytes arrive. - Introduced `run_detect_video_stream` method in the inference module to handle video processing from a file-like object. - Updated media hashing to include a new function for computing hashes directly from files with minimal I/O. - Enhanced documentation to reflect changes in video processing and API behavior. Made-with: Cursor
1.8 KiB
1.8 KiB
Deployment Scripts
All scripts are in scripts/ at the project root. Each script is POSIX-compatible (bash with set -euo pipefail), sources .env from the project root, and supports --help.
Script Reference
| Script | Purpose | Key Env Vars |
|---|---|---|
deploy.sh |
Orchestrates full deployment | REGISTRY, IMAGE_TAG, DEPLOY_HOST, DEPLOY_USER |
pull-images.sh |
Pulls Docker images from registry | REGISTRY, IMAGE_TAG |
start-services.sh |
Starts the detections container | REGISTRY, IMAGE_TAG, LOADER_URL, ANNOTATIONS_URL |
stop-services.sh |
Gracefully stops and removes container | — |
health-check.sh |
Verifies /health endpoint |
HEALTH_CHECK_HOST, HEALTH_CHECK_PORT |
Usage
Full Deployment
REGISTRY=registry.example.com IMAGE_TAG=a1b2c3d bash scripts/deploy.sh
Remote Deployment (via SSH)
REGISTRY=registry.example.com \
IMAGE_TAG=a1b2c3d \
DEPLOY_HOST=production-server.example.com \
DEPLOY_USER=deploy \
bash scripts/deploy.sh
Rollback
bash scripts/deploy.sh --rollback
Redeploys the previous image tag (saved in .deploy-previous-tag by stop-services.sh).
Local Development
docker compose -f docker-compose.yml up
Or using the e2e compose for testing:
cd e2e && COMPOSE_PROFILES=cpu docker compose -f docker-compose.test.yml up --build
Deployment Flow
deploy.sh
├── pull-images.sh → docker pull
├── stop-services.sh → docker stop (30s grace) + save previous tag
├── start-services.sh → docker run
└── health-check.sh → curl /health (10 retries, 3s interval)
Environment Variables
All scripts source .env from the project root if it exists. Variables can also be passed directly via the environment. See .env.example for the full list.