-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ovirt-img: Machine readable progress #154
Comments
yes, the easiest way for the UI to track progress will be using the cr status (via some condition or a specific status field) |
An actual sample of an early implementation:
Printed to stderr. How does that look? |
This is API for a program, so we don't need to use human readable size and rate. It is better to report values in bytes and bytes per second. The program consuming this info can convert I suggest this format:
The program consuming this API can compute the rate (done/elapsed) or the progress (done / size * 100). This way the program can control the way values are displayed. For example, display the progress in integer percents or float, size in bytes/s, KiB/s, or GiB/s based on the number, or using always the same unit (engine style). |
Add --json option to ovirt-img, so that the output is printed to stderr in json format, in a consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --json <disk_id> download.raw {"progress": 0, "description": "creating transfer", "done": 0, "elapsed": 0.0}, {"progress": 0, "description": "downloading image", "done": 0, "elapsed": 2.69}, {"progress": 0, "description": "downloading image", "done": 0, "elapsed": 2.74}, {"progress": 0, "description": "downloading image", "done": 983040, "elapsed": 2.74}, {"progress": 2, "description": "downloading image", "done": 130613248, "elapsed": 2.74}, ... {"progress": 99, "description": "downloading image", "done": 6382944256, "elapsed": 7.88}, {"progress": 100, "description": "downloading image", "done": 6442450944, "elapsed": 7.9}, {"progress": 100, "description": "finalizing transfer", "done":6442450944, "elapsed": 7.94}, {"progress": 100, "description": "download completed", "done": 6442450944, "elapsed": 16.09}, {"progress": 100, "description": "download completed", "done": 6442450944, "elapsed": 16.09} Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --json option to ovirt-img, so that the output is printed to stderr in json format, in a consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --json <disk_id> download.raw {"progress": 0, "description": "creating transfer", "done": 0, "elapsed": 0.0}, {"progress": 0, "description": "downloading image", "done": 0, "elapsed": 2.69}, {"progress": 0, "description": "downloading image", "done": 0, "elapsed": 2.74}, {"progress": 0, "description": "downloading image", "done": 983040, "elapsed": 2.74}, {"progress": 2, "description": "downloading image", "done": 130613248, "elapsed": 2.74}, ... {"progress": 99, "description": "downloading image", "done": 6382944256, "elapsed": 7.88}, {"progress": 100, "description": "downloading image", "done": 6442450944, "elapsed": 7.9}, {"progress": 100, "description": "finalizing transfer", "done":6442450944, "elapsed": 7.94}, {"progress": 100, "description": "download completed", "done": 6442450944, "elapsed": 16.09}, {"progress": 100, "description": "download completed", "done": 6442450944, "elapsed": 16.09} Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --json option to ovirt-img, so that the output is printed to stderr in json format, in a consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --json <disk_id> download.raw {"progress": 0, "description": "creating transfer", "done": 0, "elapsed": 0.0}, {"progress": 0, "description": "downloading image", "done": 0, "elapsed": 2.69}, {"progress": 0, "description": "downloading image", "done": 0, "elapsed": 2.74}, {"progress": 0, "description": "downloading image", "done": 983040, "elapsed": 2.74}, {"progress": 2, "description": "downloading image", "done": 130613248, "elapsed": 2.74}, ... {"progress": 99, "description": "downloading image", "done": 6382944256, "elapsed": 7.88}, {"progress": 100, "description": "downloading image", "done": 6442450944, "elapsed": 7.9}, {"progress": 100, "description": "finalizing transfer", "done":6442450944, "elapsed": 7.94}, {"progress": 100, "description": "download completed", "done": 6442450944, "elapsed": 16.09}, {"progress": 100, "description": "download completed", "done": 6442450944, "elapsed": 16.09} Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --json option to ovirt-img, so that the output is printed to stderr in json format, in a consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --json <disk_id> download.raw {"progress": 0, "description": "creating transfer", "done": 0, "elapsed": 0.0}, {"progress": 0, "description": "downloading image", "done": 0, "elapsed": 2.69}, {"progress": 0, "description": "downloading image", "done": 0, "elapsed": 2.74}, {"progress": 0, "description": "downloading image", "done": 983040, "elapsed": 2.74}, {"progress": 2, "description": "downloading image", "done": 130613248, "elapsed": 2.74}, ... {"progress": 99, "description": "downloading image", "done": 6382944256, "elapsed": 7.88}, {"progress": 100, "description": "downloading image", "done": 6442450944, "elapsed": 7.9}, {"progress": 100, "description": "finalizing transfer", "done":6442450944, "elapsed": 7.94}, {"progress": 100, "description": "download completed", "done": 6442450944, "elapsed": 16.09}, {"progress": 100, "description": "download completed", "done": 6442450944, "elapsed": 16.09} Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Some notes I missed in the previous comment:
|
@bennyz can you check this issue and make sure it will work for you? Trying to use this before we release will be best. |
I agree with #154 (comment)
|
This style is not consistent with the project style. We use the term "transferred" The k8s resource can have more verbose names matching other names in k8s. The tool |
I'd vote for But I agree in that |
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --json <disk_id> download.raw ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --json <disk_id> download.raw ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "human"" output. Related: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "human"" output. Related: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "human"" output. Related: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "human"" output. Related: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "text" output. Related: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw {"transferred": 0, elapsed: 0.0, "description": "setting up"} ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "text" output. Related: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw {"transferred": 0, elapsed: 0.0, "description": "setting up"} ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw {"transferred": 0, elapsed: 0.0, "description": "setting up"} ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "text" output. Related: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw {"transferred": 0, elapsed: 0.0, "description": "setting up"} ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: oVirt#154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "text" output. Related: #154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw {"transferred": 0, elapsed: 0.0, "description": "setting up"} ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: #154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add --output option to ovirt-img, so that the output format for the progress is set from the CLI. Only supported format for the initial version is "text" output. Related: #154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Add json as an output option, to print the progress in jsonlines[1] format. A consistent machine readable format, that can be later parsed. $ ovirt-img download-disk -c engine --output json <disk_id> download.raw {"transferred": 0, elapsed: 0.0, "description": "setting up"} ... {"transferred": 249561088, "size": 261095424, elapsed: 1.234567, "description": "downloading image"} {"transferred": 256901120, "size": 261095424, elapsed: 1.345678, "description": "downloading image"} {"transferred": 261095424, "size": 261095424, elapsed: 1.456789, "description": "finalizing transfer"} ... [1] https://jsonlines.org/ Fixes: #154 Signed-off-by: Albert Esteve <aesteve@redhat.com>
Support machine readable progress, usable by program running ovirt-img.
When running ovirt-img with a command line option, it will output progress info to stdout
in jsonlines format:
Program using ovirt-img will read stdout line by line, parsing the json message from each line.
Fields:
size
: int64, optional. Imageio know the size only after connecting to imageio server. During the first few seconds when the size is unknown, the system cannot report any progress value.transferred
: int64, requiredelapsed
: float, requireddescription
: string, requiredMTV use case
It can work like this:
Add progress info to the CRD related to the import job
Example yaml fragment:
The UI watches the CR during the transfer
The program running ovirt-img read progress line and update the import CR status
The UI update progress bar based on CR change events
The text was updated successfully, but these errors were encountered: