Skip to content

Commit 49cba9a

Browse files
authored
Immediately delete cuda-windows GitHub Artifacts (#22863)
### Summary In #22848 and #22854 we could export and test on the same machine. We can't do that here because the models are exported on Linux and tested on Windows, so we still have to upload them for the Windows job to download. This PR just deletes them once the Windows job is done. GitHub charges for artifact storage by the hour. Each run uploads 18.4 GB, and right now that sits around for the full 2 days of retention even though the Windows job is done with it within an hour. In August this workflow ran about 70 times a day, so at that rate this brings us from roughly **$650/month down to $12**. It also takes about 500 GB off our live artifact storage. If a test fails we leave the artifacts alone so you can still re-run the failed jobs or debug. They expire with the normal retention (currently 2 days). ### Test plan CI. The `delete-model-cuda-windows-artifacts` job should log six deletions and the run should end with zero artifacts.
1 parent 5eaea6c commit 49cba9a

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/cuda-windows.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,27 @@ jobs:
218218
219219
.ci/scripts/test_model_e2e_windows.ps1 -Device cuda-windows -HfModel '${{ matrix.model_repo }}/${{ matrix.model_name }}' -QuantName '${{ matrix.quant }}' -ModelDir \$artifactDir -ExpectedCudaVersion '13.0'
220220
}"
221+
222+
delete-model-cuda-windows-artifacts:
223+
name: delete-model-cuda-windows-artifacts
224+
# The exports exist only to hand the models to the Windows job above, about
225+
# 18 GB per run, and GitHub bills artifact storage by the hour, so delete
226+
# them as soon as the tests have consumed them instead of keeping them for
227+
# the repository retention window. They are kept when a test fails so that
228+
# "Re-run failed jobs" and debugging still have them; those expire with the
229+
# retention window.
230+
needs: [export-model-cuda-windows-artifact, test-model-cuda-windows-e2e]
231+
runs-on: ubuntu-22.04
232+
permissions:
233+
actions: write
234+
steps:
235+
- name: Delete the exported models
236+
env:
237+
GH_TOKEN: ${{ github.token }}
238+
run: |
239+
gh api --paginate "repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" \
240+
--jq '.artifacts[] | select(.name | test("-cuda-windows-")) | "\(.id) \(.name)"' |
241+
while read -r id name; do
242+
echo "Deleting ${name} (${id})"
243+
gh api -X DELETE "repos/${{ github.repository }}/actions/artifacts/${id}"
244+
done

0 commit comments

Comments
 (0)