Skip to content

Commit

Permalink
Merge pull request #963 from ORNL/JoshuaSBrown-adjustable-container-p…
Browse files Browse the repository at this point in the history
…urge

Joshua s brown adjustable container purge
  • Loading branch information
JoshuaSBrown authored Jun 17, 2024
2 parents e99e0d9 + b185755 commit 7523fec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ clear-repo-cache:

clear-python-client-cache:
stage: clear-docker-cache
variables:
DATAFED_CI_PURGE_THRESHOLD: "10"
needs: ["signal"]
tags:
- ci_5
Expand Down
10 changes: 8 additions & 2 deletions scripts/ci_purge_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
# the oldest one

# Max allowed size of all images in GB
THRESHOLD_IN_GB="15"
if [ -z "${DATAFED_CI_PURGE_THRESHOLD}" ]
then
local_DATAFED_CI_PURGE_THRESHOLD="15"
else
local_DATAFED_CI_PURGE_THRESHOLD=$(printenv DATAFED_CI_PURGE_THRESHOLD)
fi


get_size_of_all_images_in_GB() {
declare -g total_image_size_number="0"
Expand All @@ -31,7 +37,7 @@ purge_oldest_image() {

get_size_of_all_images_in_GB

while [ "$total_image_size_number" -gt "$THRESHOLD_IN_GB" ]
while [ "$total_image_size_number" -gt "$local_DATAFED_CI_PURGE_THRESHOLD" ]
do
purge_oldest_image
get_size_of_all_images_in_GB
Expand Down

0 comments on commit 7523fec

Please sign in to comment.