Skip to content

Commit 0b9588d

Browse files
authored
Prune image from GPU agent disk. (#1088)
* Prune image from GPU agent disk. It was currently only running on the CPU (ephemeral) agents. Switched to be run on the GPU agent building the image to prevent build errors caused by disk filling up. * Reduce prune window
1 parent e34c886 commit 0b9588d

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

Jenkinsfile

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,6 @@ pipeline {
2020
}
2121

2222
stages {
23-
stage('Clean Images') {
24-
steps {
25-
sh '''#!/bin/bash
26-
set -exo pipefail
27-
# Remove images (dangling or not) created more than 120h (5 days ago) to prevent disk from filling up.
28-
docker image prune --all --force --filter "until=120h" --filter "label=kaggle-lang=python"
29-
# Remove any dangling images (no tags).
30-
# All builds for the same branch uses the same tag. This means a subsequent build for the same branch
31-
# will untag the previously built image which is safe to do. Builds for a single branch are performed
32-
# serially.
33-
docker image prune -f
34-
'''
35-
}
36-
}
3723
stage('Pre-build Packages from Source') {
3824
parallel {
3925
stage('torch') {
@@ -123,6 +109,15 @@ pipeline {
123109
steps {
124110
sh '''#!/bin/bash
125111
set -exo pipefail
112+
# Remove images (dangling or not) created more than 72h (3 days ago) to prevent the GPU agent disk from filling up.
113+
# Note: CPU agents are ephemeral and do not need to have their disk cleaned up.
114+
docker image prune --all --force --filter "until=72h" --filter "label=kaggle-lang=python"
115+
# Remove any dangling images (no tags).
116+
# All builds for the same branch uses the same tag. This means a subsequent build for the same branch
117+
# will untag the previously built image which is safe to do. Builds for a single branch are performed
118+
# serially.
119+
docker image prune -f
120+
126121
./build --gpu | ts
127122
./push --gpu ${PRETEST_TAG}
128123
'''

0 commit comments

Comments
 (0)