From 5f645b5b4b074b1e34518df48229306db794eed4 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Tue, 19 Aug 2025 10:19:34 +0800 Subject: [PATCH 1/6] =?UTF-8?q?dev=E5=88=86=E6=94=AF=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile.dev | 33 +++++++++++++++++++++++++++++++++ docker-compose.dev.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 Dockerfile.dev create mode 100644 docker-compose.dev.yml diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..4a477f6 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,33 @@ +# 使用官方的paddle镜像作为基础 +FROM ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/paddlex:paddlex3.1.2-paddlepaddle3.0.0-gpu-cuda12.6-cudnn9.5-trt10.5 + +# 设置工作目录 +WORKDIR /app + +# 设置环境变量 +ENV PYTHONUNBUFFERED=1 \ + # 设置时区 + TZ=Asia/Shanghai \ + # 设置pip镜像地址,加快安装速度 + PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple + +# 安装language-pack-en和openssh-server +RUN apt update && \ + apt install -y language-pack-en && \ + apt install -y openssh-server + +# 配置SSH服务 +RUN mkdir /var/run/sshd && \ + # 设置root密码,可根据需要修改 + echo 'root:fcb0102' | chpasswd && \ + # 允许root登录SSH + sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config + +# 将当前目录内容复制到容器的/app内 +COPY . /app + +# 暴露22端口 +EXPOSE 22 + +# 启动SSH服务 +CMD ["/usr/sbin/sshd", "-D"] \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..a21c6f0 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,26 @@ +services: + fcb_ai_dev: + image: fcb_ai_dev:0.0.7 + build: + context: . + dockerfile: Dockerfile.dev + # 容器名称,可自定义 + container_name: fcb_ai_dev + hostname: fcb_ai_dev + # 始终重启容器 + restart: always + # 端口映射,根据需要修改主机端口 + ports: + - "8022:22" + # 数据卷映射,根据实际路径修改 + volumes: + - ./log:/app/log + - ./model:/app/model + # 启用GPU支持 + deploy: + resources: + reservations: + devices: + - device_ids: [ '0', '1' ] + capabilities: [ 'gpu' ] + driver: 'nvidia' \ No newline at end of file -- 2.49.1 From a99a615e22d9f0f350f6126c653244b9910f831a Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Tue, 19 Aug 2025 18:34:32 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E6=A1=88=E5=AD=90=E8=8C=83=E5=9B=B4=EF=BC=8C?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E6=AD=A3=E6=A8=A1=E5=9E=8B=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E5=AF=BC=E8=87=B4=E7=9A=84=E8=AF=86=E5=88=AB=E7=8E=87?= =?UTF-8?q?=E4=B8=8B=E9=99=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_review/auto_photo_review.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/photo_review/auto_photo_review.py b/photo_review/auto_photo_review.py index a0b4028..579fd25 100644 --- a/photo_review/auto_photo_review.py +++ b/photo_review/auto_photo_review.py @@ -541,9 +541,17 @@ def photo_review(pk_phhd): def main(): while 1: session = MysqlSession() + # phhds = (session.query(ZxPhhd.pk_phhd) + # .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) + # .filter(ZxPhhd.exsuccess_flag == "1") + # .filter(ZxPhrec.pk_phrec.isnot(None)) + # .order_by(ZxPhhd.priority_num.desc()) + # .distinct().limit(PHHD_BATCH_SIZE).all()) phhds = (session.query(ZxPhhd.pk_phhd) .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) - .filter(ZxPhhd.exsuccess_flag == "1") + .filter(ZxPhhd.exsuccess_flag == "9") + .filter(ZxPhhd.paint_flag == "0") + .filter(ZxPhhd.checktime > "2025-08-19 8:30") .filter(ZxPhrec.pk_phrec.isnot(None)) .order_by(ZxPhhd.priority_num.desc()) .distinct().limit(PHHD_BATCH_SIZE).all()) -- 2.49.1 From b6ae36a8eca5c31c1fbac39b4412803e79ec4b04 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Tue, 19 Aug 2025 19:07:29 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E6=A1=88=E5=AD=90=E8=8C=83=E5=9B=B4=EF=BC=8C?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E6=AD=A3=E6=A8=A1=E5=9E=8B=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E5=AF=BC=E8=87=B4=E7=9A=84=E8=AF=86=E5=88=AB=E7=8E=87?= =?UTF-8?q?=E4=B8=8B=E9=99=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_review/auto_photo_review.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/photo_review/auto_photo_review.py b/photo_review/auto_photo_review.py index 579fd25..155cb08 100644 --- a/photo_review/auto_photo_review.py +++ b/photo_review/auto_photo_review.py @@ -541,20 +541,23 @@ def photo_review(pk_phhd): def main(): while 1: session = MysqlSession() - # phhds = (session.query(ZxPhhd.pk_phhd) - # .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) - # .filter(ZxPhhd.exsuccess_flag == "1") - # .filter(ZxPhrec.pk_phrec.isnot(None)) - # .order_by(ZxPhhd.priority_num.desc()) - # .distinct().limit(PHHD_BATCH_SIZE).all()) phhds = (session.query(ZxPhhd.pk_phhd) .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) - .filter(ZxPhhd.exsuccess_flag == "9") - .filter(ZxPhhd.paint_flag == "0") - .filter(ZxPhhd.checktime > "2025-08-19 8:30") + .filter(ZxPhhd.exsuccess_flag == "1") .filter(ZxPhrec.pk_phrec.isnot(None)) .order_by(ZxPhhd.priority_num.desc()) .distinct().limit(PHHD_BATCH_SIZE).all()) + if not phhds: + # 临时调整修复,修复完成后可删除 + phhds = (session.query(ZxPhhd.pk_phhd) + .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) + .filter(ZxPhhd.exsuccess_flag == "9") + .filter(ZxPhhd.paint_flag == "0") + .filter(ZxPhhd.checktime > "2025-08-19 8:30") + .filter(ZxPhhd.checktime < "2025-08-19 18:48") + .filter(ZxPhrec.pk_phrec.isnot(None)) + .order_by(ZxPhhd.priority_num.desc()) + .distinct().limit(PHHD_BATCH_SIZE).all()) # 将状态改为正在识别中 pk_phhd_values = [phhd.pk_phhd for phhd in phhds] update_flag = (update(ZxPhhd).where(ZxPhhd.pk_phhd.in_(pk_phhd_values)).values(exsuccess_flag="2")) -- 2.49.1 From e3fd3f618f4c78cb92d774bb909852b04bd506ce Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Tue, 19 Aug 2025 19:10:12 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC1.15.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4b8e985..03e6239 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ x-env: &template - image: fcb_photo_review:1.15.4 + image: fcb_photo_review:1.15.5 restart: always x-review: -- 2.49.1 From a6515e971b9df60897dcbb49c785a113014a356f Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Wed, 20 Aug 2025 09:42:35 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=9A=84=E6=A1=88=E5=AD=90=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- photo_review/auto_photo_review.py | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 03e6239..3ddea28 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ x-env: &template - image: fcb_photo_review:1.15.5 + image: fcb_photo_review:1.15.6 restart: always x-review: diff --git a/photo_review/auto_photo_review.py b/photo_review/auto_photo_review.py index 155cb08..a0b4028 100644 --- a/photo_review/auto_photo_review.py +++ b/photo_review/auto_photo_review.py @@ -547,17 +547,6 @@ def main(): .filter(ZxPhrec.pk_phrec.isnot(None)) .order_by(ZxPhhd.priority_num.desc()) .distinct().limit(PHHD_BATCH_SIZE).all()) - if not phhds: - # 临时调整修复,修复完成后可删除 - phhds = (session.query(ZxPhhd.pk_phhd) - .join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True) - .filter(ZxPhhd.exsuccess_flag == "9") - .filter(ZxPhhd.paint_flag == "0") - .filter(ZxPhhd.checktime > "2025-08-19 8:30") - .filter(ZxPhhd.checktime < "2025-08-19 18:48") - .filter(ZxPhrec.pk_phrec.isnot(None)) - .order_by(ZxPhhd.priority_num.desc()) - .distinct().limit(PHHD_BATCH_SIZE).all()) # 将状态改为正在识别中 pk_phhd_values = [phhd.pk_phhd for phhd in phhds] update_flag = (update(ZxPhhd).where(ZxPhhd.pk_phhd.in_(pk_phhd_values)).values(exsuccess_flag="2")) -- 2.49.1 From 1e8ef432df0cd54d8de154ca7a93ed539fa9f20a Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Wed, 20 Aug 2025 10:55:25 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=AD=A3ie=E8=A1=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E4=BF=AE=E6=94=B9=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- photo_review/auto_photo_review.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3ddea28..e50fc9b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ x-env: &template - image: fcb_photo_review:1.15.6 + image: fcb_photo_review:1.15.7 restart: always x-review: diff --git a/photo_review/auto_photo_review.py b/photo_review/auto_photo_review.py index a0b4028..fc0a974 100644 --- a/photo_review/auto_photo_review.py +++ b/photo_review/auto_photo_review.py @@ -320,7 +320,7 @@ def save_or_update_ie(table, pk_phhd, data): if db_data: # 更新 db_data.update_time = now - db_data.creator = HOSTNAME + db_data.updater = HOSTNAME for k, v in data.items(): setattr(db_data, k, v) else: -- 2.49.1