Bug 2001517

Summary: [RFE] Allow "on_demand" download policy for repositories of content_type docker
Product: Red Hat Satellite Reporter: Eric Nothen <enothen>
Component: RepositoriesAssignee: Ryan Verdile <rverdile>
Status: CLOSED ERRATA QA Contact: Cole Higgins <chiggins>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: ajoseph, bbuckingham, ddf-bot, mdolezel, rchan, rverdile, saydas, thadzhie, ttereshc
Target Milestone: 6.12.0Keywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-16 13:32:46 UTC 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 Eric Nothen 2021-09-06 09:27:31 UTC
Description of problem:
When creating a repository of content_type docker, it is not possible to define download_policy to "on_demand", as it is the case and correctly documented for the content_type yum:

[root@satellite ~]# hammer repository update --help |grep -A1 download-policy
 --download-policy DOWNLOAD_POLICY             Download policy for yum repos (either 'immediate',
                                               'on_demand', or 'background (deprecated)')

Example on one single repository, in which the initial sync downloaded all blobs:

[root@satellite ~]# du -sk /var/lib/pulp ; hammer repository sync --id 16 --organization-id 1 ; du -sk /var/lib/pulp
3147168	/var/lib/pulp
[....................................................................................................................] [100%]
New blobs: 924.
9165392	/var/lib/pulp
[root@satellite ~]#

That's roughly 5.7GB used by one single container, out of 117 different ones required by RHOSP 16.1. The downloaded tags include not only older versions that will never be used, but also others with tags such as *-source.

Being able to download images as they are pulled would save a lot of space (> 100GB on the initial sync of RHOSP 16.1) and also make the initial sync way faster. Only when an image is being pulled from satellite, the required blobs would be downloaded, depending on the tag specified as part of the pull.

Version-Release number of selected component (if applicable):
Satellite 6.9.5 or earlier

How reproducible:
Reproducible via web or hammer cli

Steps to Reproduce:
1. Create a product
[root@satellite ~]# hammer product create --organization-id 1 --name "OSP16.1 Containers"
Product created.
[root@satellite ~]# 

2. Attempt to create repository using donwload-policy:
[root@satellite ~]# hammer repository create \
>   --name base \
>   --organization-id 1 \
>   --product "OSP16.1 Containers" \
>   --content-type docker \
>   --url https://registry.redhat.io \
>   --docker-upstream-name rhosp-rhel8/openstack-base \
>   --upstream-username $USERNAME \
>   --upstream-password $PASSWORD \
>   --download-policy on_demand
Could not create the repository:
  Validation failed: Download policy Cannot set attribute download_policy for content type docker
[root@satellite ~]# 


Actual results:
Can not use download_policy "on_demand" for content type "docker"

Expected results:
Can use download_policy "on_demand" for content type "docker"

Comment 1 Tanya Tereshchenko 2021-09-06 19:18:03 UTC
This is supported in Pulp 3 upstream, needs to be exposed on the Katello side.

Comment 2 Robin Chan 2022-03-23 18:50:45 UTC
@rverdile should this issue https://projects.theforeman.org/issues/34217 be linked to this bz?

Comment 3 Ryan Verdile 2022-03-23 19:00:44 UTC
Connecting redmine issue https://projects.theforeman.org/issues/34217 from this bug

Comment 4 Ryan Verdile 2022-03-23 19:01:35 UTC
(In reply to Robin Chan from comment #2)
> @rverdile should this issue
> https://projects.theforeman.org/issues/34217 be linked to this bz?

Yes, thank you. Should be linked now.

Comment 5 Bryan Kearney 2022-03-23 20:04:27 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34217 has been resolved.

Comment 6 Eric Nothen 2022-05-25 15:09:53 UTC
Hello everyone, I don't see a target milestone for this BZ. Can some tell on which version of Satellite this feature is expected to be released?

Comment 14 errata-xmlrpc 2022-11-16 13:32:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8506

Comment 16 Andy Stillman 2023-02-21 02:41:12 UTC
*** Bug 1772887 has been marked as a duplicate of this bug. ***

Comment 17 Ian Ballou 2023-05-22 15:18:47 UTC
*** Bug 1504789 has been marked as a duplicate of this bug. ***