Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

build metrics compatibility for next 22.06 #2151

Merged
merged 1 commit into from Jul 27, 2022

Conversation

crazy-max
Copy link
Member

follow-up docker/cli#3314 and #2104

Ensures build metrics are future proof for the next Docker major release.

To detect if buildx will be used while typing docker build ..., we need to check the current docker cli version. I don't think there is another simple way, besides creating an infamous custom dimension in Looker. 馃槄

cc @tonistiigi @chris-crone @gtardif @mat007

Signed-off-by: CrazyMax crazy-max@users.noreply.github.com

cli/main.go Outdated Show resolved Hide resolved
cli/metrics/metadata/build.go Outdated Show resolved Hide resolved
@crazy-max crazy-max marked this pull request as draft May 23, 2022 17:11
@crazy-max
Copy link
Member Author

converting to draft for now. after discussing with @tonistiigi, calling docker version to retrieve cli version for build metadata adds more overhead (~80ms). will take a look at a better alternative.

@crazy-max crazy-max marked this pull request as ready for review June 13, 2022 08:51
cli/metrics/metrics.go Outdated Show resolved Hide resolved
@crazy-max crazy-max mentioned this pull request Jul 23, 2022
@crazy-max crazy-max marked this pull request as draft July 24, 2022 07:02
@crazy-max
Copy link
Member Author

crazy-max commented Jul 25, 2022

Switch from shelling out to retrieve docker cli version by using the debug/buildinfo module. Atm docker cli strips DWARF symbol table so will be empty for cli < 22.06 but will be solved by docker/cli#3717.

PTAL @mat007 @rumpl @glours

@crazy-max crazy-max marked this pull request as ready for review July 25, 2022 13:31
@crazy-max crazy-max requested review from rumpl and mat007 July 25, 2022 13:31
@crazy-max crazy-max force-pushed the build-metrics-futureproof branch 4 times, most recently from 8182ed4 to 69495d8 Compare July 25, 2022 19:45
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@nicksieger nicksieger merged commit 6135c5e into docker:main Jul 27, 2022
@crazy-max crazy-max deleted the build-metrics-futureproof branch July 27, 2022 17:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants