已合并
add .devcontainer and .vscode #1474
zhugexun_sjtu创建于 4月8日
add .devcontainer and .vscode #1474
已合并
zhugexun_sjtu创建于 4月8日
zhugexun_sjtu
zhugexun_sjtu成员
4月8日

描述

为 AscendC NPU 内核开发新增 VS Code Dev Container 支持,使开发者可以一键启动标准化的开发环境。

主要内容:

  • .devcontainer/Dockerfile:基于 Ubuntu 24.04 的多阶段构建镜像

    • 使用 continuumio/miniconda3 多阶段提取 conda,自动适配 x86_64 / aarch64
    • 预装 Python 3.12 conda 环境(含 PyTorch 2.7.1 及 AscendC 所需依赖)
    • 预装 oh-my-zsh + zsh-autosuggestions + zsh-syntax-highlighting(via gitcode 镜像)
    • APT / conda / PyPI 镜像源均可通过 --build-arg 覆盖,默认使用国内加速源
    • 同时适配 arm64(ports.ubuntu.com)和 amd64(archive.ubuntu.com)的源替换
  • .devcontainer/devcontainer.json:NPU 开发容器运行配置

    • 使用 --runtime=runc 规避 ascend-docker-runtime 与 devcontainer 的冲突
    • 挂载宿主机 Ascend driver、add-ons、dcmi、npu-smi 等必要路径(只读)
    • ASCEND_VISIBLE_DEVICES=all 自动适配任意卡数
    • ccache volume 持久化,跨容器重建保留编译缓存
  • .devcontainer/environment-312.yml:Python 3.12 conda 环境依赖声明

  • .devcontainer/README.md:跨平台构建与使用说明,含镜像源覆盖示例、CANN 安装说明

  • .vscode/:VS Code 工作区基础配置

关联的Issue

测试

  • 在 aarch64 宿主机上完整构建镜像,验证 APT 源替换、conda 环境创建、oh-my-zsh 安装均正常
  • 通过 VS Code Dev Containers 扩展 Rebuild and Reopen 验证容器启动正常

文档更新

新增 .devcontainer/README.md,包含环境依赖、构建命令、镜像源配置、CANN 安装说明及 VS Code 使用步骤。

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 zhugexun_sjtu 的贡献)
zhugexun_sjtuzhugexun_sjtu成员
4月8日 创建了 pull request,commit 56eb48e9
CANN-robot
CANN-robot成员
4月8日 评论:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here
You can get sig-info at here


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-cann/asc-devkit zhanghao_0689, XuebinYang (2/2) zhanghao_0689, XuebinYang (2/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

xun_zhuge, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
CANN-robotCANN-robot成员
4月8日 将zengjuan,zhanghao_0689,yanqingshang,wulinyu,zhuliangying,kong0808,dengjing_aoe,YeZZzzz1,bluesky901,wqtshg_wt,yangbinhua,gao_dafa,chenyiyuan,ookkkkoo1122,bianque,houyuyang,shi_nanxiang,wuyang_hw,ascendhjh,DragonBornHD84,jiangZD设为评审人
CANN-robotCANN-robot成员
4月8日 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
4月8日 将zengjuan,zhanghao_0689,yanqingshang,wulinyu,zhuliangying,kong0808,dengjing_aoe,YeZZzzz1,bluesky901,wqtshg_wt,yangbinhua,gao_dafa,chenyiyuan,ookkkkoo1122,bianque,houyuyang,shi_nanxiang,wuyang_hw,ascendhjh,DragonBornHD84,jiangZD设为审查人
此处折叠了65条消息 查看更多
CANN-robot
CANN-robot成员
4月11日 评论:

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

likedislike
CANN-robotCANN-robot成员
4月11日 添加了label:lgtm
zhanghao_0689
zhanghao_0689成员
4月11日 评论:

/lgtm

likedislike
CANN-robot
CANN-robot成员
4月11日 评论:

Review Guide

This pull-request passes review.
Committers who wrote a comment of /approve are: XuebinYang, zhanghao_0689.
Reviewers who wrote a comment of /lgtm are: zhanghao_0689, XuebinYang.

likedislike
CANN-robotCANN-robot成员
4月11日 合入了pull request