-
Notifications
You must be signed in to change notification settings - Fork 26
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
improve logging in lock generation #338
Conversation
twoliter/src/lock.rs
Outdated
let embedded_kit_metadata = stream::iter(manifest_list.manifests) | ||
.map(|manifest| async move { | ||
let image_uri = format!("{}/{}@{}", vendor.registry, image.name, manifest.digest); | ||
EncodedKitMetadata::try_from_image(&image_uri, image_tool).await | ||
}) |
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.
Is the Docker image tool going to be robust for parallel invocations?
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.
It seems to support it (based on my own testing and a lack of warnings found online), but since a pull can result in many parallel layer pulls, 8 is probably too generous of a limit.
I also don't know if the parallel pulls collapse common layers into a single request (I'm guessing not), but the images won't really have layers in common anyways, since they are different architectures.
My real goal here was to separate the kit metadata fetch from the check that the metadata was consistent across images as a clarity change. The parallelism was added as a bonus. I wouldn't be opposed to removing it. For now, I'll just lower it.
^ Remove concurrent image procedures. Potential instability is probably not worth the potential performance improvement. |
^ Force push to rebase |
Description of changes:
I had a
twoliter update
fail and it was difficult to determine why, so I've added additional logging to lockfile generation. I've also done some minor refactoring of the Kit metadata extraction code that threw the error in question.This (potentially controversially) adds a dependency on the
tracing
crate. Here's why I like this dependency:trace
-level logs for each function call using theinstrument
macrolog
crate for output, or optionally allows more complex IO via thesubscriber
concept.Here's an example:
Testing done:
make build
succeedstwoliter update
emits helpful logs on failuretwoliter update
succeeds within existing workspacesTerms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.