Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unused container image layers aren't always deleted after removing image from package registry #20631

Closed
rom4nik opened this issue Aug 2, 2022 · 2 comments · Fixed by #21658
Labels
topic/packages type/docs This PR mainly updates/creates documentation

Comments

@rom4nik
Copy link

rom4nik commented Aug 2, 2022

Description

Steps to hopefully reproduce the issue:

  1. Build some container image
    podman build . -t localhost:3000/przemek/test:latest
  2. Login to registry
    podman login --tls-verify=false localhost:3000
  3. Push image to registry
    podman push --tls-verify=false localhost:3000/przemek/test:latest
  4. Delete it from user accessible packages list or from packages list in site administration
  5. Total size used (usually) doesn't change, layer files are still present in /var/lib/gitea/packages
  6. Running "Cleanup expired packages" sometimes deleted some of the remaining files, but most of the time it didn't.

Can't verify if it's reproducible on try.gitea.io due to verification email not arriving and possibly lack of site administration access afterwards.

Gitea Version

1.17.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/rom4nik/a8bd467b43ae2692bf437db7356bfc00

Screenshots

No response

Git Version

2.36.2

Operating System

Arch Linux

How are you running Gitea?

For testing: podman run -p 127.0.0.1:3000:3000 docker.io/gitea/gitea:1.17.0-rootless

Database

SQLite

@KN4CK3R
Copy link
Member

KN4CK3R commented Aug 3, 2022

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Cleanup expired packages
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;[cron.cleanup_packages]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Whether to enable the job
;ENABLED = true
;; Whether to always run at least once at start up time (if ENABLED)
;RUN_AT_START = true
;; Whether to emit notice on successful execution too
;NOTICE_ON_SUCCESS = false
;; Time interval for job to run
;SCHEDULE = @midnight
;; Unreferenced blobs created more than OLDER_THAN ago are subject to deletion
;OLDER_THAN = 24h

The OLDER_THAN setting is active too if you run the task from the admin page. So only blobs older than 24h are removed by default.

@rom4nik
Copy link
Author

rom4nik commented Aug 3, 2022

I wasn't aware of this, sorry for making a bogus bug report then. It'd be great if this could be mentioned somewhere on the site admin pages and/or in documentation.

@lunny lunny added type/docs This PR mainly updates/creates documentation and removed type/bug labels Aug 11, 2022
lafriks pushed a commit that referenced this issue Nov 20, 2022
Fixes #20514
Fixes #20766
Fixes #20631

This PR adds Cleanup Rules for the package registry. This allows to
delete unneeded packages automatically. Cleanup rules can be set up from
the user or org settings.
Please have a look at the documentation because I'm not a native english
speaker.

Rule Form

![grafik](https://user-images.githubusercontent.com/1666336/199330792-c13918a6-e196-4e71-9f53-18554515edca.png)

Rule List

![grafik](https://user-images.githubusercontent.com/1666336/199331261-5f6878e8-a80c-4985-800d-ebb3524b1a8d.png)

Rule Preview

![grafik](https://user-images.githubusercontent.com/1666336/199330917-c95e4017-cf64-4142-a3e4-af18c4f127c3.png)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
fsologureng pushed a commit to fsologureng/gitea that referenced this issue Nov 22, 2022
Fixes go-gitea#20514
Fixes go-gitea#20766
Fixes go-gitea#20631

This PR adds Cleanup Rules for the package registry. This allows to
delete unneeded packages automatically. Cleanup rules can be set up from
the user or org settings.
Please have a look at the documentation because I'm not a native english
speaker.

Rule Form

![grafik](https://user-images.githubusercontent.com/1666336/199330792-c13918a6-e196-4e71-9f53-18554515edca.png)

Rule List

![grafik](https://user-images.githubusercontent.com/1666336/199331261-5f6878e8-a80c-4985-800d-ebb3524b1a8d.png)

Rule Preview

![grafik](https://user-images.githubusercontent.com/1666336/199330917-c95e4017-cf64-4142-a3e4-af18c4f127c3.png)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/packages type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants