Cleanup deployment folders within Octopus tentacles

Hi,
This topic is specifically about the folders that are accumulated within Octopus tentacles (not for Octopus server nodes) over the time.

We can see few folders in each Octopus tentacles.
Octopus
-------------- Files
-------------- Applications
-------------- Calamari
-------------- Logs
-------------- Upgrade
-------------- Work

The data stored in Files and Applications are increasing day by day. Now we have 500MB - 14GB of data under applications and 8GB - 26 GB of data under Files. We have set the retention policy within life cycles (Releases: Keep all. Files on Tentacle: Keep 1 day). But this doesn’t seems to resolve the issue.

Both the folders contains multiple versions of application packages. Applications folder keeps up to 5 different versions of packages and Files folder keeps ~7 different versions of a package.
One of the old Octopus thread explains that its safe to delete files from Files folder. But I do not want to write additional scripts if we already have a cleanup mechanism in place.

We have this issue in all our tentacles. I do not think allocating 20GB to 40GB of storage space per tentacle just for the cache is a good idea :frowning:

Can someone suggest if there is an automated way to clean up these folders.
I assume below method is for Octopus server files and not for tentacle files.
Octopus.Server.exe configure --cachePackages=[days]
Please correct me if I am wrong.

Hi @Falcon_Francis,

Thanks for getting in touch!

These folders should be managed by the retention policy that you have set. You mention that it is keeping multiple versions of a package, are these different versions all deployed in the same day or are they spanning multiple days?

The way the retention works for tentacles is that it will only cleanup files related to the project that is currently running. Do you have multiple projects deploying to the same tentacle and would this explain the collection of files in those folders?

It would be worth checking one of your deployment logs for the apply retention policy step at the end to confirm if it provides any reasons for retaining the files too.

We do have done additional information on troubleshooting tentacle cleanup that may help too: https://octopus.com/docs/administration/retention-policies/retention-policy-tentacle-cleanup-and-troubleshooting

I look forward to hearing from you.

Regards,
Paul

Hi Paul,

I would go through the details.

Will keep you posted.

Thank you for the information.

Hi Paul,

On behalf of falcon i am providing the feedback.

I have gone through the link which you have provided what i have observed content is deleting from the application directory using retention policy but from the File directory content is not deleting by applying the retention policy . can you please let me know what else we can check to fix this ?

Regards
Shubham

Hi @Shubham_Agrawal,

If you view the Applying Retention Policy step at the end of the deployment does the log mention anything about removing items from the Files folder?
e.g.

It’s possible that it is removing some items from there, but that there are also older items from older, now deleted projects that it won’t ever be able to remove.
As the Files folder is just a package cache repository, it would be worthwhile to manually delete all items inside that folder and then monitor it after a few days to see if the retention is keeping it under control.

Regards,
Paul

1 Like

Hi Paul,

Thanks for the input i will observe few days and let you know.

Thanks
Shubham

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.