docker-tools icon indicating copy to clipboard operation
docker-tools copied to clipboard

Add image/layer size to image-info and ingest in Kusto

Open lbussell opened this issue 10 months ago • 3 comments

Fixes #745

lbussell avatar Feb 21 '25 23:02 lbussell

It has occurred to me that we might need to bootstrap this somehow. Since we changed the image-info model, the new version of ImageBuilder probably won't be able to deserialize any current image-info.json files.

lbussell avatar Feb 24 '25 16:02 lbussell

At the same time, we'd need to update all image-infos and ImageBuilder versions at once, since the docker-tools repo handles queueing rebuilds and downstream repos handle publishing the image infos.

It might be better to update the model to support reading both the old and new models (list of string vs. list of Layer objects).

lbussell avatar Feb 24 '25 16:02 lbussell

I think the correct approach for this would be to increment the SchemaVersion on ImageArtifactDetails:

https://github.com/dotnet/docker-tools/blob/71f2d6afc7f014edce35f9a0562c127116eedde7/src/Microsoft.DotNet.ImageBuilder/src/Models/Image/ImageArtifactDetails.cs#L9-L15

Then I think we'd implement a custom JsonConverter<T> for either ImageArtifactDetails or PlatformInfo. When we encounter a "1.0" SchemaVersion we'd convert it to the new format. Need to think about it some more!

lbussell avatar Feb 27 '25 17:02 lbussell