Skip to content

Commit b9a2262

Browse files
authored
[ci] fix linux runners running out of disk space (fixed #6635) (#6636)
1 parent 16c12ef commit b9a2262

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.vsts-ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,35 @@ resources:
5050
tasks: true
5151
jobs:
5252
###########################################
53+
- job: Maintenance
54+
###########################################
55+
pool: mariner-20240410-0
56+
container: ubuntu-latest
57+
# routine maintenance (like periodically deleting old files),
58+
# to be run on 1 random CI runner in the self-hosted pool each runner
59+
steps:
60+
- script: |
61+
print-diagnostics(){
62+
echo "---- df -h -m ----"
63+
df -h -m
64+
echo "---- docker system df ----"
65+
/tmp/docker system df
66+
echo "---- docker images ----"
67+
/tmp/docker images
68+
}
69+
# check disk usage
70+
print-diagnostics
71+
# remove old containers, container images, volumes
72+
# ref: https://stackoverflow.com/a/32723127/3986677)
73+
echo "---- running 'docker system prune' ----"
74+
/tmp/docker system prune \
75+
--all \
76+
--force \
77+
--filter until=720h
78+
# check disk usage again
79+
print-diagnostics
80+
displayName: clean
81+
###########################################
5382
- job: Linux
5483
###########################################
5584
variables:

0 commit comments

Comments
 (0)