-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.evaluation.yml
More file actions
76 lines (70 loc) · 2.33 KB
/
docker-compose.evaluation.yml
File metadata and controls
76 lines (70 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
version: "3.9"
services:
qdrant:
image: qdrant/qdrant:v1.9.2
container_name: qdrant
ports:
- "6333:6333"
volumes:
- qdrant_data:/qdrant/storage
mongo:
image: "mongo:6.0.8"
ports:
- "27018:27017"
environment:
- MONGO_INITDB_ROOT_USERNAME=root
- MONGO_INITDB_ROOT_PASSWORD=pass
healthcheck:
test: echo 'db.stats().ok' | mongosh localhost:27017/test --quiet
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
evaluation:
build:
context: .
dockerfile: Dockerfile
target: base
container_name: evaluation
depends_on:
- qdrant
- mongo
working_dir: /project
env_file:
- .env
environment:
- QDRANT_HOST=qdrant
- QDRANT_PORT=6333
- QDRANT_API_KEY=
- SUMMARY_SNAPSHOT_ARN=
- BASE_SNAPSHOT_ARN=
entrypoint: /bin/sh -c
command: >
"set -e;
echo Waiting for Qdrant...;
timeout 120 sh -c 'until wget -qO- http://qdrant:6333/collections >/dev/null; do echo Waiting for Qdrant...; sleep 3; done';
mkdir -p /project/snapshots;
to_s3_uri() { echo "$1" | sed -E 's#^arn:aws:s3:::(.*)#s3://\1#'; };
if [ -n \"$SUMMARY_SNAPSHOT_ARN\" ]; then \
echo Fetching summary snapshot from S3...; \
aws s3 cp \"$(to_s3_uri \"$SUMMARY_SNAPSHOT_ARN\")\" /project/snapshots/summary.snapshot; \
fi;
if [ -n \"$BASE_SNAPSHOT_ARN\" ]; then \
echo Fetching base snapshot from S3...; \
aws s3 cp \"$(to_s3_uri \"$BASE_SNAPSHOT_ARN\")\" /project/snapshots/base.snapshot; \
fi;
echo Restoring Qdrant snapshots if present...;
if [ -f /project/snapshots/summary.snapshot ]; then \
curl -sf -X POST http://qdrant:6333/collections/1234_4321_summary/snapshots/upload \
-F snapshot=@/project/snapshots/summary.snapshot; \
else echo 'No summary snapshot found, skipping restore.'; fi;
if [ -f /project/snapshots/base.snapshot ]; then \
curl -sf -X POST http://qdrant:6333/collections/1234_4321/snapshots/upload \
-F snapshot=@/project/snapshots/base.snapshot; \
else echo 'No base snapshot found, skipping restore.'; fi;
python evaluation/evaluation.py --community-id 1234 --platform-id 4321"
volumes:
- .:/project
restart: "no"
volumes:
qdrant_data: