Skip to content

ci: Add Job to cleanup older images for all builds

Eesaan Atluri requested to merge atlurie/hpc-factory:feat-cleanup-imgs-ci into main

Closes #265 (closed)

  • Keep the latest $NUM_IMAGES_TO_KEEP no. of images in a list sorted by creation time in descending order.
  • The NUM_IMAGES_TO_KEEP value should always be postive so that the list of servers to delete will be calculated correctly
  • Never run the cleanup_img job if NUM_IMAGES_TO_KEEP is non-postive. So if you intend to not cleanup the images for any reason, just pass a negative value or 0 to the NUM_IMAGES_TO_KEEP
Edited by Eesaan Atluri

Merge request reports

Loading