From b24358cc29d3678524ac89bdcd6e3f01bbdcf268 Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 03:39:14 +0800 Subject: [PATCH 1/9] Update Dockerfile and workflows to add MaiMBot-LPMM support Added MaiMBot-LPMM directory in Dockerfile and its repository clone step in the GitHub workflow. Upgraded compiler setup to use build-essential and included a CPU info check in the Dockerfile. --- .github/workflows/docker-image.yml | 3 +++ Dockerfile | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 76636d746..605d838ce 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -24,6 +24,9 @@ jobs: - name: Clone maim_message run: git clone https://github.com/MaiM-with-u/maim_message maim_message + - name: Clone lpmm + run: git clone https://github.com/MaiM-with-u/MaiMBot-LPMM.git MaiMBot-LPMM + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index 074711523..10b6b77fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,13 @@ WORKDIR /MaiMBot COPY requirements.txt . # 同级目录下需要有 maim_message COPY maim_message /maim_message +COPY MaiMBot-LPMM /MaiMBot-LPMM # 编译器 -RUN apt-get update && apt-get install -y g++ +RUN apt-get update && apt-get install -y build-essential + +# test +RUN cat /proc/cpuinfo | grep avx2 # 安装依赖 RUN uv pip install --system --upgrade pip From db7543dd8dcaa5aec721cc826c128205e9485f0c Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 03:40:03 +0800 Subject: [PATCH 2/9] =?UTF-8?q?test:=20test=E6=9F=A5=E7=9C=8Bcpu=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 10b6b77fb..6ef7070da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,7 @@ COPY MaiMBot-LPMM /MaiMBot-LPMM RUN apt-get update && apt-get install -y build-essential # test +RUN cat /proc/cpuinfo RUN cat /proc/cpuinfo | grep avx2 # 安装依赖 From c7aff644acde491e1428929d6980f1f8f8fec18b Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 04:01:57 +0800 Subject: [PATCH 3/9] =?UTF-8?q?test:=20test=E6=9F=A5=E7=9C=8Bcpu=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 ++- test_cpu.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test_cpu.py diff --git a/Dockerfile b/Dockerfile index 6ef7070da..39df23381 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,8 @@ RUN apt-get update && apt-get install -y build-essential # test RUN cat /proc/cpuinfo -RUN cat /proc/cpuinfo | grep avx2 +RUN uv pip install --system py-cpuinfo +RUN python test_cpu.py # 安装依赖 RUN uv pip install --system --upgrade pip diff --git a/test_cpu.py b/test_cpu.py new file mode 100644 index 000000000..befb40ec5 --- /dev/null +++ b/test_cpu.py @@ -0,0 +1,5 @@ +import cpuinfo + +cpu_info = cpuinfo.get_cpu_info() +print(f"当前cpu信息:{cpu_info}") +print(f"当前cpu指令集支持:{cpu_info["flags"]}") \ No newline at end of file From 380888a81a2cae11c0036db0b3c02713c94f7091 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 24 Apr 2025 20:02:19 +0000 Subject: [PATCH 4/9] =?UTF-8?q?=F0=9F=A4=96=20=E8=87=AA=E5=8A=A8=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_cpu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_cpu.py b/test_cpu.py index befb40ec5..84b3d2f5d 100644 --- a/test_cpu.py +++ b/test_cpu.py @@ -2,4 +2,4 @@ import cpuinfo cpu_info = cpuinfo.get_cpu_info() print(f"当前cpu信息:{cpu_info}") -print(f"当前cpu指令集支持:{cpu_info["flags"]}") \ No newline at end of file +print(f"当前cpu指令集支持:{cpu_info['flags']}") From 72212ebfe21f424a6eaf32ab7b05add3f51bea83 Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 04:04:34 +0800 Subject: [PATCH 5/9] =?UTF-8?q?test:=20test=E6=9F=A5=E7=9C=8Bcpu=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 39df23381..a9f84ccdc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ COPY requirements.txt . # 同级目录下需要有 maim_message COPY maim_message /maim_message COPY MaiMBot-LPMM /MaiMBot-LPMM +COPY test_cpu.py /test_cpu.py # 编译器 RUN apt-get update && apt-get install -y build-essential @@ -16,7 +17,7 @@ RUN apt-get update && apt-get install -y build-essential # test RUN cat /proc/cpuinfo RUN uv pip install --system py-cpuinfo -RUN python test_cpu.py +RUN python /test_cpu.py # 安装依赖 RUN uv pip install --system --upgrade pip From 4e222afacc321306243226fe97fdd92022f71e56 Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 04:31:50 +0800 Subject: [PATCH 6/9] =?UTF-8?q?test:=20test=E6=9F=A5=E7=9C=8Bcpu=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 2 +- Dockerfile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 605d838ce..3bd4a21bc 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -25,7 +25,7 @@ jobs: run: git clone https://github.com/MaiM-with-u/maim_message maim_message - name: Clone lpmm - run: git clone https://github.com/MaiM-with-u/MaiMBot-LPMM.git MaiMBot-LPMM + run: git clone https://github.com/infinitycat233/MaiMBot-LPMM.git MaiMBot-LPMM - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/Dockerfile b/Dockerfile index a9f84ccdc..24294125a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,9 @@ RUN apt-get update && apt-get install -y build-essential RUN cat /proc/cpuinfo RUN uv pip install --system py-cpuinfo RUN python /test_cpu.py +RUN cd /MaiMBot-LPMM && uv pip install --system -r requirements.txt +RUN cd /MaiMBot-LPMM/lib/quick_algo && python build_lib.py --cleanup --cythonize --install + # 安装依赖 RUN uv pip install --system --upgrade pip From 5e423a092eb782ed411d08f93970499fb887204f Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 04:34:54 +0800 Subject: [PATCH 7/9] =?UTF-8?q?test:=20test=E6=9F=A5=E7=9C=8Bcpu=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 24294125a..e055bf68f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apt-get update && apt-get install -y build-essential RUN cat /proc/cpuinfo RUN uv pip install --system py-cpuinfo RUN python /test_cpu.py -RUN cd /MaiMBot-LPMM && uv pip install --system -r requirements.txt +RUN cd /MaiMBot-LPMM && uv pip install --system -r requirements.txt && uv pip install --system Cython py-cpuinfo setuptools RUN cd /MaiMBot-LPMM/lib/quick_algo && python build_lib.py --cleanup --cythonize --install From f1414175f5b00745429b11d452b1f40c19b183da Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 06:33:40 +0800 Subject: [PATCH 8/9] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96dockerfile?= =?UTF-8?q?=EF=BC=8C=E5=88=A0=E9=99=A4test=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 15 ++++++--------- test_cpu.py | 5 ----- 2 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 test_cpu.py diff --git a/Dockerfile b/Dockerfile index e055bf68f..23165a23e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,25 +6,22 @@ WORKDIR /MaiMBot # 复制依赖列表 COPY requirements.txt . -# 同级目录下需要有 maim_message -COPY maim_message /maim_message +# 同级目录下需要有 maim_message MaiMBot-LPMM +#COPY maim_message /maim_message COPY MaiMBot-LPMM /MaiMBot-LPMM -COPY test_cpu.py /test_cpu.py # 编译器 RUN apt-get update && apt-get install -y build-essential -# test -RUN cat /proc/cpuinfo -RUN uv pip install --system py-cpuinfo -RUN python /test_cpu.py -RUN cd /MaiMBot-LPMM && uv pip install --system -r requirements.txt && uv pip install --system Cython py-cpuinfo setuptools +# lpmm编译安装 +RUN cd /MaiMBot-LPMM && uv pip install --system -r requirements.txt +RUN uv pip install --system Cython py-cpuinfo setuptools RUN cd /MaiMBot-LPMM/lib/quick_algo && python build_lib.py --cleanup --cythonize --install # 安装依赖 RUN uv pip install --system --upgrade pip -RUN uv pip install --system -e /maim_message +#RUN uv pip install --system -e /maim_message RUN uv pip install --system -r requirements.txt # 复制项目代码 diff --git a/test_cpu.py b/test_cpu.py deleted file mode 100644 index 84b3d2f5d..000000000 --- a/test_cpu.py +++ /dev/null @@ -1,5 +0,0 @@ -import cpuinfo - -cpu_info = cpuinfo.get_cpu_info() -print(f"当前cpu信息:{cpu_info}") -print(f"当前cpu指令集支持:{cpu_info['flags']}") From a2c94d3e8ef8f3b087360c43443fdc21ea72b69c Mon Sep 17 00:00:00 2001 From: infinitycat Date: Fri, 25 Apr 2025 13:27:35 +0800 Subject: [PATCH 9/9] =?UTF-8?q?perf:=20=E6=9B=B4=E6=96=B0clone=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 3bd4a21bc..605d838ce 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -25,7 +25,7 @@ jobs: run: git clone https://github.com/MaiM-with-u/maim_message maim_message - name: Clone lpmm - run: git clone https://github.com/infinitycat233/MaiMBot-LPMM.git MaiMBot-LPMM + run: git clone https://github.com/MaiM-with-u/MaiMBot-LPMM.git MaiMBot-LPMM - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3