已合并
[fix] action流水线切换至CCE #4685
tanghaoran创建于 13 天前
[fix] action流水线切换至CCE #4685
已合并
共 7 个文件变更+53-292
| @@ -12,8 +12,7 @@ | |||
| 12 | set +e | 12 | set +e |
| 13 | 13 | ||
| 14 | echo "start run test case, please wait ..." | 14 | echo "start run test case, please wait ..." |
| 15 | -cd /home/taskspace | 15 | +cd ${WORKSPACE} |
| 16 | -WORKSPACE=/home/taskspace | ||
| 17 | 16 | ||
| 18 | log() { | 17 | log() { |
| 19 | local dt | 18 | local dt |
| @@ -69,11 +68,6 @@ mkdir -p /root/ascend | |||
| 69 | slog_name="slog.tar.gz" | 68 | slog_name="slog.tar.gz" |
| 70 | tar -zcf "${slog_name}" -C /root/ascend log | 69 | tar -zcf "${slog_name}" -C /root/ascend log |
| 71 | 70 | ||
| 72 | -# upload plog | ||
| 73 | -if python3 /home/upload.py --bucket-name "ascend-ci" --action upload --local-file "slog.tar.gz" --obs-object-key "${obs_path}/${slog_name}"; then | ||
| 74 | - echo "::set-output var=plog_url:https://ascend-ci.obs.cn-north-4.myhuaweicloud.com/${obs_path}/slog.tar.gz" | ||
| 75 | -fi | ||
| 76 | - | ||
| 77 | # ============================== | 71 | # ============================== |
| 78 | # 检查 NPU 状态 | 72 | # 检查 NPU 状态 |
| 79 | # ============================== | 73 | # ============================== |
| @@ -1,170 +0,0 @@ | |||
| 1 | -name: codecheck_action | ||
| 2 | - | ||
| 3 | -on: | ||
| 4 | - workflow_call: | ||
| 5 | - inputs: | ||
| 6 | - precommit_image_version: | ||
| 7 | - required: true | ||
| 8 | - type: string | ||
| 9 | - codecheck_image_version: | ||
| 10 | - required: true | ||
| 11 | - type: string | ||
| 12 | - | ||
| 13 | - | ||
| 14 | -jobs: | ||
| 15 | - JOB_precommit: | ||
| 16 | - name: CodeCheck_precommit | ||
| 17 | - steps: | ||
| 18 | - - | ||
| 19 | - name: Checkout | ||
| 20 | - identifier: process_checkout | ||
| 21 | - uses: checkout | ||
| 22 | - with: | ||
| 23 | - ref: ${{ atomgit.event.pull_request.merge_commit_sha }} | ||
| 24 | - token: ${{secrets.GIT_TOKEN}} | ||
| 25 | - - | ||
| 26 | - name: download | ||
| 27 | - uses: obs-download | ||
| 28 | - with: | ||
| 29 | - endpoint: "https://obs.cn-north-4.myhuaweicloud.com" | ||
| 30 | - bucket: "ascend-ci" | ||
| 31 | - key: "${{ env.obs_path }}/pr_filelist_precommit.txt" | ||
| 32 | - path: ${{ steps.process_checkout.outputs.path }} | ||
| 33 | - - | ||
| 34 | - name: precommit | ||
| 35 | - identifier: precommit | ||
| 36 | - uses: cann/.gitcode/actions/precommit@master | ||
| 37 | - with: | ||
| 38 | - merge_id: ${{ env.MERGE_ID }} | ||
| 39 | - repo_name: ${{ env.repo_name }} | ||
| 40 | - workspace: ${{ steps.process_checkout.outputs.path }} | ||
| 41 | - block: ${{ vars.PRECOMMIT_BLOCK }} | ||
| 42 | - - | ||
| 43 | - name: upload | ||
| 44 | - uses: obs-upload | ||
| 45 | - if: ${{ always() }} | ||
| 46 | - with: | ||
| 47 | - endpoint: "https://obs.cn-north-4.myhuaweicloud.com" | ||
| 48 | - bucket: "ascend-ci" | ||
| 49 | - access-key: ${{secrets.AK}} | ||
| 50 | - secret-key: ${{secrets.SK}} | ||
| 51 | - artifact-path: "${{ steps.process_checkout.outputs.path }}/pre-commit*.txt" | ||
| 52 | - object-prefix: ${{ env.obs_path }}/ | ||
| 53 | - if: "${{ default() }}" | ||
| 54 | - runs-on: [dedicate-hosted, x64, small] | ||
| 55 | - container: | ||
| 56 | - image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.precommit_image_version }} | ||
| 57 | - JOB_check_pr: | ||
| 58 | - name: CodeCheck_check-pr | ||
| 59 | - steps: | ||
| 60 | - - | ||
| 61 | - name: Checkout | ||
| 62 | - identifier: process_checkout | ||
| 63 | - uses: checkout | ||
| 64 | - with: | ||
| 65 | - ref: ${{ atomgit.event.pull_request.merge_commit_sha }} | ||
| 66 | - token: ${{secrets.GIT_TOKEN}} | ||
| 67 | - - | ||
| 68 | - name: download | ||
| 69 | - uses: obs-download | ||
| 70 | - with: | ||
| 71 | - endpoint: "https://obs.cn-north-4.myhuaweicloud.com" | ||
| 72 | - bucket: "ascend-ci" | ||
| 73 | - key: | | ||
| 74 | - ${{ env.obs_path }}/pr_filelist.txt | ||
| 75 | - ${{ env.obs_path }}/pr_filelist_mod.txt | ||
| 76 | - path: ${{ steps.process_checkout.outputs.path }} | ||
| 77 | - - | ||
| 78 | - name: check-pr | ||
| 79 | - identifier: check-pr | ||
| 80 | - uses: cann/.gitcode/actions/check-pr@master | ||
| 81 | - with: | ||
| 82 | - repo_name: ${{ env.repo_name }} | ||
| 83 | - workspace: ${{ steps.process_checkout.outputs.path }} | ||
| 84 | - runs-on: [dedicate-hosted, x64, small] | ||
| 85 | - container: | ||
| 86 | - image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.codecheck_image_version }} | ||
| 87 | - JOB_sca: | ||
| 88 | - name: SCA | ||
| 89 | - steps: | ||
| 90 | - - | ||
| 91 | - name: Checkout | ||
| 92 | - identifier: process_checkout | ||
| 93 | - uses: checkout | ||
| 94 | - with: | ||
| 95 | - ref: ${{ atomgit.event.pull_request.merge_commit_sha }} | ||
| 96 | - token: ${{secrets.GIT_TOKEN}} | ||
| 97 | - path: "./runner" | ||
| 98 | - - | ||
| 99 | - name: Checkout | ||
| 100 | - uses: checkout | ||
| 101 | - with: | ||
| 102 | - repository: ${{ vars.CI_PATH }} | ||
| 103 | - ref: refs/heads/master | ||
| 104 | - path: "./runner/CI" | ||
| 105 | - - | ||
| 106 | - name: sca | ||
| 107 | - run: | | ||
| 108 | - cd ${{ steps.process_checkout.outputs.path }} | ||
| 109 | - cd CI/scripts | ||
| 110 | - python3 codescan_gitcode.py --access_key ${{secrets.SCA_AK}} --secret_access_key ${{secrets.SCA_SK}} --access_key_get ${{secrets.SCA_AK_GET}} --secret_access_key_get ${{secrets.SCA_SK_GET}} --org_name ${org_name} --pr_id ${MERGE_ID} --repo ${repo_name} --commit_id ${{ atomgit.event.pull_request.merge_commit_sha }} --online ${{ vars.APPLY_LABEL }} | ||
| 111 | - if: env.online == 'true' | ||
| 112 | - runs-on: [dedicate-hosted, x64, small] | ||
| 113 | - container: | ||
| 114 | - image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.codecheck_image_version }} | ||
| 115 | - JOB_antiposion: | ||
| 116 | - name: Antipoison | ||
| 117 | - steps: | ||
| 118 | - - | ||
| 119 | - name: Checkout | ||
| 120 | - identifier: process_checkout | ||
| 121 | - uses: checkout | ||
| 122 | - with: | ||
| 123 | - ref: ${{ atomgit.event.pull_request.merge_commit_sha }} | ||
| 124 | - token: ${{secrets.GIT_TOKEN}} | ||
| 125 | - path: "./runner" | ||
| 126 | - - | ||
| 127 | - name: Checkout | ||
| 128 | - uses: checkout | ||
| 129 | - with: | ||
| 130 | - repository: ${{ vars.CI_PATH }} | ||
| 131 | - ref: refs/heads/master | ||
| 132 | - path: "./runner/CI" | ||
| 133 | - - | ||
| 134 | - name: antiposion | ||
| 135 | - run: | | ||
| 136 | - cd ${{ steps.process_checkout.outputs.path }} | ||
| 137 | - cd CI/scripts | ||
| 138 | - python3 anti_virus_gitcode.py --access_key ${{secrets.ANTI_AK}} --secret_access_key ${{secrets.ANTI_SK}} --access_key_get ${{secrets.ANTI_AK_GET}} --secret_access_key_get ${{secrets.ANTI_SK_GET}} --org_name ${org_name} --pr_id ${MERGE_ID} --repo ${repo_name} --commit_id ${{ atomgit.event.pull_request.merge_commit_sha }} --online ${{ vars.APPLY_LABEL }} | ||
| 139 | - if: env.online == 'true' | ||
| 140 | - runs-on: [dedicate-hosted, x64, small] | ||
| 141 | - container: | ||
| 142 | - image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.codecheck_image_version }} | ||
| 143 | - JOB_codecheck: | ||
| 144 | - name: CodeCheck | ||
| 145 | - steps: | ||
| 146 | - - | ||
| 147 | - name: Checkout | ||
| 148 | - identifier: process_checkout | ||
| 149 | - uses: checkout | ||
| 150 | - with: | ||
| 151 | - ref: ${{ atomgit.event.pull_request.merge_commit_sha }} | ||
| 152 | - token: ${{secrets.GIT_TOKEN}} | ||
| 153 | - path: "./runner" | ||
| 154 | - - | ||
| 155 | - name: Checkout | ||
| 156 | - uses: checkout | ||
| 157 | - with: | ||
| 158 | - repository: ${{ vars.CI_PATH }} | ||
| 159 | - ref: refs/heads/master | ||
| 160 | - path: "./runner/CI" | ||
| 161 | - - | ||
| 162 | - name: codecheck | ||
| 163 | - run: | | ||
| 164 | - cd ${{ steps.process_checkout.outputs.path }} | ||
| 165 | - cd CI/scripts | ||
| 166 | - python3 codecheck_gitcode.py --access_key ${{secrets.CODECHECK_AK}} --secret_access_key ${{secrets.CODECHECK_SK}} --access_key_get ${{secrets.CODECHECK_AK_GET}} --secret_access_key_get ${{secrets.CODECHECK_SK_GET}} --org_name ${org_name} --pr_id ${MERGE_ID} --repo ${repo_name} --commit_id ${{ atomgit.event.pull_request.merge_commit_sha }} --online ${{ vars.APPLY_LABEL }} | ||
| 167 | - if: env.online == 'true' | ||
| 168 | - runs-on: [dedicate-hosted, x64, small] | ||
| 169 | - container: | ||
| 170 | - image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.codecheck_image_version }} | ||
| @@ -104,8 +104,8 @@ jobs: | |||
| 104 | object-prefix: ${{ env.obs_path }}/ | 104 | object-prefix: ${{ env.obs_path }}/ |
| 105 | if: "${{ default() }}" | 105 | if: "${{ default() }}" |
| 106 | runs-on: | 106 | runs-on: |
| 107 | - - dedicate-hosted | 107 | + - self-hosted |
| 108 | - - ${{ inputs.arch }} | 108 | + - arch=${{ inputs.arch }} |
| 109 | - - xlarge | 109 | + - spec=xlarge |
| 110 | container: | 110 | container: |
| 111 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.image_version }} | 111 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.image_version }} |
| @@ -20,7 +20,7 @@ on: | |||
| 20 | 20 | ||
| 21 | env: | 21 | env: |
| 22 | org_name: ${{ vars.ORG_NAME }} | 22 | org_name: ${{ vars.ORG_NAME }} |
| 23 | - repo_name: "hcomm" | 23 | + repo_name: ${{ atomgit.event.repository.name }} |
| 24 | MERGE_ID: ${{ atomgit.event.pull_request.number }} | 24 | MERGE_ID: ${{ atomgit.event.pull_request.number }} |
| 25 | TARGET_BRANCH: ${{ atomgit.base_ref }} | 25 | TARGET_BRANCH: ${{ atomgit.base_ref }} |
| 26 | SOURCE_BRANCH: ${{ atomgit.head_ref }} | 26 | SOURCE_BRANCH: ${{ atomgit.head_ref }} |
| @@ -40,14 +40,14 @@ stages: | |||
| 40 | identifier: revise_image | 40 | identifier: revise_image |
| 41 | uses: cann/.gitcode/actions/revise-img@master | 41 | uses: cann/.gitcode/actions/revise-img@master |
| 42 | with: | 42 | with: |
| 43 | - repo_name: "hcomm" | 43 | + repo_name: ${{ env.repo_name }} |
| 44 | target_branch: ${{ env.TARGET_BRANCH }} | 44 | target_branch: ${{ env.TARGET_BRANCH }} |
| 45 | repo_url: ${{ vars.CI_PATH }} | 45 | repo_url: ${{ vars.CI_PATH }} |
| 46 | - | 46 | - |
| 47 | name: show_output | 47 | name: show_output |
| 48 | run: | | 48 | run: | |
| 49 | echo "image: ${{ steps.revise_image.outputs.Compile_Ascend_ARM }}" | 49 | echo "image: ${{ steps.revise_image.outputs.Compile_Ascend_ARM }}" |
| 50 | - runs-on: [dedicate-hosted, x64, small] | 50 | + runs-on: ["self-hosted", "arch=x64", "spec=small"] |
| 51 | container: | 51 | container: |
| 52 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/ubuntu20.04.05_x86:k8s_v1.1006 | 52 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/ubuntu20.04.05_x86:k8s_v1.1006 |
| 53 | JOB_pre: | 53 | JOB_pre: |
| @@ -95,7 +95,7 @@ stages: | |||
| 95 | package_name: 'cann-hcomm_linux-aarch64_ubuntu24.run' | 95 | package_name: 'cann-hcomm_linux-aarch64_ubuntu24.run' |
| 96 | JOB_codecheck: | 96 | JOB_codecheck: |
| 97 | name: CodeCheck | 97 | name: CodeCheck |
| 98 | - uses: .gitcode/workflows/codecheck_action.yml | 98 | + uses: cann/.gitcode/.gitcode/workflows/codecheck_action.yml@master |
| 99 | with: | 99 | with: |
| 100 | precommit_image_version: ${{ jobs.JOB_image.outputs.precommit }} | 100 | precommit_image_version: ${{ jobs.JOB_image.outputs.precommit }} |
| 101 | codecheck_image_version: ${{ jobs.JOB_image.outputs.codecheck }} | 101 | codecheck_image_version: ${{ jobs.JOB_image.outputs.codecheck }} |
| @@ -124,7 +124,7 @@ stages: | |||
| 124 | repo_name: ${{ env.repo_name }} | 124 | repo_name: ${{ env.repo_name }} |
| 125 | merge_id: ${{ env.MERGE_ID }} | 125 | merge_id: ${{ env.MERGE_ID }} |
| 126 | if: env.TARGET_BRANCH == 'master' | 126 | if: env.TARGET_BRANCH == 'master' |
| 127 | - runs-on: [dedicate-hosted, x64, small] | 127 | + runs-on: ["self-hosted", "arch=x64", "spec=small"] |
| 128 | container: | 128 | container: |
| 129 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ jobs.JOB_image.outputs.API_Check }} | 129 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ jobs.JOB_image.outputs.API_Check }} |
| 130 | JOB_ut: | 130 | JOB_ut: |
| @@ -152,15 +152,7 @@ stages: | |||
| 152 | uses: checkout | 152 | uses: checkout |
| 153 | with: | 153 | with: |
| 154 | token: ${{secrets.GIT_TOKEN}} | 154 | token: ${{secrets.GIT_TOKEN}} |
| 155 | - path: "./runner" | 155 | + ref: ${{ atomgit.event.pull_request.merge_commit_sha }} |
| 156 | - - | ||
| 157 | - name: Checkout gitcode | ||
| 158 | - identifier: process_checkout_gitcode | ||
| 159 | - uses: checkout | ||
| 160 | - with: | ||
| 161 | - repository: "https://gitcode.com/cann/.gitcode.git" | ||
| 162 | - ref: master | ||
| 163 | - path: "./runner/ci" | ||
| 164 | - | 156 | - |
| 165 | name: download | 157 | name: download |
| 166 | uses: obs-download | 158 | uses: obs-download |
| @@ -176,54 +168,31 @@ stages: | |||
| 176 | ${{ env.obs_path }}/pre_smoke.sh | 168 | ${{ env.obs_path }}/pre_smoke.sh |
| 177 | path: ${{ steps.process_checkout.outputs.path }} | 169 | path: ${{ steps.process_checkout.outputs.path }} |
| 178 | - | 170 | - |
| 179 | - name: tar businesscode | 171 | + name: smoke executor |
| 172 | + timeout-minutes: 30 | ||
| 180 | run: | | 173 | run: | |
| 181 | - cd ${{ steps.process_checkout.outputs.path }} | 174 | + set -e |
| 182 | - tar -zcf ../smoke_data.tar.gz . | 175 | + export repo_name=${{env.repo_name}} |
| 183 | - mv ../smoke_data.tar.gz ./ | 176 | + export pr_id=${{ env.MERGE_ID }} |
| 184 | - - | 177 | + export AK=${{secrets.AK}} |
| 185 | - name: upload | 178 | + export SK=${{secrets.SK}} |
| 186 | - identifier: process_upload | 179 | + export obs_smoke_path=${{ env.obs_smoke_path_A2 }} |
| 180 | + export obs_path=${{ env.obs_path }} | ||
| 181 | + export WORKSPACE=${{ steps.process_checkout.outputs.path }} | ||
| 182 | + bash ${{ steps.process_checkout.outputs.path }}/pre_smoke.sh | ||
| 183 | + - name: upload | ||
| 187 | uses: obs-upload | 184 | uses: obs-upload |
| 188 | with: | 185 | with: |
| 189 | endpoint: "https://obs.cn-north-4.myhuaweicloud.com" | 186 | endpoint: "https://obs.cn-north-4.myhuaweicloud.com" |
| 190 | bucket: "ascend-ci" | 187 | bucket: "ascend-ci" |
| 191 | - access-key: ${{secrets.AK}} | 188 | + access-key: ${{ secrets.AK }} |
| 192 | - secret-key: ${{secrets.SK}} | 189 | + secret-key: ${{ secrets.SK }} |
| 193 | - artifact-path: | | 190 | + artifact-path: "${{ steps.process_checkout.outputs.path }}/slog*.tar.gz" |
| 194 | - ${{ steps.process_checkout.outputs.path }}/smoke_data.tar.gz | 191 | + object-prefix: ${{ env.obs_smoke_path_A2 }}/plog/ |
| 195 | - object-prefix: ${{ env.obs_smoke_path_A2 }}/ | 192 | + if: env.TARGET_BRANCH == 'master' |
| 196 | - - | 193 | + runs-on: ['self-hosted','npu=4','smoke=204'] |
| 197 | - name: smoke executor | 194 | + container: |
| 198 | - uses: manifest-management-plugin | 195 | + image: swr.cn-south-1.myhuaweicloud.com/pre_smoke/${{ jobs.JOB_image.outputs.PreSmoke_A900_npupool }} |
| 199 | - timeout-minutes: 30 | ||
| 200 | - with: | ||
| 201 | - action: DEPLOY | ||
| 202 | - repo: ${{ steps.process_checkout.outputs.path }} | ||
| 203 | - file_path: ${{ steps.process_checkout.outputs.path }}/ci/smoke-conf/smoke-A2.yaml | ||
| 204 | - manifest_image: swr.cn-south-1.myhuaweicloud.com/pre_smoke/${{ jobs.JOB_image.outputs.PreSmoke_A900_npupool }} | ||
| 205 | - custom_shell_script: |- | ||
| 206 | - set -e | ||
| 207 | - export repo_name=${{env.repo_name}} | ||
| 208 | - export pr_id=${{ env.MERGE_ID }} | ||
| 209 | - export AK=${{secrets.AK}} | ||
| 210 | - export SK=${{secrets.SK}} | ||
| 211 | - export obs_smoke_path=${{ env.obs_smoke_path_A2 }} | ||
| 212 | - export obs_path=${{ env.obs_path }} | ||
| 213 | - mkdir -p /home/taskspace && cd /home/taskspace | ||
| 214 | - wget -nv ${{ steps.process_upload.outputs.primary-url }} | ||
| 215 | - tar -zxf $(basename "${{ steps.process_upload.outputs.primary-url }}") | ||
| 216 | - bash /home/taskspace/pre_smoke.sh | ||
| 217 | - - | ||
| 218 | - name: smoke resource clean | ||
| 219 | - uses: manifest-management-plugin | ||
| 220 | - if: ${{ always() }} | ||
| 221 | - with: | ||
| 222 | - action: CRUSH | ||
| 223 | - repo: ${{ steps.process_checkout.outputs.path }} | ||
| 224 | - file_path: ${{ steps.process_checkout.outputs.path }}/ci/smoke-conf/smoke-A2.yaml | ||
| 225 | - if: "${{ default() }}" | ||
| 226 | - runs-on: ['self-hosted','arch=arm','smoke=204'] | ||
| 227 | A3_smoke: | 196 | A3_smoke: |
| 228 | name: PreSmoke_A3 | 197 | name: PreSmoke_A3 |
| 229 | steps: | 198 | steps: |
| @@ -233,15 +202,7 @@ stages: | |||
| 233 | uses: checkout | 202 | uses: checkout |
| 234 | with: | 203 | with: |
| 235 | token: ${{secrets.GIT_TOKEN}} | 204 | token: ${{secrets.GIT_TOKEN}} |
| 236 | - path: "./runner" | 205 | + ref: ${{ atomgit.event.pull_request.merge_commit_sha }} |
| 237 | - - | ||
| 238 | - name: Checkout gitcode | ||
| 239 | - identifier: process_checkout_gitcode | ||
| 240 | - uses: checkout | ||
| 241 | - with: | ||
| 242 | - repository: "https://gitcode.com/cann/.gitcode.git" | ||
| 243 | - ref: master | ||
| 244 | - path: "./runner/ci" | ||
| 245 | - | 206 | - |
| 246 | name: download | 207 | name: download |
| 247 | uses: obs-download | 208 | uses: obs-download |
| @@ -257,54 +218,30 @@ stages: | |||
| 257 | ${{ env.obs_path }}/pre_smoke.sh | 218 | ${{ env.obs_path }}/pre_smoke.sh |
| 258 | path: ${{ steps.process_checkout.outputs.path }} | 219 | path: ${{ steps.process_checkout.outputs.path }} |
| 259 | - | 220 | - |
| 260 | - name: tar businesscode | 221 | + name: smoke executor |
| 222 | + timeout-minutes: 30 | ||
| 261 | run: | | 223 | run: | |
| 262 | - cd ${{ steps.process_checkout.outputs.path }} | 224 | + export obs_smoke_path=${{env.obs_smoke_path_A3}} |
| 263 | - tar -zcf ../smoke_data.tar.gz . | 225 | + export obs_path=${{ env.obs_path }} |
| 264 | - mv ../smoke_data.tar.gz ./ | 226 | + export repo_name=${{env.repo_name}} |
| 265 | - - | 227 | + export pr_id=${{ env.MERGE_ID }} |
| 266 | - name: upload | 228 | + export AK=${{secrets.AK}} |
| 267 | - identifier: process_upload | 229 | + export SK=${{secrets.SK}} |
| 230 | + export WORKSPACE=${{ steps.process_checkout.outputs.path }} | ||
| 231 | + bash ${{ steps.process_checkout.outputs.path }}/pre_smoke.sh | ||
| 232 | + - name: upload | ||
| 268 | uses: obs-upload | 233 | uses: obs-upload |
| 269 | with: | 234 | with: |
| 270 | endpoint: "https://obs.cn-north-4.myhuaweicloud.com" | 235 | endpoint: "https://obs.cn-north-4.myhuaweicloud.com" |
| 271 | bucket: "ascend-ci" | 236 | bucket: "ascend-ci" |
| 272 | - access-key: ${{secrets.AK}} | 237 | + access-key: ${{ secrets.AK }} |
| 273 | - secret-key: ${{secrets.SK}} | 238 | + secret-key: ${{ secrets.SK }} |
| 274 | - artifact-path: | | 239 | + artifact-path: "${{ steps.process_checkout.outputs.path }}/slog*.tar.gz" |
| 275 | - ${{ steps.process_checkout.outputs.path }}/smoke_data.tar.gz | 240 | + object-prefix: ${{ env.obs_smoke_path_A3 }}/plog/ |
| 276 | - object-prefix: ${{ env.obs_smoke_path_A3 }}/ | 241 | + if: env.TARGET_BRANCH == 'master' |
| 277 | - - | 242 | + runs-on: ['self-hosted','npu=4','smoke=301'] |
| 278 | - name: smoke executor | 243 | + container: |
| 279 | - uses: manifest-management-plugin | 244 | + image: swr.cn-north-12.myhuaweicloud.com/pre_smoke/${{jobs.JOB_image.outputs.PreSmoke_A3_npupool}} |
| 280 | - timeout-minutes: 30 | ||
| 281 | - with: | ||
| 282 | - action: DEPLOY | ||
| 283 | - repo: ${{ steps.process_checkout.outputs.path }} | ||
| 284 | - file_path: ${{ steps.process_checkout.outputs.path }}/ci/smoke-conf/smoke-A3.yaml | ||
| 285 | - manifest_image: swr.cn-north-12.myhuaweicloud.com/pre_smoke/${{jobs.JOB_image.outputs.PreSmoke_A3_npupool}} | ||
| 286 | - custom_shell_script: |- | ||
| 287 | - set -e | ||
| 288 | - export repo_name=${{env.repo_name}} | ||
| 289 | - export pr_id=${{ env.MERGE_ID }} | ||
| 290 | - export AK=${{secrets.AK}} | ||
| 291 | - export SK=${{secrets.SK}} | ||
| 292 | - export obs_smoke_path=${{ env.obs_smoke_path_A3 }} | ||
| 293 | - export obs_path=${{ env.obs_path }} | ||
| 294 | - mkdir -p /home/taskspace && cd /home/taskspace | ||
| 295 | - wget -nv ${{ steps.process_upload.outputs.primary-url }} | ||
| 296 | - tar -zxf $(basename "${{ steps.process_upload.outputs.primary-url }}") | ||
| 297 | - bash /home/taskspace/pre_smoke.sh | ||
| 298 | - - | ||
| 299 | - name: smoke resource clean | ||
| 300 | - uses: manifest-management-plugin | ||
| 301 | - if: ${{ always() }} | ||
| 302 | - with: | ||
| 303 | - action: CRUSH | ||
| 304 | - repo: ${{ steps.process_checkout.outputs.path }} | ||
| 305 | - file_path: ${{ steps.process_checkout.outputs.path }}/ci/smoke-conf/smoke-A3.yaml | ||
| 306 | - if: "${{ default() }}" | ||
| 307 | - runs-on: ['self-hosted','arch=arm','smoke=301'] | ||
| 308 | pre: | 245 | pre: |
| 309 | - type: auto | 246 | - type: auto |
| 310 | fail-fast: false | 247 | fail-fast: false |
| @@ -44,6 +44,6 @@ jobs: | |||
| 44 | export obs_path=${{ env.obs_path }} | 44 | export obs_path=${{ env.obs_path }} |
| 45 | bash st.sh | 45 | bash st.sh |
| 46 | if: "${{ default() }}" | 46 | if: "${{ default() }}" |
| 47 | - runs-on: [dedicate-hosted, x64, 2xlarge] | 47 | + runs-on: ["self-hosted", "arch=x64", "spec=2xlarge"] |
| 48 | container: | 48 | container: |
| 49 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.image_version }} | 49 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.image_version }} |
| @@ -61,6 +61,6 @@ jobs: | |||
| 61 | ${{ steps.process_checkout.outputs.path }}/StaticCheck_*.json | 61 | ${{ steps.process_checkout.outputs.path }}/StaticCheck_*.json |
| 62 | object-prefix: ${{ env.obs_path }}/ | 62 | object-prefix: ${{ env.obs_path }}/ |
| 63 | if: "${{ default() }}" | 63 | if: "${{ default() }}" |
| 64 | - runs-on: [dedicate-hosted, x64, medium] | 64 | + runs-on: ["self-hosted", "arch=x64", "spec=medium"] |
| 65 | container: | 65 | container: |
| 66 | image: swr.cn-north-4.myhuaweicloud.com/static_check/${{ inputs.image_version }} | 66 | image: swr.cn-north-4.myhuaweicloud.com/static_check/${{ inputs.image_version }} |
| @@ -66,6 +66,6 @@ jobs: | |||
| 66 | ${{ steps.process_checkout.outputs.path }}/ut_cov_*.tar.gz | 66 | ${{ steps.process_checkout.outputs.path }}/ut_cov_*.tar.gz |
| 67 | object-prefix: ${{ env.obs_path }}/ | 67 | object-prefix: ${{ env.obs_path }}/ |
| 68 | if: "${{ default() }}" | 68 | if: "${{ default() }}" |
| 69 | - runs-on: [dedicate-hosted, x64, 2xlarge] | 69 | + runs-on: ["self-hosted", "arch=x64", "spec=2xlarge"] |
| 70 | container: | 70 | container: |
| 71 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.image_version }} | 71 | image: swr.cn-north-4.myhuaweicloud.com/ci_cann/${{ inputs.image_version }} |
🟡 Medium Priority
变更行:hcomm_action.yml 第 183-191 行(A2)与第 232-240 行(A3)新增的
- name: upload步骤,以及 pre_smoke.sh 中被删除的第 72-75 行(脚本内 plog 上传逻辑)。证据链:旧流程中,pre_smoke.sh 在脚本内(测试结果检查之前,diff 中删除的 72-75 行)就调用 python3 upload.py 把 slog.tar.gz 上传到 OBS,因此无论测试成功还是失败,plog 都会在脚本
exit 1之前被上传。新流程把上传挪到了 workflow 的独立 upload 步骤,但该步骤既没有if: ${{ always() }}也没有continue-on-error。按照 GitHub/GitCode 默认语义,前一步骤失败(pre_smoke.sh 测试失败时以exit 1退出,且第 174 行set -e使该步骤直接失败)会跳过后续步骤。失败模式:恰好当冒烟测试失败——也就是最需要 plog/slog 日志定位问题时——upload 步骤被跳过,slog.tar.gz 不会上传,日志彻底丢失。这是本次迁移相对旧行为的功能性回归。代码库内其它类似步骤(如 staticcheck_action.yml 第 53 行
if: ${{ always() }}的 upload、旧 A2/A3 的 smoke resource clean 步骤)都使用了if: always(),此处遗漏与既有约定不一致。修复:为两个 upload 步骤加上
if: ${{ always() }}(suggested_code 仅给出 A2 一处,A3 同理)。建议:给 A2(第 183 行)和 A3(第 232 行)的 upload 步骤增加
if: ${{ always() }},确保冒烟测试失败时 slog 日志仍会上传,恢复旧脚本内先上传后判结果的语义。