atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

[Feature] Plugin-Cache Clean Up

Open YesYouKenSpace opened this issue 5 years ago • 11 comments

Justification

image

YesYouKenSpace avatar Jan 28 '20 09:01 YesYouKenSpace

Yikes! Maybe something on a long timer that runs every hour? We wouldn't want to delete plugins that have actually been used though. Maybe we could default to deleting plugins that haven't been accessed for 3 weeks?

lkysow avatar Jan 28 '20 15:01 lkysow

Yeah sounds good and viable!

YesYouKenSpace avatar Feb 08 '20 09:02 YesYouKenSpace

I'd be happy w/ deleting older versions of a given plugin, we had ~40 copies of each of two google providers and that ran us down to 0 bytes of disk space on the volume.

Also, it'd be nice if something (although it might be terraform) didn't leave incomplete versions of these files on disk (we had some that weren't executable, and I presume it's because it was downloading them and ran out of disk before they finished, and thus didn't get to the +x step).

jsoref avatar Jan 19 '21 21:01 jsoref

this is also happening in our case, where we use git as the module source. It's frankly ridiculous. A few plans in a span of an hour or two, completely make the Fargate instance (20 GBs of total space) run out of space.

@lkysow Should I create another ticket for this, as it is not solely related to plugins, but for git modules too?

dimisjim avatar Feb 17 '21 18:02 dimisjim

@dimisjim I think the git modules is different as it is a terraform mechanism. To make it worse, the same module can be downloaded several times if used multiple times in the root module (project).

YesYouKenSpace avatar Feb 23 '21 14:02 YesYouKenSpace

What do you guys think? I have some suggestions. I would like to help!

  1. a CronJob packed into the docker image
  2. Make it part of the Go Code
  3. A sidecar container in the helm chart

YesYouKenSpace avatar Mar 01 '21 05:03 YesYouKenSpace

A sane, configurable, default for deleting plugins X days/weeks/months old would be ideal for this. you could roll a cron job into the official helm chart but it would be nice if this was just an atlantis param instead

red8888 avatar Apr 09 '21 20:04 red8888

I found this because this is happening to our Atlantis deployment. I'm confused though - because when you run terraform locally, if the providers are already downloaded and you are not running the terraform init -upgrade command, then as far as I know terraform doesn't download the providers every time. So how come its doing it when it's being run by Atlantis?

m477r1x avatar Jun 17 '21 09:06 m477r1x

I would even be ok with a UI option to delete all or select from a tree.

john-delivuk avatar Jun 08 '22 15:06 john-delivuk

Part of the go code.

It could run after a job completes.

jsoref avatar Jun 08 '22 15:06 jsoref

As a workaround, this pre_workflow_hook has been helping me keep my volumes clean

https://github.com/runatlantis/atlantis/issues/3238#issuecomment-1869094337

nitrocode avatar Jan 13 '24 00:01 nitrocode