Bug 1940951
Summary: | [RFE] To display total size of a yum\docker\iso\file\custom repository in Satellite GUI after syncing them | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Sayan Das <saydas> |
Component: | Repositories | Assignee: | satellite6-bugs <satellite6-bugs> |
Status: | NEW --- | QA Contact: | Satellite QE Team <sat-qe-bz-list> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.11.0 | CC: | ahumbe, akapse, awyatt, dalley, dsinglet, fperalta, iballou, mkalyat, mvanderw, nikhjain, peter.vreman, pmoravec, satellite6-bugs, thadzhie |
Target Milestone: | Unspecified | Keywords: | FutureFeature, Triaged |
Target Release: | Unused | Flags: | fperalta:
needinfo?
(satellite6-bugs) fperalta: needinfo? (dsinglet) |
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | Type: | Bug | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Sayan Das
2021-03-19 15:47:31 UTC
*** Bug 1694836 has been marked as a duplicate of this bug. *** *** Bug 1902756 has been marked as a duplicate of this bug. *** This can be relatively simply implemented (up to the UX layer), at least for the already-downloaded content. See https://access.redhat.com/solutions/7006345 and namely its core part: (in pulpcore-manager shell): # QuerySet of all artifacts that are published either where; each record consists of: # - pulp_id of artifact (for reference from repo_artifacts below) # - size of the artifact # - count = number of times the artifact is published (e.g. via 2 versions of same CV for same root repo) all_artifacts = PublishedArtifact.objects.filter(content_artifact__artifact__isnull=False) \ .values('content_artifact__artifact__pulp_id', 'content_artifact__artifact__size') \ .annotate(count=Count('content_artifact__artifact__pulp_id')) If you generate the same "per repo for each katello root repo", like: repo_artifacts = PublishedArtifact.objects.filter(content_artifact__artifact__isnull=False, publication__repository_version__repository__name__startswith=rrepo) \ .values('content_artifact__artifact__pulp_id', 'content_artifact__artifact__size') \ .annotate(count=Count('content_artifact__artifact__pulp_id')) then you can get the "per root repo" statistics described in the KCS. This data - for one root repository - can be computed ad hoc (on a click in WebUI, e.g.) as the underlying code is executed within a few seconds for a root repo. Just add some API and UX to it - *if* it is desired to provide exactly this information (it differs a bit from the RFE requirements that needs total size of repo, not total size of already downloaded data). @Pavel the problem is that sizes are non-additive. Sure, the number might say that the repo is 60gb, but if I delete it and run orphan cleanup it may be the case that zero space is actually freed up. That's the primary issue - any UX we provide needs to be in sync with the user expectations around what those numbers mean and what actions they can take based on them. (In reply to Daniel Alley from comment #9) > @Pavel the problem is that sizes are non-additive. Sure, the number might > say that the repo is 60gb, but if I delete it and run orphan cleanup it may > be the case that zero space is actually freed up. That's the primary issue > - any UX we provide needs to be in sync with the user expectations around > what those numbers mean and what actions they can take based on them. That is why the script counts two pair of values: - number and sum of sizes of already downloaded packages - your comment applies to this - number and sum of sizes of downloaded packages that are associated *just* with the repo (or either of its clone in CV) - see how I calculate all_artifacts[artifact_uuid]['count'] as the number of repos associated with the artifact. So when all_artifacts[artifact_uuid]['count'] == repo_artifacts[artifact_uuid]['count'] , I know this artifact is associated just with this repo (or either its clone). And only then I add it to the "OwnSize". So OwnSize and OwnPkgs values counted for a repo should really stand for "if I would delete just the repo (and its clones), then orphan cleanup(*) would remove that number of packages of that cumulative size (*) zith zero orphan protection time or after the "timeout" elapses. However the original request can be read as "what is the amount of data I might need to store, in case all packages would be downloaded?" - so I extended my script accordingly, by adding: repo_ca = PublishedArtifact.objects.filter(publication__repository_version__repository__name__startswith=rrepo).values('content_artifact__pulp_id') ra = RemoteArtifact.objects.filter(content_artifact__in=repo_ca) rrepos[rrepo]['RemotePkgs'] = ra.count() rrepos[rrepo]['RemoteSize'] = ra.aggregate(Sum('size'))['size__sum'] (ra = QuerySet of all RemoteArtifact objects associated with the repo or its clone) Let try(*) the script attached to https://access.redhat.com/solutions/7006345 , I think it can be handy tool alone. (*) preferably on Satellite, not on standalone pulpcore server. Since the script relies on katello-defined naming convention of pulp repo names, per https://github.com/Katello/katello/blob/master/app/services/katello/pulp3/repository.rb#L113-L115 (the script truncates trailing number in a repo name to identify sets of repo clones belonging to the same katello's root repository) Anyway I agree a devil can be hidden in details how customers can interpret the values (or what they expect in particular here). I understand there can be a confusion, also due to the nonzero orphan protection time ("I removed the repo and run orphan cleanup but nothing was really removed" support cases soon after the RFE implemented :) ). So while I *think* I implemented sort-of TUI version of the RFE, I understand it might not be possible to productise it in this way due to the interpretation of values. |