已合并
feat: add ci image build script and optimize image build process #4858
feat: add ci image build script and optimize image build process #4858
已合并
wxy1105创建于 7月25日
wxy1105
wxy1105成员
7月25日

What this PR does / why we need it?

Enhances Docker image build stability and usability: adds multiple pip mirrors, Git retry mechanism, Ascend environment auto-load, removes FSDPTurbo branch restriction, and updates documentation.

Does this PR introduce any user-facing change?

Yes : More stable builds, auto-loaded environment variables, new build parameters ,documentation updated at OVERVIEW.md and OVERVIEW.zh.md .

How was this patch tested?

Run bash image_build.sh -t a3 -n --cleanup-on-fail to build image, start container to verify Ascend env vars and pip config, CI tested via bash ci/build_ci_envs.sh .

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 wxy1105 的贡献)
wxy1105wxy1105成员
7月25日 创建了 pull request,commit eba2a5b2
atomgit-bot
atomgit-bot
7月25日 评论:

变更摘要

此 PR 主要优化了 Docker 镜像构建流程,提升构建稳定性和可用性。核心改动包括:新增 CI 环境构建脚本 ci/build_ci_envs.sh 用于自动化流水线;移除 Dockerfile 中的 Miniconda 安装,改为直接使用系统 Python;配置多个 pip 镜像源以加速下载;新增 Triton-Ascend 和 FSDPTurbo 的安装步骤;将容器启动时自动加载的环境变量从 Conda 切换为 Ascend 工具链;以及为 image_build.sh 新增 --triton-ascend-version 构建参数。

主要改动

  • 新增 CI 构建脚本 ci/build_ci_envs.sh:封装 image_build.sh,预设 CANN 基础镜像、PyTorch/Torch-NPU/Triton-Ascend 版本、MindSpeed/Megatron 分支等参数,支持 CI 流水线一键构建镜像。
  • 移除 Miniconda,直接使用系统 Python:Dockerfile 中删除了 Miniconda 下载安装及 Conda 环境变量(CONDA_AUTO_UPDATE_CONDAPATH=/opt/conda/bin:$PATH),pip 和 python 改为依赖基础镜像自带的系统环境。
  • 多 pip 镜像源与 Triton-Ascend/FSDPTurbo 安装:pip 配置从单一华为云镜像扩展为包含阿里云、豆瓣、清华等多镜像的 extra-index-url;新增 TRITON_ASCEND_VERSION 构建参数并安装 triton-ascend;新增 FSDPTurbo 仓库克隆与安装步骤。
  • 容器环境自动加载切换为 Ascend 工具链.bashrc 中移除了 Conda 激活逻辑,改为自动 source /usr/local/Ascend/ascend-toolkit/set_env.sh/usr/local/Ascend/nnal/atb/set_env.sh,保留 ASCEND_TOOLKIT_HOME 环境变量。
  • image_build.sh 新增 --triton-ascend-version 参数:默认值为 3.2.1,通过 --build-arg 传递给 Dockerfile 中的 TRITON_ASCEND_VERSION,并在构建信息中展示。
likedislike
atomgit-bot
atomgit-bot
7月25日 评论:

代码审查

Let me now analyze each file systematically.

File 1: ci/build_ci_envs.sh

This is a new file. Let me check for issues:

  1. Line 25: TRITON_ASCEND_VERSION=3.2.0 — but in the Dockerfile default is 3.2.1 (line 93). The CI script uses `
类型 数量
🔴 阻塞 0
🟡 建议 3

💬 仅评论

likedislike
ascend-robotascend-robot成员
7月25日 添加了label:stat/needs-squash
此处折叠了76条消息 查看更多
LinShua成员
29 天前 评论:

/approve

likedislike
ascend-robot
ascend-robot成员
29 天前 评论:

The following users do not have permission to comment /lgtm or /approve on any module in this PR:
Rostellaria

likedislike
ascend-robotascend-robot成员
29 天前 添加了label:approved
ascend-robotascend-robot成员
29 天前 合入了pull request
ascend-robot
ascend-robot成员
29 天前 评论:

Pull Request 已合并或已关闭。

If you want to solve this problem, you can click here to do it in the FAQs.

likedislike