Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # docker-compose.yml
This commit is contained in:
@@ -19,4 +19,4 @@ LABEL maintainer="zchengrong@yeah.net" \
|
||||
name="trinity_aida"
|
||||
|
||||
|
||||
CMD ["gunicorn", "-c", "gunicorn_config.py", "app.main:app"]
|
||||
CMD ["gunicorn", "-c", "gunicorn_config.py", "app.main:app" , "-e", "RABBITMQ_QUEUES=SuperResolution-dev"]
|
||||
@@ -2,13 +2,14 @@ import logging
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.core.config import RABBITMQ_QUEUES
|
||||
|
||||
logger = logging.getLogger()
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
|
||||
|
||||
@router.get("")
|
||||
def test():
|
||||
logger.info(RABBITMQ_QUEUES)
|
||||
logger.info("test")
|
||||
return {"message": "ok"}
|
||||
return {"message": RABBITMQ_QUEUES}
|
||||
|
||||
@@ -69,3 +69,5 @@ RABBITMQ_PARAMS = {
|
||||
"credentials": pika.credentials.PlainCredentials(username='rabbit', password='123456'),
|
||||
"virtual_host": "/"
|
||||
}
|
||||
|
||||
RABBITMQ_QUEUES = os.getenv("RABBITMQ_QUEUES", "SuperResolution-local")
|
||||
|
||||
@@ -16,7 +16,7 @@ import tritonclient.grpc as grpcclient
|
||||
from PIL import Image
|
||||
from minio import Minio
|
||||
|
||||
from app.core.config import MINIO_IP, MINIO_ACCESS, MINIO_SECRET, MINIO_SECURE, MINIO_PORT, REDIS_HOST, REDIS_PORT, REDIS_DB, SR_MODEL_NAME, RABBITMQ_PARAMS
|
||||
from app.core.config import MINIO_IP, MINIO_ACCESS, MINIO_SECRET, MINIO_SECURE, MINIO_PORT, REDIS_HOST, REDIS_PORT, REDIS_DB, SR_MODEL_NAME, RABBITMQ_PARAMS, RABBITMQ_QUEUES
|
||||
from app.schemas.super_resolution import SuperResolutionModel
|
||||
|
||||
from app.service.utils.decorator import RunTime
|
||||
@@ -136,7 +136,7 @@ def publish_message(sr_data):
|
||||
connection = pika.BlockingConnection(pika.ConnectionParameters(**RABBITMQ_PARAMS))
|
||||
channel = connection.channel()
|
||||
# 发布消息,并设置回调函数
|
||||
channel.basic_publish(exchange='', routing_key='SuperResolution-local', body=sr_data)
|
||||
channel.basic_publish(exchange='', routing_key=RABBITMQ_QUEUES, body=sr_data)
|
||||
logger.info(f" [x] Sent {sr_data}")
|
||||
connection.close()
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
version: "3"
|
||||
services:
|
||||
trinity_aida:
|
||||
build: .
|
||||
container_name: trinity_aida
|
||||
trinity_aida_dev:
|
||||
image: "trinity_client_aida_dev:latest"
|
||||
container_name: trinity_aida_dev
|
||||
volumes:
|
||||
- ./trinity_client_aida:/trinity
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user