diff --git a/Dockerfile b/Dockerfile index 846906a..2e3d260 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,11 @@ # ====================== FROM python:3.10.16-slim AS builder -RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources \ - && sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources +# 使用清华源(Debian 12 Bookworm) +RUN printf "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware\n\ +deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware\n\ +deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware\n" \ +> /etc/apt/sources.list RUN apt-get update \ && apt-get install -y --no-install-recommends \ @@ -23,10 +26,13 @@ RUN pip install --no-cache-dir --prefix=/python_install \ # ====================== FROM python:3.10.16-slim -RUN sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources \ - && sed -i 's|security.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources +# 使用清华源(HTTPS) +RUN printf "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware\n\ +deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware\n\ +deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware\n" \ +> /etc/apt/sources.list -# ⭐ pyodbc 运行必须安装 libodbc1(提供 libodbc.so.2) +# pyodbc 必须安装 libodbc1(提供 libodbc.so.2) RUN apt-get update \ && apt-get install -y --no-install-recommends \ libodbc1 unixodbc \ diff --git a/PCA_Test.py b/PCA_Test.py index fde9b82..b60b0f8 100644 --- a/PCA_Test.py +++ b/PCA_Test.py @@ -189,13 +189,13 @@ class MySQL: self.conn.close() def get_model_by_ID(model_id, version="v-test"): ms = MySQL(host=config._SQL_IP, user="root", pwd="powerSIS#123", database="alert") - resList = ms.ExecQuery(f"SELECT Model_info FROM model_cfg where id={model_id}") + resList = ms.ExecQuery(f"SELECT Model_info FROM model_cfg where model_id={model_id}") return json.loads(resList[0][0]) def get_model_by_id_and_version(model_id, version): ms = MySQL(host=config._SQL_IP, user="root", pwd="powerSIS#123", database="alert") - resList = ms.ExecQuery(f"SELECT Model_info FROM model_version where id={model_id} and version='{version}'") + resList = ms.ExecQuery(f"SELECT Model_info FROM model_version where model_id={model_id} and version='{version}'") return json.loads(resList[0][0]) def pca(model, Data_origin):