已合并
feat: add ci image build script and optimize image build process #4858
wxy1105创建于 7月25日
feat: add ci image build script and optimize image build process #4858
已合并
Pull Request已成功合入, 合并人@ascend-robot
(感谢 wxy1105 的贡献)atomgit-bot
7月25日 评论:
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_CONDA、PATH=/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,并在构建信息中展示。


ascend-robot
7月25日 评论:
7月25日 评论:
atomgit-bot
7月25日 评论:
7月25日 评论:
7月25日 添加了label:stat/needs-squash
此处折叠了76条消息 查看更多
ascend-robot
29 天前 评论:
29 天前 评论:
The following users do not have permission to comment /lgtm or /approve on any module in this PR:
Rostellaria


29 天前 添加了label:approved
29 天前 合入了pull request
ascend-robot
29 天前 评论:
29 天前 评论:
Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


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 .