Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@openshift-cherrypick-robot

This is an automated cherry-pick of #4470

/assign fidencio

None

There's no reason for us to keep maintaining our own copy of typeurl,
let's directly rely on the `github.com/containerd/typeurl` instead.

Signed-off-by: Fabiano Fidêncio <[email protected]>
As this function is only used by runtimeVM::ContainerStats(), let's move
it to the runtime_vm.go file, making our life easier when doing upcoming
changes on runtimeVM::ContainerStats().

Signed-off-by: Fabiano Fidêncio <[email protected]>
CRI-O has been using `containers/libpod/pkg/cgroups` in order to get
metrics and, later on, convert it to CRI Stats. Although this approach
is fine (and desired) for the OCI runtime type. we can't rely on that
for the VM runtime type as the data sent by Kata Containers comes from
`containerd/cgroup`.

Signed-off-by: Fabiano Fidêncio <[email protected]>
WorkingSetBytes is the bit that needs to be set in order to provide
kubelet the pod's memory information.

Although it's calculated in a slightly different way for "oci" runtime
type, the logic is quite similar for the "vm" runtime type, with the
only difference being where the TotalInactiveFile information comes
from.

This is the last bit needed in order to have `kubectl top pod $pod`
working, as shown below:
```
[fidencio@localhost cri-o]$ kubectl get pods
NAME             READY   STATUS    RESTARTS   AGE
example-fedora   1/1     Running   0          130m

[fidencio@localhost cri-o]$ kubectl get pod example-fedora -o yaml | grep runtimeClassName
      {"apiVersion":"v1","kind":"Pod","metadata":{"annotations":{},"labels":{"app":"example-fedora-app"},"name":"example-fedora","namespace":"default"},"spec":{"containers":[{"args":["-m","http.server","8080"],"command":["python3"],"image":"fedora:33","name":"example-fedora","ports":[{"containerPort":8080}]}],"runtimeClassName":"kata"}}
        f:runtimeClassName: {}
  runtimeClassName: kata

[fidencio@localhost cri-o]$ kubectl top pod
NAME             CPU(cores)   MEMORY(bytes)
example-fedora   1m           9Mi
```

Signed-off-by: Fabiano Fidêncio <[email protected]>
@openshift-ci-robot openshift-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Apr 19, 2021
@openshift-ci-robot openshift-ci-robot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Apr 19, 2021
@codecov
Copy link

codecov bot commented Apr 19, 2021

Codecov Report

Merging #4776 (0d7e8f7) into release-1.21 (bc1ef35) will decrease coverage by 0.03%.
The diff coverage is 0.00%.

❗ Current head 0d7e8f7 differs from pull request most recent head 904f7cd. Consider uploading reports for the commit 904f7cd to get more accurate results

@@               Coverage Diff                @@
##           release-1.21    #4776      +/-   ##
================================================
- Coverage         43.09%   43.05%   -0.04%     
================================================
  Files               107      107              
  Lines              9754     9763       +9     
================================================
  Hits               4203     4203              
- Misses             5098     5107       +9     
  Partials            453      453              

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: openshift-cherrypick-robot, 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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 19, 2021
@TomSweeneyRedHat
Copy link
Contributor

LGTM
assuming happy tests

@haircommander
Copy link
Member

/retest
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 21, 2021
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 21, 2021

@openshift-cherrypick-robot: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/openshift-jenkins/e2e_crun_cgroupv2 904f7cd link /test e2e_cgroupv2

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 69b1b01 into cri-o:release-1.21 Apr 21, 2021
@openshift-ci openshift-ci bot mentioned this pull request Mar 15, 2022
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-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants