You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the discoveries from the last meeting and the recent troubles with disk space (see #160) I propose we do more immediate cleanup in the Jenkins pipeline.
Currently, we directly build a lot of images in the last stage of the pipeline:
It makes sense to build those images to test, if the build works, but there is no need to keep images around. AFAICT, if the pipeline isn't running on master the images aren't even published anywhere.
So I propose we add a dockerUtils.removeImage in ElektraInitiative/jenkins-library to execute docker image rm. Then we call dockerUtils.removeImage either as soon as the images aren't needed anymore, or even better, we add a post section to the pipeline for proper cleanup.
The text was updated successfully, but these errors were encountered:
diff --git a/scripts/jenkins/Jenkinsfile b/scripts/jenkins/Jenkinsfile
index fbb23a3eb..e5dcf1e53 100644
--- a/scripts/jenkins/Jenkinsfile+++ b/scripts/jenkins/Jenkinsfile@@ -207,6 +207,10 @@ Logs: ${currentBuild.rawBuild.getLog(20).join('\n')}
to: "build@libelektra.org"
}
throw e
+} finally {+ stage("cleanup") {+ sh "docker image list --format='{{ .Repository }}' '*:${dockerUtils.tagArtifact()}' | xargs docker image rm"+ }
}
/*****************************************************************************
I think this might actually do the trick. It should add a cleanup stage as the last thing before the Pipeline stops (for whatever reason). What I don't know is whether docker image rm on the worker node is actually enough to solve our space problem (that's why I didn't make a PR).
I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖
Based on the discoveries from the last meeting and the recent troubles with disk space (see #160) I propose we do more immediate cleanup in the Jenkins pipeline.
Currently, we directly build a lot of images in the last stage of the pipeline:
libelektra/scripts/jenkins/Jenkinsfile
Lines 1104 to 1169 in 90f7081
Each of these
buildPackage
calls does adockerUtils.buildImage
call (which executesdocker build
):libelektra/scripts/jenkins/Jenkinsfile
Lines 1216 to 1229 in 90f7081
Additionally, there are few
dockerUtils.buildImageStage
(a wrapper arounddockerUtils.buildImage
) calls for the website and web-ui:libelektra/scripts/jenkins/Jenkinsfile
Line 749 in 90f7081
libelektra/scripts/jenkins/Jenkinsfile
Lines 1334 to 1338 in 90f7081
libelektra/scripts/jenkins/Jenkinsfile
Lines 1359 to 1364 in 90f7081
It makes sense to build those images to test, if the build works, but there is no need to keep images around. AFAICT, if the pipeline isn't running on
master
the images aren't even published anywhere.So I propose we add a
dockerUtils.removeImage
in ElektraInitiative/jenkins-library to executedocker image rm
. Then we calldockerUtils.removeImage
either as soon as the images aren't needed anymore, or even better, we add apost
section to the pipeline for proper cleanup.The text was updated successfully, but these errors were encountered: