# config.py

import os

# Kafka配置
KAFKA_BROKER = "222.186.20.67:9092"
KAFKA_GROUP_ID_PREFIX = "group"

# Redis配置
REDIS_HOST = "222.186.20.67"
REDIS_PORT = 6379
REDIS_PASSWORD = "Obscura@2024"
MAIN_REDIS_DB = 30
REDIS_API_DB = 31
REDIS_API_USAGE_DB = 32
# 目录配置
UPLOAD_DIR = "/obscura/task/upload"
RESULT_DIR = "/obscura/task/result"

# 确保目录存在
os.makedirs(UPLOAD_DIR, exist_ok=True)
os.makedirs(RESULT_DIR, exist_ok=True)

# 各个worker的配置
WORKER_CONFIGS = {
    "yolo": {
        "kafka_topic": "yolo",
        "redis_db": 33,
    },
    "pose": {
        "kafka_topic": "pose",
        "redis_db": 34,
    },
    "qwenvl": {
        "kafka_topic": "qwenvl",
        "redis_db": 35,
    },
    "qwenvl_analyze": {
        "kafka_topic": "qwenvl_analyze",
        "redis_db": 36,
    },
    "cpm": {
        "kafka_topic": "cpm",
        "redis_db": 37,
    },
    "cpm_analyze": {
        "kafka_topic": "cpm_analyze",
        "redis_db": 38,
    },
    "fall": {
        "kafka_topic": "fall",
        "redis_db": 39,
    },
    "face": {
        "kafka_topic": "face",
        "redis_db": 40,
    },
    "mediapipe": {
        "kafka_topic": "mediapipe",
        "redis_db": 41,
    },
    "compare": {
        "kafka_topic": "compare",
        "redis_db": 42,
    }      
}

# GPU设置
CUDA_DEVICE_0 = "cuda:0"
CUDA_DEVICE_1 = "cuda:1"