Skip to content

Conversation

@saschagrunert
Copy link
Member

@saschagrunert saschagrunert commented Oct 22, 2019

We now add a new set of image pull metrics, which collect the transferred
bytes per image name or digest every second during an image pull. We
also add a metric which collects the skipped bytes if an image has
already been downloaded.

This fixes the ignored command line parameters for the metrics, too.

Example output from the metrics server:

  1. Download the image
  2. Remove the image, download it again
  3. Download the already existing image
# HELP container_runtime_crio_image_pulls_by_digest Bytes transferred by CRI-O image pulls by digest
# TYPE container_runtime_crio_image_pulls_by_digest counter
container_runtime_crio_image_pulls_by_digest{digest="sha256:2f1a357cf2898f6700b74d933e1784a348df8f719c4db77203423e63b538de9b",mediatype="application/vnd.docker.container.image.v1+json",name="docker.io/nixos/nix",size="5127"} 10254
container_runtime_crio_image_pulls_by_digest{digest="sha256:480223332b134112f7f7f1292789ae19b695c1329a7180200ae82778fab59e95",mediatype="",name="docker.io/nixos/nix",size="277005"} 554010
container_runtime_crio_image_pulls_by_digest{digest="sha256:74bc3bbbef74304d58600283df51bab6a3dbe9b1ec939bd9f5db7b3c87cfb612",mediatype="",name="docker.io/nixos/nix",size="60336471"} 1.20672942e+08
container_runtime_crio_image_pulls_by_digest{digest="sha256:9d48c3bd43c520dc2784e868a780e976b207cbf493eaff8c6596eb871cbd9609",mediatype="",name="docker.io/nixos/nix",size="2789669"} 5.579338e+06
# HELP container_runtime_crio_image_pulls_by_name Bytes transferred by CRI-O image pulls by name
# TYPE container_runtime_crio_image_pulls_by_name counter
container_runtime_crio_image_pulls_by_name{name="docker.io/nixos/nix",size="63408272"} 1.26816544e+08
# HELP container_runtime_crio_image_pulls_by_name_skipped Bytes skipped by CRI-O image pulls by name
# TYPE container_runtime_crio_image_pulls_by_name_skipped counter
container_runtime_crio_image_pulls_by_name_skipped{name="docker.io/nixos/nix"} 1.91975283e+08

Closes #2757
Related change: containers/image#732
Discussion on SIG Node: https://groups.google.com/forum/#!topic/kubernetes-sig-node/JHEus_TlZzA

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Oct 22, 2019
@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 22, 2019
@saschagrunert
Copy link
Member Author

/test e2e_fedora

@saschagrunert saschagrunert changed the title WIP: Add image pull metrics Extend image pull metrics Oct 23, 2019
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 23, 2019
@saschagrunert
Copy link
Member Author

/hold

needs #2915 and the vendored changes to containers/image

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 23, 2019
@saschagrunert
Copy link
Member Author

Looks good for now, but still needs containers/image#738 to proceed.

@saschagrunert
Copy link
Member Author

This is ready for a first review. I think I will add some integration tests for it as well later on.

@saschagrunert
Copy link
Member Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Nov 22, 2019
@saschagrunert saschagrunert force-pushed the pull-metrics branch 2 times, most recently from b03c25a to 418a9b5 Compare November 23, 2019 02:27
@saschagrunert
Copy link
Member Author

/retest

@saschagrunert
Copy link
Member Author

PTAL @mrunalp @haircommander @rhatdan

@haircommander
Copy link
Member

PTAL @smarterclayton

@haircommander
Copy link
Member

PTAL @vrothberg @mtrmac

@saschagrunert
Copy link
Member Author

saschagrunert commented Jan 9, 2020

Ping anyone wants to review this to unblock 1.17? 😇 @mrunalp @vrothberg @rhatdan @haircommander

wg := &sync.WaitGroup{}
progress := make(chan types.ProgressProperties)
wg.Add(1)
go func() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Absolutely non-blocking: As an absolutely worthless personal opinion, I tend to avoid nested functions; moving them out makes the body shorter, and allows writing independent unit tests.

OTOH inlining them reads closer to a straight-line code. Feel completely free to leave this as is, as long as this is an intentional choice.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point and would generally agree. In this example I'd like to stick to the current approach to make the code easier to understand when having the critical parts close to each other :)

@saschagrunert
Copy link
Member Author

Thanks for the review @mtrmac, I applied my review related fixes in a dedicated commit on top of this PR. PTAL

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more thing about the goroutine.

We now add a new set of image pull metrics, which collect the transferred
bytes per image name or digest every second during an image pull. We
also add a metric which collects the skipped bytes if an image has
already been downloaded.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
@saschagrunert
Copy link
Member Author

I rebased on top of the latest master because this PR was a bit outdated.

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM.

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mtrmac, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mtrmac, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@saschagrunert
Copy link
Member Author

/retest

@haircommander
Copy link
Member

LGTM

@rhatdan
Copy link
Contributor

rhatdan commented Jan 15, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2020
@saschagrunert
Copy link
Member Author

/retest

@saschagrunert
Copy link
Member Author

/test integration_rhel

@saschagrunert
Copy link
Member Author

/test kata-containers

@openshift-merge-robot openshift-merge-robot merged commit 7151931 into cri-o:master Jan 16, 2020
@saschagrunert saschagrunert deleted the pull-metrics branch January 16, 2020 11:11
@saschagrunert
Copy link
Member Author

/cherrypick release-1.17

@openshift-cherrypick-robot

@saschagrunert: failed to push cherry-picked changes in GitHub: pushing failed, output: "To https://github.com/openshift-cherrypick-robot/cri-o\n ! [remote rejected] cherry-pick-2912-to-release-1.17 -> cherry-pick-2912-to-release-1.17 (cannot lock ref 'refs/heads/cherry-pick-2912-to-release-1.17': reference already exists)\nerror: failed to push some refs to 'https://openshift-cherrypick-robot:CENSORED@github.com/openshift-cherrypick-robot/cri-o'\n", error: exit status 1

Details

In response to this:

/cherrypick release-1.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-cherrypick-robot

@saschagrunert: new pull request created: #3122

Details

In response to this:

/cherrypick release-1.17

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-1.17 size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image pull metrics

7 participants