Deadlink CE #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deadlink CE | |
| on: | |
| schedule: | |
| - cron: "0 8 * * 6" # every Saturday at 6:00 AM | |
| workflow_dispatch: # allow to manually trigger the workflow | |
| concurrency: | |
| group: deadlink-${{ github.workflow }} | |
| cancel-in-progress: true | |
| env: | |
| COMMIT_ID: ${{ github.event.pull_request.head.sha }} | |
| TASK: PaddleFormers-CE-${{ github.event.pull_request.number }}-deadlink | |
| BRANCH: ${{ github.event.pull_request.base.ref }} | |
| CE_name: deadlink-ce | |
| no_proxy: "localhost,bj.bcebos.com,su.bcebos.com,bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn" | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| deadlink-ce: | |
| name: deadlink-ce | |
| if: github.ref == 'refs/heads/develop' | |
| runs-on: [self-hosted, paddleformers] | |
| steps: | |
| - name: Determine Image Name | |
| run: | | |
| echo "IMAGE_NAME=iregistry.baidu-int.com/paddlecloud/base-images:paddlecloud-ubuntu18.04-gcc8.2-cuda11.8-cudnn8.6-nccl2.15.5-latest" >> "$GITHUB_ENV" | |
| - name: Run Container | |
| env: | |
| work_dir: ${{ github.workspace }} | |
| FLAGS_dynamic_static_unified_comm: "True" | |
| python_version: "3.10" | |
| paddle_whl: https://paddle-qa.bj.bcebos.com/paddle-pipeline/Develop-GpuSome-LinuxCentos-Gcc82-Cuda118-Cudnn86-Trt85-Py310-CENN-Compile/latest/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl | |
| run: | | |
| container_name=${TASK}-$(date +%Y%m%d-%H%M%S) | |
| echo "container_name=${container_name}" >> "$GITHUB_ENV" | |
| docker run -d -t --name ${container_name} --net=host -v /dev/shm:/dev/shm --shm-size=32G \ | |
| -v $work_dir/../../..:$work_dir/../../.. \ | |
| -v $work_dir:/workspace \ | |
| -v /home/.cache/pip:/home/.cache/pip \ | |
| -e BRANCH \ | |
| -e COMMIT_ID \ | |
| -e work_dir \ | |
| -e ce_scripts \ | |
| -e no_proxy \ | |
| -e CE_name \ | |
| -e paddle_whl \ | |
| -e FLAGS_dynamic_static_unified_comm \ | |
| -e python_version \ | |
| -w /workspace --runtime=nvidia $IMAGE_NAME | |
| - name: Download Code | |
| run: | | |
| docker exec -t $container_name /bin/bash -c ' | |
| rm -rf * .[^.]* | |
| echo "Downloading PaddleFormers.tar" | |
| wget -q --no-proxy https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddleFormers.tar --no-check-certificate | |
| echo "Extracting PaddleFormers.tar" | |
| tar xf PaddleFormers.tar && rm -rf PaddleFormers.tar | |
| source $work_dir/../../../proxy | |
| cd PaddleFormers | |
| git config --global user.name "PaddleCE" | |
| git config --global user.email "[email protected]" | |
| git pull | |
| git submodule update --init --recursive --force | |
| git log --pretty=oneline -10 | |
| cd - | |
| echo "Downloading PaddleTest.tar" | |
| wget -q --no-proxy https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz --no-check-certificate | |
| tar xf PaddleTest.tar.gz | |
| cp -r PaddleTest/models/PaddleNLP/deadlink/* ./ | |
| ' | |
| - name: Test | |
| run: | | |
| docker exec -t $container_name /bin/bash -c ' | |
| ldconfig | |
| unlink /usr/bin/python3 | |
| ln -sf $(which python${python_version}) /usr/bin/python3 | |
| pip config set global.cache-dir "/home/.cache/pip" | |
| set -e | |
| python -m pip install beautifulsoup4 openpyxl | |
| source $work_dir/../../../proxy | |
| bash run.sh PaddleFormers develop [email protected] PaddleFormers死链检测汇总报告 | |
| ' | |
| - name: Upload Logs | |
| if: always() | |
| env: | |
| home_path: ${{ github.workspace }}/../../.. | |
| bos_file: ${{ github.workspace }}/../../../bos/BosClient.py | |
| run: | | |
| docker exec -t $container_name /bin/bash -c ' | |
| if [ ! -f "${{ env.bos_file }}" ]; then | |
| wget -q --no-proxy -O ${{ env.home_path }}/bos_new.tar.gz https://xly-devops.bj.bcebos.com/home/bos_new.tar.gz --no-check-certificate | |
| mkdir ${{ env.home_path }}/bos | |
| tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos | |
| fi | |
| bos_prefix="schedule/$(date +%Y%m%d)" | |
| cd /workspace/PaddleFormers/result | |
| for FILE in /workspace/PaddleFormers/result/*; do | |
| file=$(basename "$FILE") | |
| python ${{ env.bos_file }} $file paddle-github-action/PR/PaddleFormers/deadlink/${bos_prefix}/logs | |
| echo "$file: https://paddle-github-action.bj.bcebos.com/PR/PaddleFormers/deadlink/${bos_prefix}/logs/$file" | |
| done | |
| ' | |
| - name: Terminate And Delete the Container | |
| if: always() | |
| run: | | |
| docker rm -f $container_name 2>/dev/null || true |