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

dtr statistics are emptry #2

Open
sagiru opened this issue Jun 2, 2020 · 3 comments
Open

dtr statistics are emptry #2

sagiru opened this issue Jun 2, 2020 · 3 comments

Comments

@sagiru
Copy link

sagiru commented Jun 2, 2020

Hi,

does anybody use this script to get statistics from a docker trusted registry? If i try to do this i get only an empty output.

...docker/registry/v2> docker-registry-statistics . statistics
2020-06-02 10:53:47,663 INFO Summary counts
2020-06-02 10:53:47,663 INFO >> Total repositories: 0
2020-06-02 10:53:47,663 INFO >> Total tags: 0
2020-06-02 10:53:47,664 INFO >> Total images: 0 (Tagged: 0, Untagged: 0)
2020-06-02 10:53:47,664 INFO >> Total blobs: 0
2020-06-02 10:53:47,664 INFO Summary sizes
2020-06-02 10:53:47,664 INFO >> Total images size: 0B
2020-06-02 10:53:47,664 INFO >> Tagged images size: 0B
2020-06-02 10:53:47,664 INFO >> Un-tagged images size: 0B
2020-06-02 10:53:47,664 INFO Blobs
2020-06-02 10:53:47,665 INFO >> Counts: Total 0, Manifests: 0, Image configs: 0, Compressed data: 0

Regards
Sascha

@thetuxkeeper
Copy link

Hi @sagiru,

I had the same problem. You have to use the base directory of "docker/registry/v2". In your case just "cd ../../.." and try again.

Regards
Daniel

@pbabics
Copy link
Owner

pbabics commented Jun 30, 2020

Hello, thanks for answer, let me know if it works I will add it to documentation

@sagiru
Copy link
Author

sagiru commented Jul 9, 2020

Hi @thetuxkeeper ,

thx for the hint. Now it will find some repositories but the statistics arent't useful and and the end it will fail with with a KeyError:

(foo3.8) syssgirr@sl310:/data/dtr_data/docker/registry/v2> cd ../../..
(foo3.8) syssgirr@sl310:/data/dtr_data> docker-registry-statistics . statistics
2020-07-09 10:23:24,915 INFO Repository '***demo'
2020-07-09 10:23:24,915 INFO >> Total images: Count: 3, Size: 0B
2020-07-09 10:23:24,915 INFO >> Tagged images: Count: 3, Size: 0B
2020-07-09 10:23:24,915 INFO >> Un-tagged images: Count 0, Size: 0B
2020-07-09 10:23:24,916 INFO Repository '***demo'
2020-07-09 10:23:24,916 INFO >> Total images: Count: 3, Size: 0B
2020-07-09 10:23:24,916 INFO >> Tagged images: Count: 3, Size: 0B
2020-07-09 10:23:24,916 INFO >> Un-tagged images: Count 0, Size: 0B
2020-07-09 10:23:24,916 INFO Repository '***fahrkosten'
2020-07-09 10:23:24,916 INFO >> Total images: Count: 1, Size: 0B
2020-07-09 10:23:24,916 INFO >> Tagged images: Count: 1, Size: 0B
2020-07-09 10:23:24,916 INFO >> Un-tagged images: Count 0, Size: 0B
...
Traceback (most recent call last):
File "/home/erz/syssgirr/Python-3.8.3/foo3.8/bin/docker-registry-statistics", line 11, in
load_entry_point('docker-registry-statistics', 'console_scripts', 'docker-registry-statistics')()
File "/home/erz/syssgirr/Python-3.8.3/foo3.8/lib/python3.8/site-packages/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/home/erz/syssgirr/Python-3.8.3/foo3.8/lib/python3.8/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/erz/syssgirr/Python-3.8.3/foo3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/erz/syssgirr/Python-3.8.3/foo3.8/lib/python3.8/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/erz/syssgirr/Python-3.8.3/foo3.8/lib/python3.8/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/erz/syssgirr/Python-3.8.3/foo3.8/lib/python3.8/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/erz/syssgirr/docker-registry-statistics/docker_registry_statistics/commands/statistics.py", line 81, in statistics
+ sum(
File "/home/erz/syssgirr/docker-registry-statistics/docker_registry_statistics/commands/statistics.py", line 82, in
blob_loader.blobs[layer].size
KeyError: 'sha256:9f8e43b11485847a68f3e0b7394039310248d5f08399ec0e4f57ed719499ce4a'

Regards
Sascha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants