[ci] fix linux runners running out of disk space (fixed #6635) (#6636)

This commit is contained in:
James Lamb 2024-09-02 15:34:00 -05:00 коммит произвёл GitHub
Родитель 16c12ef630
Коммит b9a2262b60
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -50,6 +50,35 @@ resources:
tasks: true
jobs:
###########################################
- job: Maintenance
###########################################
pool: mariner-20240410-0
container: ubuntu-latest
# routine maintenance (like periodically deleting old files),
# to be run on 1 random CI runner in the self-hosted pool each runner
steps:
- script: |
print-diagnostics(){
echo "---- df -h -m ----"
df -h -m
echo "---- docker system df ----"
/tmp/docker system df
echo "---- docker images ----"
/tmp/docker images
}
# check disk usage
print-diagnostics
# remove old containers, container images, volumes
# ref: https://stackoverflow.com/a/32723127/3986677)
echo "---- running 'docker system prune' ----"
/tmp/docker system prune \
--all \
--force \
--filter until=720h
# check disk usage again
print-diagnostics
displayName: clean
###########################################
- job: Linux
###########################################
variables: