-
Notifications
You must be signed in to change notification settings - Fork 54
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
osbuildmonitor: add new package to monitor osbuild output #1047
Conversation
1b72324
to
f09dee0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments from a quick review.
Why not add support for it directly here in osbuild.RunOSBuild? Note that this function is used by osbuild-composer, so changing it will need changes when it's integrated there, but that is a central point to add support for this I think and it can then be immediately tested with |
Also, since all interfaces to osbuild live in |
I like it and it fits well into As for the integration with |
1dfc5d6
to
0d17683
Compare
This commit contains an abreviated version of an osbuild jsonseq output log. Most of the repetitive data from the curl and rpm stages got removed as they don't add (much) to the understanding. The data was generated via: ``` $ sudo python3 -m osbuild --libdir . --monitor JSONSeqMonitor \ --export image --output-directory /tmp/out \ ./test/data/manifests/fedora-boot.json > osbuild-status-output.json ```
This commit adds support for scanning/parsing the jsonseq based monitoring that osbuild provides. This is useful for machine readable status reporting and progress information for e.g. `bootc-image-builder`. The API consists of a new `osbuild.Status` struct that contains parsed details about the osbuild status/progress and a scanner that can scan a stream of osbuild jsonseq based progress and emit `osbuild.Status` structs. Note that the status is broadly of two categories: 1. information amining at a user interface (like `status.Message` or `status.Progress`) 2. low-level details for logging/error reporting (like `status.Trace` and `status.Timestamp` Note that error handline a bit weak right now. The consumer of the API will not get an error via the monitor currently but only know that something went wrong from osbuild exiting and then the consumer needs to reconstruct the error log from the trace messages. This is not a show-stopper but we could improve this by merging osbuild/osbuild#1831 and adding `Result` to the `statusJSON` and `Status` (but this needs more thinking and probably best done in followups). See https://github.com/osbuild/bootc-image-builder/compare/main...mvo5:progress3?expand=1 how this will be used.
0d17683
to
288dfbb
Compare
I've wondered once or twice if it would be cleaner for each stage to be its own subpackage, but I think that's a bit much. Maybe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it!
This commit adds support for scanning/parsing the jsonseq based
monitoring that osbuild provides. This is useful for machine
readable status reporting and progress information for e.g.
bootc-image-builder
.The API consists of a new
osbuild.Status
struct that containsparsed details about the osbuild status/progress and a scanner
that can scan a stream of osbuild jsonseq based progress and
emit
osbuild.Status
structs.Note that the status is broadly of two categories:
status.Message
orstatus.Progress
)status.Trace
andstatus.Timestamp
Note that error handline a bit weak right now. The consumer
of the API will not get an error via the monitor currently
but only know that something went wrong from osbuild exiting
and then the consumer needs to reconstruct the error log from
the trace messages. This is not a show-stopper but we could
improve this by merging osbuild/osbuild#1831
and adding
Result
to thestatusJSON
andStatus
(but thisneeds more thinking and probably best done in followups).
See https://github.com/osbuild/bootc-image-builder/compare/main...mvo5:progress3?expand=1 how this will be used.
Note that the provided information is intentionally small right now,
we will need to go over the osbuild implementation and see if we
should improve things here too (c.f. 1831) but it's a good starting
point I think.
The two main use-cases this should cover right now: