-
Notifications
You must be signed in to change notification settings - Fork 6k
[WIP][CI] Enable DCU C++20 toolchain baseline #79421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
6959f42
4e922db
c0adfdb
e9adce2
35e05b9
ab2a559
7ccb519
dc37cc1
d9e3864
709a5ac
451581e
d563602
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,6 +77,7 @@ jobs: | |||||||||||||||
| GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||
| home_dir: ${{ github.workspace }}/../../../.. | ||||||||||||||||
| run: | | ||||||||||||||||
| docker ps -aq --filter "name=^/${TASK}-" | xargs -r docker rm -f | ||||||||||||||||
| container_name=${TASK}-$(date +%Y%m%d-%H%M%S) | ||||||||||||||||
| echo "container_name=${container_name}" >> ${{ github.env }} | ||||||||||||||||
| docker run --shm-size=128G \ | ||||||||||||||||
|
|
@@ -187,8 +188,9 @@ jobs: | |||||||||||||||
| - name: Terminate and delete the container | ||||||||||||||||
| if: always() | ||||||||||||||||
| run: | | ||||||||||||||||
| docker stop ${container_name} | ||||||||||||||||
| docker rm ${container_name} | ||||||||||||||||
| set -e | ||||||||||||||||
| docker exec -t "${container_name}" /bin/bash -c 'rm -rf * .[^.]*' | ||||||||||||||||
| docker rm -f "${container_name}" | ||||||||||||||||
|
|
||||||||||||||||
| test: | ||||||||||||||||
| name: Test | ||||||||||||||||
|
|
@@ -232,6 +234,7 @@ jobs: | |||||||||||||||
| GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||
| home_dir: ${{ github.workspace }}/../../../.. | ||||||||||||||||
| run: | | ||||||||||||||||
| docker ps -aq --filter "name=^/${TASK}-" | xargs -r docker rm -f | ||||||||||||||||
| container_name=${TASK}-$(date +%Y%m%d-%H%M%S) | ||||||||||||||||
| echo "container_name=${container_name}" >> ${{ github.env }} | ||||||||||||||||
| docker run --ulimit nofile=102400 --ulimit core=-1 --shm-size=32g -d -t --name ${container_name} \ | ||||||||||||||||
|
|
@@ -301,8 +304,6 @@ jobs: | |||||||||||||||
| - name: Terminate and delete the container | ||||||||||||||||
| if: always() | ||||||||||||||||
| run: | | ||||||||||||||||
| docker exec -t ${{ env.container_name }} /bin/bash -c ' | ||||||||||||||||
| rm -rf * .[^.]* | ||||||||||||||||
| ' | ||||||||||||||||
| docker stop ${container_name} | ||||||||||||||||
| docker rm ${container_name} | ||||||||||||||||
| set -e | ||||||||||||||||
| docker exec -t "${container_name}" /bin/bash -c 'rm -rf * .[^.]*' | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 建议 test job 这里也有同样的清理顺序问题: 建议和 build job 保持一致,先容忍/记录 workspace 清理失败,再保证执行 |
||||||||||||||||
| docker rm -f "${container_name}" | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
这里直接删容器会把 DCU test 的宿主机 workspace 留在原地:上面的 请保留有上限的 workspace 清理,再强制删除容器,避免清理卡住但仍清掉 bind mount 内容。例如恢复成:
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
这版已经恢复了 bind mount workspace 的清理,但当前写法仍不满足“清理有上限且最终强制删除容器”的要求: 请把 workspace 清理和强制删容器解耦:给 cleanup_status=0
timeout 10m docker exec -t "${container_name}" /bin/bash -c 'rm -rf * .[^.]*' || cleanup_status=$?
docker rm -f "${container_name}"
exit "${cleanup_status}"
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 补充 current head 也就是说,当前无上限的 cleanup step 实际占满了剩余 job 时间,已经复现了这里描述的问题。仍需要给 workspace 清理加 timeout,并确保无论清理结果如何都会执行
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
确认,这个 CI 结果已经把风险从理论路径变成了实际复现: 当前修复需要同时满足两点:给 workspace 清理设置有界 timeout,并且无论 cleanup_status=0
timeout 10m docker exec -t "${container_name}" /bin/bash -c 'rm -rf * .[^.]*' || cleanup_status=$?
docker rm -f "${container_name}"
exit "${cleanup_status}"
This comment was marked as outdated.
Sorry, something went wrong.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ShigureNyako 喵子来看一下这里原来为啥要
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里的 因此原来的
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里的 workspace 会在 github runner 结束的时候把数据删了吗 |
||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -109,9 +109,6 @@ jobs: | |||||||||||||
| for name in "${!docker_files[@]}" | ||||||||||||||
| do | ||||||||||||||
| md5_value=`md5sum tools/dockerfile/${docker_files[$name]} | awk '{print $1}'` | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
这里仍然只用 建议把
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
补充当前 head
This comment was marked as outdated.
Sorry, something went wrong.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
删除 请让 merge-mode 的 if [ "${{ inputs.is_merge }}" == "true" ]; then
mkdir -p tools/dockerfile/build_scripts
cd tools/dockerfile
wget -q --tries=5 --no-proxy \
${dockerfile_script} \
${dockerfile_origin} \
https://raw.githubusercontent.com/PaddlePaddle/Paddle/refs/heads/develop/tools/dockerfile/Dockerfile.develop.dtk \
--no-check-certificate
cd build_scripts
wget -q --tries=5 --no-proxy \
https://raw.githubusercontent.com/PaddlePaddle/Paddle/refs/heads/develop/tools/dockerfile/build_scripts/install_gcc.sh \
--no-check-certificate
cd ..
else
...
fi |
||||||||||||||
| if [ $name == "docker_dcu" ]; then | ||||||||||||||
| md5_value="76937a563116f6008c8ca4cb4f592759" | ||||||||||||||
| fi | ||||||||||||||
| if [ $name == "docker_npu" ]; then | ||||||||||||||
| md5_value="a3793bdeea5ae881a0c1eaf4d7c30c64" | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,15 +19,7 @@ | |
| # Stop at any error, show all commands | ||
| set -ex | ||
|
|
||
| if [ -f "/etc/redhat-release" ];then | ||
| lib_so_5=/usr/lib64/libgfortran.so.5 | ||
| lib_so_6=/usr/lib64/libstdc++.so.6 | ||
| lib_path=/usr/lib64 | ||
| else | ||
| lib_so_5=/usr/lib/x86_64-linux-gnu/libstdc++.so.5 | ||
| lib_so_6=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 | ||
| lib_path=/usr/lib/x86_64-linux-gnu | ||
| fi | ||
| # GCC is installed side-by-side. Callers select its runtime via LD_LIBRARY_PATH. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
这里把 在本次提交之前, 请同步修复 sed -i 's#PATH=/usr/local/gcc-8.2/bin:$PATH#PATH=/usr/local/gcc-12.1/bin:$PATH#g' ${dockerfile_name}
sed -i '/ENV PATH=\/usr\/local\/gcc-12.1\/bin:$PATH/a ENV LD_LIBRARY_PATH=/usr/local/gcc-12.1/lib64:/usr/local/gcc-12.1/lib:${LD_LIBRARY_PATH}' ${dockerfile_name}
This comment was marked as outdated.
Sorry, something went wrong. |
||
|
|
||
| if [ "$1" == "gcc82" ]; then | ||
| wget -q --no-proxy https://paddle-ci.gz.bcebos.com/gcc-8.2.0.tar.xz | ||
|
|
@@ -43,12 +35,6 @@ if [ "$1" == "gcc82" ]; then | |
| ../gcc-8.2.0/configure --prefix=/usr/local/gcc-8.2 --enable-threads=posix --disable-checking --disable-multilib && \ | ||
| make -j8 && make install | ||
| cd .. && rm -rf temp_gcc82 gcc-8.2.0 gcc-8.2.0.tar.xz | ||
| if [ -f "/etc/redhat-release" ];then | ||
| cp ${lib_so_6} ${lib_so_6}.bak && rm -f ${lib_so_6} && | ||
| ln -s /usr/local/gcc-8.2/lib64/libgfortran.so.5 ${lib_so_5} && \ | ||
| ln -s /usr/local/gcc-8.2/lib64/libstdc++.so.6 ${lib_so_6} && \ | ||
| cp /usr/local/gcc-8.2/lib64/libstdc++.so.6.0.25 ${lib_path} | ||
| fi | ||
| elif [ "$1" == "gcc122" ]; then | ||
| wget -q --no-proxy https://paddle-ci.gz.bcebos.com/gcc-12.2.0.tar.gz | ||
| tar -xzf gcc-12.2.0.tar.gz && \ | ||
|
|
@@ -59,9 +45,6 @@ elif [ "$1" == "gcc122" ]; then | |
| ../gcc-12.2.0/configure --prefix=/usr/local/gcc-12.2 --enable-checking=release --enable-languages=c,c++ --disable-multilib && \ | ||
| make -j8 && make install | ||
| cd .. && rm -rf temp_gcc122 gcc-12.2.0 gcc-12.2.0.tar.gz | ||
| cp ${lib_so_6} ${lib_so_6}.bak && rm -f ${lib_so_6} && | ||
| ln -s /usr/local/gcc-12.2/lib64/libstdc++.so.6 ${lib_so_6} && \ | ||
| cp /usr/local/gcc-12.2/lib64/libstdc++.so.6.0.30 ${lib_path} | ||
| elif [ "$1" == "gcc121" ]; then | ||
| wget -q --no-proxy https://paddle-ci.gz.bcebos.com/gcc-12.1.0.tar.gz | ||
| tar -xzf gcc-12.1.0.tar.gz && \ | ||
|
|
@@ -72,9 +55,6 @@ elif [ "$1" == "gcc121" ]; then | |
| ../gcc-12.1.0/configure --prefix=/usr/local/gcc-12.1 --enable-checking=release --enable-languages=c,c++ --disable-multilib && \ | ||
| make -j8 && make install | ||
| cd .. && rm -rf temp_gcc121 gcc-12.1.0 gcc-12.1.0.tar.gz | ||
| cp ${lib_so_6} ${lib_so_6}.bak && rm -f ${lib_so_6} && | ||
| ln -s /usr/local/gcc-12.1/lib64/libstdc++.so.6 ${lib_so_6} && \ | ||
| cp /usr/local/gcc-12.1/lib64/libstdc++.so.6.0.30 ${lib_path} | ||
| elif [ "$1" == "gcc152" ]; then | ||
| GCC_VERSION=${GCC_VERSION:-15.2.0} | ||
| GCC_MAJOR_MINOR=$(echo ${GCC_VERSION} | cut -d. -f1,2) | ||
|
|
@@ -89,8 +69,5 @@ elif [ "$1" == "gcc152" ]; then | |
| ../gcc-${GCC_VERSION}/configure --prefix=${GCC_PREFIX} --enable-checking=release --enable-languages=c,c++ --disable-multilib && \ | ||
| make -j$(nproc) && make install | ||
| cd .. && rm -rf temp_gcc152 gcc-${GCC_VERSION} ${GCC_ARCHIVE} | ||
| cp ${lib_so_6} ${lib_so_6}.bak && rm -f ${lib_so_6} && | ||
| ln -s ${GCC_PREFIX}/lib64/libstdc++.so.6 ${lib_so_6} && \ | ||
| cp ${GCC_PREFIX}/lib64/libstdc++.so.6.* ${lib_path} | ||
|
|
||
| fi | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 建议 这里在
set -e下先执行docker exec,一旦容器已经退出或 exec 失败,脚本会直接中断,后面的docker rm -f就不会执行。这会和本次改动想要强制清理遗留容器的目标相反,失败场景下仍会把容器留在 runner 上。建议恢复类似原来的兜底顺序:记录
docker exec的失败状态,但无论如何都先执行docker rm -f,最后再返回清理状态。