add 1424 ci #3
Workflow file for this run
This file contains 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: runs on 1424 | |
on: | |
workflow_dispatch: | |
# push: | |
# branches: | |
# - main | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
- ".github/ISSUE_TEMPLATE/**" | |
- ".git*" | |
- "CODE_OF_CONDUCT**" | |
concurrency: | |
group: sco-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
env: | |
NFS_PATH: '/mnt/cache/share/parrotsci/github/cibuild/${{ github.repository }}' | |
ENV_PATH: '/mnt/cache/share/platform/env' | |
ENV_NAME: 'pt2.0_diopi' | |
GPU_REQUESTS: 1 | |
SLURM_PAR_V100: ${{ vars.SLURM_PAR_SH1984 != '' && vars.SLURM_PAR_SH1984 || 'pat_dev' }} | |
CLUSTER_V100: SH1424 | |
BUILD_TEST1: build_test | |
BUILD_TEST2: build_test_dy | |
BUILD_TEST3: build_mmcv_ext | |
GEN_DATA: diopi_test/python/cache | |
ALL_COVERAGE: ${{ (contains( github.ref, 'main') || startsWith(github.ref, 'refs/heads/v') || startsWith(github.ref, 'refs/heads/dev')) && 'ON' || 'OFF' }} | |
REQUIRE_COVERAGE: ${{ vars.REQUIRE_COVERAGE != '' && vars.REQUIRE_COVERAGE || '0' }} | |
jobs: | |
checkout_code: | |
name: checkout code | |
runs-on: tps-diopi-ci | |
steps: | |
- name: Checkout Code | |
uses: DeepLink-org/DIOPI/.github/actions/checkout-code@main | |
with: | |
machine: 'SH1424' | |
working_path: '/mnt/cache/share/deeplinkci/github/${{ github.repository }}/${{ github.run_number }}' | |
lint: | |
name: lint | |
runs-on: tps-diopi-ci | |
needs: [checkout_code] | |
steps: | |
- name: lint | |
run: | | |
ssh ${CLUSTER_V100} """ | |
set -e | |
cd ${NFS_PATH}/ && ls -al && find ${NFS_PATH}/ -maxdepth 1 -mmin +300 -type d |xargs rm -rf | |
source ${ENV_PATH}/github_bashrc && source /mnt/cache/share/platform/env/${ENV_NAME} | |
cd ${NFS_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R source ${GITHUB_JOB} && cd ${GITHUB_JOB} | |
srun --job-name=${GITHUB_JOB} --partition=${SLURM_PAR_SH1988} --time=10 bash -c 'cd diopi_test && bash scripts/ci_script.sh py-lint \ | |
&& bash scripts/ci_script.sh cpp-lint && cd ../impl \ && bash scripts/ci_script.sh cpp-lint' \ | |
&& cd ${NFS_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} \ | |
|| ( cd ${NFS_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && exit 1 ) | |
Build-Nvidia: | |
name: Build-Nvidia | |
runs-on: tps-diopi-ci | |
needs: [checkout_code] | |
steps: | |
- name: build | |
run: | | |
ssh ${CLUSTER_V100} """ | |
set -e | |
export USE_COVERAGE=ON | |
source ${ENV_PATH}/github_bashrc && source /mnt/cache/share/platform/env/${ENV_NAME} | |
cd ${NFS_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${BUILD_TEST1} && cp -R source ${BUILD_TEST1} && cd ${BUILD_TEST1} | |
srun --job-name=${GITHUB_JOB} --partition=${SLURM_PAR_SH1988} --time=10 bash -c 'cd impl && bash scripts/build_impl.sh torch' || ( cd ${NFS_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${BUILD_TEST1} && exit 1 ) | |
""" | |
Gen-Data: | |
name: Gen-Data | |
runs-on: tps-diopi-ci | |
needs: [checkout_code,Build-Nvidia] | |
steps: | |
- name: gen-test-data | |
run: | | |
ssh ${CLUSTER_V100} """ | |
set -e | |
source ${ENV_PATH}/github_bashrc && source /mnt/cache/share/platform/env/${ENV_NAME} | |
cd ${NFS_PATH}/${GITHUB_RUN_NUMBER} && cd ${BUILD_TEST1} && cd diopi_test/python && ls && | |
srun --job-name=${GITHUB_JOB} --partition=${SLURM_PAR_SH1988} --time=10 --gres=gpu:${GPU_REQUESTS} bash -c 'python main.py --mode gen_data' \ | |
|| ( cd ${NFS_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1} && git clean -xdf ${GEN_DATA} && exit 1 ) | |
""" | |
Op-Test-Nvidia: | |
name: Op-Test-Nvidia | |
runs-on: tps-diopi-ci | |
needs: Gen-Data | |
if: ${{ contains( needs.Rsync.outputs.output, 'NV' ) }} | |
env: | |
run_test: "coverage run -p" | |
steps: | |
- name: NHWC-32bit-test | |
run: | | |
ssh ${CLUSTER_V100} """ | |
set -e | |
export USE_COVERAGE=ON | |
source ${ENV_PATH}/github_bashrc && source /mnt/cache/share/platform/env/${ENV_NAME} && cd ${NFS_PATH}/${GITHUB_RUN_NUMBER} && cd ${BUILD_TEST1} | |
srun --job-name=${GITHUB_JOB} --partition=${SLURM_PAR_SH1988} --time=20 --gres=gpu:${GPU_REQUESTS} bash -c 'cd diopi_test/python && python main.py --mode gen_case --fname batch_norm --nhwc && | |
python main.py --mode gen_case --fname index_select --four_bytes && python main.py --mode gen_case --fname arange --four_bytes && ${run_test} main.py --mode run_test' | |
if [ "${ALL_COVERAGE}" = "ON" ]; then | |
bash /mnt/cache/share/platform/dep/sonar/coverage_DIOPI_nv.sh ${NFS_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1} ${GITHUB_RUN_NUMBER} || echo "get coverage fail" | |
fi | |
""" | |
- name: test | |
run: | | |
ssh ${CLUSTER_V100} """ | |
set -e | |
source ${ENV_PATH}/github_bashrc && source /mnt/cache/share/platform/env/${ENV_NAME} && cd ${NFS_PATH}/${GITHUB_RUN_NUMBER} && cd ${BUILD_TEST1} | |
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${NFS_PATH}/${GITHUB_RUN_NUMBER}/${BUILD_TEST1}/impl/lib | |
echo \$LD_LIBRARY_PATH | |
srun --job-name=${GITHUB_JOB} --partition=${SLURM_PAR_SH1988} --time=20 --gres=gpu:${GPU_REQUESTS} bash -c 'cd diopi_test/python && python main.py --mode gen_case && | |
python main.py --mode run_test' | |
""" | |
- name: increment coverage check | |
if: ${{ contains( github.event_name, 'pull_request' ) && contains( github.base_ref, 'main' ) }} | |
run: | | |
ssh ${CLUSTER_V100} """ | |
set -e | |
source ${ENV_PATH}/github_bashrc && source /mnt/cache/share/platform/env/${ENV_NAME} && cd ${NFS_PATH}/${GITHUB_RUN_NUMBER} && cd ${BUILD_TEST1} | |
bash scripts/increment_coverage.sh ${REQUIRE_COVERAGE} |