Compare commits

...

25 Commits

Author SHA1 Message Date
somunslotus 182ad068e9 x86构建全流程调通 2025-10-23 15:36:16 +08:00
somunslotus ada2999646 arm和x86构建优化 2025-10-23 14:36:02 +08:00
somunslotus 252f6ae686 修改cpython的版本 2025-10-17 17:18:02 +08:00
somunslotus ca7fb84c81 修改cpython的版本 2025-10-17 16:38:20 +08:00
somunslotus c271e065b7 修改cpython的版本 2025-10-17 16:35:11 +08:00
somunslotus 49bda4e4ef 修改cpython的版本 2025-10-17 16:23:30 +08:00
somunslotus b1dc4c3020 修改cpython的版本 2025-10-17 16:20:09 +08:00
somunslotus 4d1de19a6d add dockerfile 2025-10-17 15:51:28 +08:00
somunslotus 14ca67c250 add dockerfile 2025-10-17 15:48:15 +08:00
somunslotus c2e11fa23d add dockerfile 2025-10-17 15:21:51 +08:00
somunslotus a8bebb06ed add dockerfile 2025-10-17 15:20:06 +08:00
somunslotus 0c23227dce add dockerfile 2025-10-17 15:13:06 +08:00
somunslotus 03788bf9bd add dockerfile 2025-10-17 15:11:33 +08:00
somunslotus af3186df75 add dockerfile 2025-10-17 15:10:11 +08:00
somunslotus 01cd18fa1b add dockerfile 2025-10-17 15:07:00 +08:00
somunslotus afac341379 修复dockerfile 2025-10-17 14:43:30 +08:00
somunslotus 89485d6634 修复基础镜像 2025-10-17 14:42:53 +08:00
somunslotus 0a0986936a 修复基础镜像 2025-10-17 14:26:06 +08:00
somunslotus 9a359ffb5f 修复基础镜像 2025-10-17 14:22:59 +08:00
somunslotus a6122c6e81 去掉python3.7操作 2025-10-17 13:48:39 +08:00
somunslotus be67edb960 更新dockerfile 2025-10-17 13:43:37 +08:00
somunslotus ab4478a682 增加基础镜像构建 2025-10-17 11:51:31 +08:00
somunslotus d3bcf5434a 增加基础镜像构建 2025-10-17 11:50:04 +08:00
somunslotus 8cf300adfb 增加基础镜像构建 2025-10-17 11:49:03 +08:00
somunslotus 7493b57ed5 增加x86镜像构建 2025-10-17 10:13:21 +08:00
31 changed files with 524 additions and 36 deletions

View File

@ -1,11 +1,5 @@
# 做镜像的方法
## ssh登录到172.20.32.186,密码和之前的一样
### x86构建进入docker/x86目录执行 x86-compile-and-build-image.sh
```
cd /home/deploy/script/aim-build
git pull
conda activate aim-build
cd docker
./build-image.sh
```
### arm构建 进入docker/arm目录执行 arm-compile-and-build-image.sh

View File

@ -1,7 +1,7 @@
FROM 172.20.32.187/pipeline-service/aimstack/aim:3.19.0-build-env
FROM 172.20.32.159/pipeline-service/aimstack/aim:3.19.0-build-env
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
COPY aim*.whl /opt/aim/
COPY ../aim*.whl /opt/aim/
RUN pip install /opt/aim/aim_ui-3.19.0-py3-none-any.whl
RUN pip install /opt/aim/aim-3.19.0-cp39-cp39-linux_aarch64.whl

View File

@ -44,7 +44,7 @@ echo "build aim-ui package success"
cd ../../../docker/
date=$(date +%Y%m%d%H%M)
image=172.20.32.187/pipeline-service/aimstack/aim:3.19.0-$date-arm
image=172.20.32.159/pipeline-service/aimstack/aim:3.19.0-$date-arm
docker build -t "$image" \
--build-arg "HTTP_PROXY=http://172.20.32.253:3128" \
--build-arg "HTTPS_PROXY=http://172.20.32.253:3128" \

View File

@ -6,11 +6,8 @@
date=$(date +%Y%m%d%H%M)
image=172.20.32.187/pipeline-service/aimstack/aim:3.19.0-$date-arm
docker build -t "$image" \
--build-arg "HTTP_PROXY=http://172.20.32.253:3128" \
--build-arg "HTTPS_PROXY=http://172.20.32.253:3128" \
-f Dockerfile.arm .
image=172.20.32.159/pipeline-service/aimstack/aim:3.19.0-$date-arm
docker build -t "$image" -f Dockerfile.arm .
if [ $? -ne 0 ]; then
echo "build image failed"

View File

@ -1,10 +1,10 @@
#!/bin/bash
# 切换到项目 UI 目录
cd ../aim/web/ui || { echo "错误:无法切换到 aim/web/ui 目录"; exit 1; }
cd ../../aim/web/ui || { echo "错误:无法切换到 aim/web/ui 目录"; exit 1; }
# 配置变量
IMAGE="172.20.32.187/pipeline-service/aimstack/aim:3.19.0-build-env"
IMAGE="172.20.32.159/pipeline-service/aimstack/aim:3.19.0-build-env"
CONTAINER_NAME="aim-ui-builder-$(date +%s)"
HOST_WORKDIR=$(pwd)
PROJECT_ROOT=$(dirname "$(dirname "$HOST_WORKDIR")") # 获取项目根目录
@ -35,11 +35,12 @@ docker run --rm \
fi;"
cp dist/aim_ui*.whl ../../../docker/; \
target_dir=../../../docker/arm
cp dist/aim_ui*.whl $target_dir; \
echo '生成的文件列表:'; \
ls -lh dist/*.whl; \
echo '输出到 docker 目录的文件:'; \
ls -lh ../../../docker/aim_ui*.whl; \
ls -lh $target_dir/*.whl; \
echo '== 构建完成 =='
# 检查构建结果
@ -47,7 +48,7 @@ if [ $? -eq 0 ]; then
echo "=== Aim UI 软件包构建成功 ==="
echo "生成的 wheel 文件已复制到: $DOCKER_DIR"
echo "文件列表:"
ls -lh "$DOCKER_DIR"/aim_ui*.whl
ls -lh $target_dir/aim_ui*.whl
else
echo "=== 构建失败,请检查错误信息 ===" >&2
exit 1

2
docker/arm-build-ui.sh → docker/arm/arm-build-ui.sh Executable file → Normal file
View File

@ -7,7 +7,7 @@
echo "build aim package success"
#编译前端代码
cd ../aim/web/ui
cd ../../aim/web/ui
if [ -d build ]; then
echo "rm build dir success"

10
docker/arm-build-whl.sh → docker/arm/arm-build-whl.sh Executable file → Normal file
View File

@ -2,12 +2,12 @@
#!/bin/bash
cd ../
cd ../../
# Aim 软件包构建脚本
# 使用 Docker 容器环境构建并复制 wheel 文件
# 配置变量
IMAGE="172.20.32.187/pipeline-service/aimstack/aim:3.19.0-build-env"
IMAGE="172.20.32.159/pipeline-service/aimstack/aim:3.19.0-build-env"
CONTAINER_NAME="aim-builder-$(date +%s)"
HOST_WORKDIR=$(pwd)
CONTAINER_WORKDIR="/code"
@ -33,14 +33,14 @@ docker run --rm \
fi; \
echo '构建成功'; \
echo '复制 wheel 文件到 docker 目录'; \
cp dist/aim*.whl docker/; \
cp dist/aim*.whl docker/arm/; \
echo '== 构建完成 =='"
# 检查构建结果
if [ $? -eq 0 ]; then
echo "=== Aim 软件包构建成功 ==="
echo "生成的 wheel 文件已复制到: $HOST_WORKDIR/docker/"
ls -lh "$HOST_WORKDIR/docker/aim"*.whl
echo "生成的 wheel 文件已复制到: $HOST_WORKDIR/docker/arm"
ls -lh "$HOST_WORKDIR/docker/arm/aim"*.whl
else
echo "=== 构建失败,请检查错误信息 ==="
exit 1

View File

View File

@ -0,0 +1,73 @@
#!/bin/bash
set -e
current_dir=$(pwd)
echo "开始 ARM 架构完整构建流程..."
start_time=$(date +%s)
# 准备环境
echo "=== 准备构建环境 ==="
env_start=$(date +%s)
source ../prepare-env.sh
env_end=$(date +%s)
env_duration=$((env_end - env_start))
echo "✅ 环境准备完成,耗时: ${env_duration}"
echo ""
cd "$current_dir"
# 构建 whl 包
echo "=== 构建 ARM whl 包 ==="
whl_start=$(date +%s)
source ./arm-build-whl.sh || { echo "❌ ARM whl 包构建失败"; exit 1; }
cd "$current_dir"
whl_end=$(date +%s)
whl_duration=$((whl_end - whl_start))
echo "✅ ARM whl 包构建完成,耗时: ${whl_duration}"
echo ""
# 构建 UI
echo "=== 构建 ARM UI ==="
ui_start=$(date +%s)
source ./arm-build-ui.sh || { echo "❌ ARM UI 构建失败"; exit 1; }
cd "$current_dir"
ui_end=$(date +%s)
ui_duration=$((ui_end - ui_start))
echo "✅ ARM UI 构建完成,耗时: ${ui_duration}"
echo ""
# 构建包含 UI 的 whl 包
echo "=== 构建包含 UI 的 ARM whl 包 ==="
ui_whl_start=$(date +%s)
source ./arm-build-ui-whl.sh || { echo "❌ ARM UI whl 包构建失败"; exit 1; }
cd "$current_dir"
ui_whl_end=$(date +%s)
ui_whl_duration=$((ui_whl_end - ui_whl_start))
echo "✅ ARM UI whl 包构建完成,耗时: ${ui_whl_duration}"
echo ""
# 构建 Docker 镜像
echo "=== 构建 ARM Docker 镜像 ==="
image_start=$(date +%s)
source ./arm-build-image.sh || { echo "❌ ARM Docker 镜像构建失败"; exit 1; }
cd "$current_dir"
image_end=$(date +%s)
image_duration=$((image_end - image_start))
echo "✅ ARM Docker 镜像构建完成,耗时: ${image_duration}"
echo ""
# 计算总耗时
end_time=$(date +%s)
total_duration=$((end_time - start_time))
echo "🎉 ARM 架构所有构建步骤完成!"
echo ""
echo "=== 构建耗时统计 ==="
echo "环境准备: ${env_duration}"
echo "whl 包构建: ${whl_duration}"
echo "UI 构建: ${ui_duration}"
echo "UI whl 包构建: ${ui_whl_duration}"
echo "Docker 镜像构建: ${image_duration}"
echo "------------------------"
echo "总耗时: ${total_duration}"

View File

@ -8,7 +8,7 @@ DOCKERFILE_PATH="." # Dockerfile 所在目录
date=$(date +%Y%m%d%H%M)
image=172.20.32.187/pipeline-service/aimstack/aim:3.19.0-build-env
image=172.20.32.159/pipeline-service/aimstack/aim:3.19.0-build-env
# 允许通过参数设置镜像标签

33
docker/base/Dockerfile Normal file
View File

@ -0,0 +1,33 @@
# ========== Dockerfile ==========
FROM ccr.ccs.tencentyun.com/somunslotus/ubuntu:22.04
ARG PY_VER=3.10
ENV DEBIAN_FRONTEND=noninteractive
# 切换到阿里云 Ubuntu 源
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list && \
sed -i 's|http://security.ubuntu.com/ubuntu/|http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list && \
apt-get clean && apt-get update
# 安装基础依赖
RUN apt-get install -y --no-install-recommends \
curl ca-certificates build-essential git software-properties-common vim && \
rm -rf /var/lib/apt/lists/*
# 安装 PythonUbuntu 22.04 自带 python3.10, 支持 python3.8~3.12
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python${PY_VER} python${PY_VER}-dev python${PY_VER}-venv python3-pip && \
rm -rf /var/lib/apt/lists/*
# 安装 pip确保最新
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PY_VER}
# 设置默认 Python 版本
RUN update-alternatives --install /usr/bin/python python /usr/bin/python${PY_VER} 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VER} 1
# 检查版本
RUN python3 --version && pip3 --version
WORKDIR /opt/app

View File

@ -0,0 +1,25 @@
# ---------- Python 3.8 + 清华源 ----------
FROM ccr.ccs.tencentyun.com/somunslotus/ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
# 切换为阿里云源HTTP
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list && \
sed -i 's|http://security.ubuntu.com/ubuntu/|http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list && \
apt-get clean && apt-get update
# 安装 Python 3.8(系统默认版本)及基本工具
RUN apt-get install -y --no-install-recommends \
python3.8 python3.8-venv python3.8-distutils python3-pip curl ca-certificates git vim build-essential && \
ln -sf /usr/bin/python3.8 /usr/bin/python && \
python -m pip install --upgrade pip && \
mkdir -p /root/.pip && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 验证 Python 与 pip 版本
RUN python --version && pip --version
CMD ["python3.8"]

View File

@ -0,0 +1,48 @@
# ---------- Python 3.9 + 清华源 ----------
FROM ccr.ccs.tencentyun.com/somunslotus/ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
# 切换为阿里云源HTTP
RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list && \
sed -i 's|http://security.ubuntu.com/ubuntu/|http://mirrors.aliyun.com/ubuntu/|g' /etc/apt/sources.list && \
apt-get clean && apt-get update
# 先移除系统自带的 Python 3.8(如果存在)
RUN apt-get remove -y python3.8 python3.8-minimal python3.8-venv python3.8-distutils 2>/dev/null || true
# 安装 Python 3.9 及相关开发包
RUN apt-get install -y --no-install-recommends \
software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt-get update && \
apt-get install -y --no-install-recommends \
python3.9 python3.9-venv python3.9-distutils python3.9-dev python3.9-full \
curl vim ca-certificates git build-essential && \
# 清理不再需要的包
apt-get remove -y software-properties-common && \
apt-get autoremove -y && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# 设置 Python 3.9 为默认版本
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1 && \
# 确保 pip 指向正确的 Python 版本
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.9 && \
ln -sf /usr/bin/python3.9 /usr/bin/python
# 配置 pip 使用清华源
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 验证 Python 与 pip 版本
RUN python --version && python3 --version && pip --version
# 验证所有 Python 相关命令都指向 3.9
RUN echo "Python commands check:" && \
ls -la /usr/bin/python* && \
echo "Python3 version:" && \
python3 -V && \
echo "Python version:" && \
python -V && \
echo "pip3 version:" && \
pip3 -V

17
docker/base/build.sh Normal file
View File

@ -0,0 +1,17 @@
#!/bin/bash
set -e
# 要构建的 Python 版本列表
VERSIONS=(3.8 3.9 3.10 3.11 3.12)
IMAGE_NAME="ccr.ccs.tencentyun.com/somunslotus/ubuntu"
for ver in "${VERSIONS[@]}"; do
echo "🚀 构建镜像: ${IMAGE_NAME}:2204-${ver}"
docker build \
--build-arg PY_VER=${ver} \
-t ${IMAGE_NAME}:${ver} \
.
done
echo "✅ 所有镜像构建完成!"
docker images | grep ${IMAGE_NAME}

View File

@ -27,8 +27,8 @@ if [ -d aim_ui/build ]; then
fi
docker run -v $(pwd):/code -w /code \
-e http_proxy=http://172.20.32.253:3128 -e https_proxy=http://172.20.32.253:3128 \
172.20.32.187/ci4s/node:16.16.0 /bin/sh -c "npm config set registry https://registry.npmmirror.com && npm install --legacy-peer-deps && npm run build"
-e http_proxy= -e https_proxy= \
172.20.32.159/ci4s/node:16.16.0 /bin/sh -c "npm config set registry https://registry.npmmirror.com && npm install --legacy-peer-deps && npm run build"
if [ $? -ne 0 ]; then
echo "build ui failed"
@ -51,7 +51,7 @@ echo "build aim-ui package success"
cd ../../../docker/
date=$(date +%Y%m%d%H%M)
image=172.20.32.187/pipeline-service/aimstack/aim:3.19.0-$date
image=172.20.32.159/pipeline-service/aimstack/aim:3.19.0-$date
docker build -t "$image" \
--build-arg "HTTP_PROXY=http://172.20.32.253:3128" \
--build-arg "HTTPS_PROXY=http://172.20.32.253:3128" \

6
docker/prepare-env.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bahs
cd ../../
find ./docker -name "*.sh" -exec chmod +x {} \;
find . -type f -not -path "./aim/web/ui/node_modules/*" -print0 | xargs -0 dos2unix

View File

@ -21,4 +21,5 @@ python-dateutil
requests
websockets
boto3
Cython==3.0.0a9
Cython==3.0.0

View File

@ -1,7 +1,8 @@
FROM 172.20.32.187/pipeline-service/python:3.9.10-slim
FROM 172.20.32.159/pipeline-service/python:3.9.10-slim
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
COPY aim*.whl /opt/aim/
COPY aim_ui-3.19.0-py3-none-any.whl /opt/aim/aim_ui-3.19.0-py3-none-any.whl
COPY aim-3.19.0-cp39-cp39-linux_x86_64.whl /opt/aim/aim-3.19.0-cp39-cp39-linux_x86_64.whl
RUN pip install /opt/aim/aim_ui-3.19.0-py3-none-any.whl
RUN pip install /opt/aim/aim-3.19.0-cp39-cp39-linux_x86_64.whl

View File

@ -0,0 +1,27 @@
FROM ccr.ccs.tencentyun.com/somunslotus/ubuntu:2004-python3.9
# 更新并安装编译工具
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
build-essential \
gcc \
g++ \
vim \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# 设置工作目录
WORKDIR /app
# 设置 pip 清华源
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 预先复制 requirements 文件(利用缓存层)
COPY ./requirements-new.txt /app/
# 安装 Python 依赖
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements-new.txt

View File

@ -0,0 +1,19 @@
#!/bin/bash
# Docker 构建脚本(带代理设置)
# 用法:./build.sh [镜像标签]
# 设置代理配置
DOCKERFILE_PATH="." # Dockerfile 所在目录
date=$(date +%Y%m%d%H%M)
image=172.20.32.159/pipeline-service/aimstack/aim:3.19.0-build-env-x86
# 允许通过参数设置镜像标签
# 构建命令
docker build \
-t $image \
-f Dockerfile-x86.build-env \
"${DOCKERFILE_PATH}"

View File

@ -0,0 +1,19 @@
#!/bin/bash
date=$(date +%Y%m%d%H%M)
image=172.20.32.159/pipeline-service/aimstack/aim:3.19.0-$date
docker build -t "$image" -f Dockerfile.x86 .
if [ $? -ne 0 ]; then
echo "build image failed"
exit 1
fi
echo "build image success"
docker push "$image"
if [ $? -ne 0 ]; then
echo "push image failed"
exit 1
fi
echo "build image success"

View File

@ -0,0 +1,55 @@
#!/bin/bash
# 切换到项目 UI 目录
cd ../../aim/web/ui || { echo "错误:无法切换到 aim/web/ui 目录"; exit 1; }
# 配置变量
IMAGE="172.20.32.159/pipeline-service/aimstack/aim:3.19.0-build-env-x86"
CONTAINER_NAME="aim-ui-builder-$(date +%s)"
HOST_WORKDIR=$(pwd)
PROJECT_ROOT=$(dirname "$(dirname "$HOST_WORKDIR")") # 获取项目根目录
DOCKER_DIR="$PROJECT_ROOT/docker" # docker 目录绝对路径
CONTAINER_WORKDIR="/code"
echo "=== 开始构建 Aim UI 软件包 ==="
echo "使用镜像: $IMAGE"
echo "主机工作目录: $HOST_WORKDIR"
echo "Docker 输出目录: $DOCKER_DIR"
echo "容器工作目录: $CONTAINER_WORKDIR"
# 确保 docker 目录存在
mkdir -p "$DOCKER_DIR"
# 启动容器并执行构建
docker run --rm \
--name "$CONTAINER_NAME" \
-v "$HOST_WORKDIR:$CONTAINER_WORKDIR" \
-v "$DOCKER_DIR:/docker_out" \
-w "$CONTAINER_WORKDIR" \
"$IMAGE" \
/bin/bash -c "\
echo '== 执行构建命令 =='; \
if ! python setup.py bdist_wheel; then \
echo '构建 Aim UI 软件包失败'; \
exit 1; \
fi;"
target_dir=../../../docker/x86
cp dist/aim_ui*.whl $target_dir; \
echo '生成的文件列表:'; \
ls -lh dist/*.whl; \
echo '输出到 docker 目录的文件:'; \
ls -lh $target_dir/aim_ui*.whl; \
echo '== 构建完成 =='
# 检查构建结果
if [ $? -eq 0 ]; then
echo "=== Aim UI 软件包构建成功 ==="
echo "生成的 wheel 文件已复制到: $DOCKER_DIR"
echo "文件列表:"
ls -lh $target_dir/aim_ui*.whl
else
echo "=== 构建失败,请检查错误信息 ===" >&2
exit 1
fi

View File

@ -0,0 +1,34 @@
#!/bin/bash
# 进入182服务器然后切换到conda activate aim-build环境进行构建
#构建aim 包
echo "build aim package success"
#编译前端代码
cd ../../aim/web/ui
if [ -d build ]; then
echo "rm build dir success"
rm -rf build/
fi
if [ -d aim_ui/build ]; then
echo "rm aim_ui/build dir success"
rm -rf aim_ui/build/
fi
docker run -v $(pwd):/code -w /code \
172.20.32.159/ci4s/node:16.16.0 /bin/sh -c "npm config set registry https://registry.npmmirror.com && npm install --legacy-peer-deps --verbose && npm run build"
if [ $? -ne 0 ]; then
echo "build ui failed"
exit 1
fi
mv -f build/ aim_ui/
echo "build ui success"

View File

@ -0,0 +1,47 @@
#!/bin/bash
#!/bin/bash
cd ../../
# Aim 软件包构建脚本
# 使用 Docker 容器环境构建并复制 wheel 文件
# 配置变量
IMAGE="172.20.32.159/pipeline-service/aimstack/aim:3.19.0-build-env-x86"
CONTAINER_NAME="aim-builder-$(date +%s)"
HOST_WORKDIR=$(pwd)
CONTAINER_WORKDIR="/code"
echo "=== 开始构建 Aim 软件包 ==="
echo "使用镜像: $IMAGE"
echo "主机工作目录: $HOST_WORKDIR"
echo "容器工作目录: $CONTAINER_WORKDIR"
# 启动容器并执行构建
docker run --rm \
--name $CONTAINER_NAME \
-v "$HOST_WORKDIR:$CONTAINER_WORKDIR" \
-w $CONTAINER_WORKDIR \
$IMAGE \
/bin/bash -c "\
echo '== 在容器中执行构建命令 =='; \
python setup.py bdist_wheel; \
BUILD_RESULT=\$?; \
if [ \$BUILD_RESULT -ne 0 ]; then \
echo '构建 Aim 软件包失败'; \
exit 1; \
fi; \
echo '构建成功'; \
echo '复制 wheel 文件到 docker 目录'; \
cp dist/aim*.whl docker/x86; \
echo '== 构建完成 =='"
# 检查构建结果
if [ $? -eq 0 ]; then
echo "=== Aim 软件包构建成功 ==="
echo "生成的 wheel 文件已复制到: $HOST_WORKDIR/docker/x86"
ls -lh "$HOST_WORKDIR/docker/x86/aim"*.whl
else
echo "=== 构建失败,请检查错误信息 ==="
exit 1
fi

View File

@ -0,0 +1,91 @@
#!/bin/bash
# build-all.sh
set -e
current_dir=$(pwd)
echo "开始完整构建流程..."
start_time=$(date +%s)
# 准备环境
echo "=== 准备构建环境 ==="
env_start=$(date +%s)
source ../prepare-env.sh
env_end=$(date +%s)
env_duration=$((env_end - env_start))
echo "✅ 环境准备完成,耗时: ${env_duration}"
echo ""
cd $current_dir
# 构建 whl 包
echo "=== 构建 server whl 包 ==="
whl_start=$(date +%s)
source ./x86-build-whl.sh
if [ $? -ne 0 ]; then
echo "❌ whl 包构建失败,停止构建"
exit 1
fi
cd $current_dir
whl_end=$(date +%s)
whl_duration=$((whl_end - whl_start))
echo "✅ whl 包构建完成,耗时: ${whl_duration}"
echo ""
cd $current_dir
# 构建 UI
echo "=== 编译 UI ==="
ui_start=$(date +%s)
source ./x86-build-ui.sh
if [ $? -ne 0 ]; then
echo "❌ UI 编译失败,停止构建"
exit 1
fi
cd $current_dir
ui_end=$(date +%s)
ui_duration=$((ui_end - ui_start))
echo "✅ UI 编译完成,耗时: ${ui_duration}"
echo ""
cd $current_dir
# 构建包含 UI 的 whl 包
echo "=== 构建包含 UI 的 whl 包 ==="
ui_whl_start=$(date +%s)
source ./x86-build-ui-whl.sh
if [ $? -ne 0 ]; then
echo "❌ UI whl 包构建失败,停止构建"
exit 1
fi
cd $current_dir
ui_whl_end=$(date +%s)
ui_whl_duration=$((ui_whl_end - ui_whl_start))
echo "✅ UI whl 包构建完成,耗时: ${ui_whl_duration}"
echo ""
cd $current_dir
# 构建 Docker 镜像
echo "=== 构建 Docker 镜像 ==="
image_start=$(date +%s)
source ./x86-build-image.sh
if [ $? -ne 0 ]; then
echo "❌ Docker 镜像构建失败"
exit 1
fi
cd $current_dir
image_end=$(date +%s)
image_duration=$((image_end - image_start))
echo "✅ Docker 镜像构建完成,耗时: ${image_duration}"
echo ""
# 计算总耗时
end_time=$(date +%s)
total_duration=$((end_time - start_time))
echo "🎉 所有构建步骤完成!"
echo ""
echo "=== 构建耗时统计 ==="
echo "环境准备: ${env_duration}"
echo "whl 包构建: ${whl_duration}"
echo "UI 编译: ${ui_duration}"
echo "UI whl 包构建: ${ui_whl_duration}"
echo "Docker 镜像构建: ${image_duration}"
echo "------------------------"
echo "总耗时: ${total_duration}"

View File

@ -21,4 +21,4 @@ python-dateutil
requests
websockets
boto3
Cython==3.0.0a9
Cython==3.0.0

View File

@ -45,7 +45,7 @@ readme_text = open('/'.join((here, readme_file)), encoding="utf-8").read()
LONG_DESCRIPTION = readme_text.strip()
SETUP_REQUIRED = [
'Cython==3.0.0a11',
'Cython==3.0.0',
]
# What packages are required for this module to be executed?