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

[FEATURE] Implement Progress Details in podman pull API as occurs in docker pull API #24887

Open
D3vil0p3r opened this issue Dec 21, 2024 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@D3vil0p3r
Copy link

Feature request description

Currently, by invoking podman pull API:

curl -XPOST --unix-socket /run/user/1000/podman/podman.sock -H content-type:application/json http://d/v4.0.0/libpod/images/pull?reference=docker.io/athenaos/base

produces an output in JSON containing only stream field with no progress details, i.e.:

{'stream': 'Trying to pull docker.io/athenaos/base:latest...\n'}
{'stream': 'Getting image source signatures\n'}
{'stream': 'Copying blob sha256:30babffc8f090f7c78c263b9a1b683b34ca5f73da74911ffe942d4d8225dca57\n'}
{'stream': 'Copying config sha256:420f00cb47debe421a8b70b1a2e9ccf16a942cce2f70d1724eff6be764e95fea\n'}
{'stream': 'Writing manifest to image destination\n'}
{'images': ['420f00cb47debe421a8b70b1a2e9ccf16a942cce2f70d1724eff6be764e95fea'], 'id': '420f00cb47debe421a8b70b1a2e9ccf16a942cce2f70d1724eff6be764e95fea'}

This output is also different by the one produced by podman pull command that actually shows a progress bar:

Trying to pull docker.io/athenaos/base:latest...
Getting image source signatures
Copying blob 30babffc8f09 [>-------------------------------] 5.5MiB / 145.1MiB | 3.9 MiB/s
...

It would be very nice if this pull API could be improved in order to output progress details as occurs by docker pull API:

{'status': 'Pulling from athenaos/base', 'id': 'latest'}
{'status': 'Pulling fs layer', 'progressDetail': {}, 'id': '30babffc8f09'}
{'status': 'Downloading', 'progressDetail': {'current': 527607, 'total': 152137719}, 'progress': '[>                                    
]  527.6kB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Downloading', 'progressDetail': {'current': 1055991, 'total': 152137719}, 'progress': '[>                                   
]  1.056MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Downloading', 'progressDetail': {'current': 1596663, 'total': 152137719}, 'progress': '[>                                   
]  1.597MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Downloading', 'progressDetail': {'current': 2137335, 'total': 152137719}, 'progress': '[>                                   
]  2.137MB/152.1MB', 'id': '30babffc8f09'}
...
...
{'status': 'Downloading', 'progressDetail': {'current': 103782662, 'total': 152137719}, 'progress': 
'[==================================>                ]  103.8MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Downloading', 'progressDetail': {'current': 104319238, 'total': 152137719}, 'progress': 
'[==================================>                ]  104.3MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Downloading', 'progressDetail': {'current': 104851718, 'total': 152137719}, 'progress': 
'[==================================>                ]  104.9MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Downloading', 'progressDetail': {'current': 105392390, 'total': 152137719}, 'progress': 
'[==================================>                ]  105.4MB/152.1MB', 'id': '30babffc8f09'}
...
...
{'status': 'Verifying Checksum', 'progressDetail': {}, 'id': '30babffc8f09'}
{'status': 'Download complete', 'progressDetail': {}, 'id': '30babffc8f09'}
{'status': 'Extracting', 'progressDetail': {'current': 557056, 'total': 152137719}, 'progress': '[>                                     
]  557.1kB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Extracting', 'progressDetail': {'current': 2228224, 'total': 152137719}, 'progress': '[>                                    
]  2.228MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Extracting', 'progressDetail': {'current': 3899392, 'total': 152137719}, 'progress': '[=>                                   
]  3.899MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Extracting', 'progressDetail': {'current': 5570560, 'total': 152137719}, 'progress': '[=>                                   
]  5.571MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Extracting', 'progressDetail': {'current': 7241728, 'total': 152137719}, 'progress': '[==>                                  
]  7.242MB/152.1MB', 'id': '30babffc8f09'}
...
...
{'status': 'Extracting', 'progressDetail': {'current': 107511808, 'total': 152137719}, 'progress': 
'[===================================>               ]  107.5MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Extracting', 'progressDetail': {'current': 108068864, 'total': 152137719}, 'progress': 
'[===================================>               ]  108.1MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Extracting', 'progressDetail': {'current': 109182976, 'total': 152137719}, 'progress': 
'[===================================>               ]  109.2MB/152.1MB', 'id': '30babffc8f09'}
{'status': 'Extracting', 'progressDetail': {'current': 110297088, 'total': 152137719}, 'progress': 
'[====================================>              ]  110.3MB/152.1MB', 'id': '30babffc8f09'}
...
...
{'status': 'Pull complete', 'progressDetail': {}, 'id': '30babffc8f09'}
{'status': 'Digest: sha256:694ae0bf54f96475b2dec18b1dd2c313405a7e73cda8467c71e1a222df15ffc6'}
{'status': 'Status: Downloaded newer image for athenaos/base:latest'}

It can be useful for third-party programs using Podman SDK to manage or show the progress process in a flexible manner.

Suggest potential solution

My proposal is to replace stream element and use the same ones used in docker pull API, that are:

  • status
  • progressDetails
    • current
    • total
  • progress
  • id

Have you considered any alternatives?

No response

Additional context

No response

@D3vil0p3r D3vil0p3r added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 21, 2024
@D3vil0p3r D3vil0p3r changed the title [FEATURE] Implement Progress Details in podman pull API as docker [FEATURE] Implement Progress Details in podman pull API as occurs in docker pull API Dec 21, 2024
@afbjorklund
Copy link
Contributor

@D3vil0p3r
Copy link
Author

@rhatdan I would like to have your feedback here

@rhatdan
Copy link
Member

rhatdan commented Dec 23, 2024

@mheon @Luap99 Ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants