Skip to content
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

koordetector: make koordetector run and compatible with different kernels #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

songtao98
Copy link
Contributor

Ⅰ. Describe what this PR does

This PR completes codes for koordetector to run with Dockerfile. The functionality of CPU schedule latency eBPF program is now available by this commit.

An eBPF CO-RE way is used to develop CSL collector. For developers' intention, you can follow belowing process to develop a eBPF program under koordetector's architecture:

  • First, code your eBPF kernel program with a .c file. (e.g. pkg/koordetector/util/ebpf/cpu_schedule_latency/csl.bpf.c)
  • Second, encapsulate this eBPF program with "github.com/cilium/ebpf" package and provide a go util(e.g. pkg/koordetector/util/cpu_schedule_latency/cpu_schedule_latency.go).
  • Third, use go generate to compile and generate .o file for your eBPF program. Files in pkg/koordetector/util/ebpf/headers can be used for that.
  • When koordetector runs, it finds vmlinux (by default in /sys/kernel/btf/vmlinux) file to re-location kernel information such as task_struct structure. If this fails (e.g. kernel < 5.2 does not has vmlinux in /sys/kernel/btf/vmlinux), the CSL collector will use vmlinux files in pkg/koordetector/util/ebpf/core.

For now, I added supporting vmlinux file of kernel vmlinux-4.19.91-27.4.al7.x86_64 in this PR. Vmlinux files for other kernels can be find in BTFhub, Anolis coolbpf or generate by pahole.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign zwzhang0107 after the PR has been reviewed.
You can assign the PR to them by writing /assign @zwzhang0107 in a comment when ready.

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

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

…nels

Signed-off-by: songtao98 <songtao2603060@gmail.com>
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (f9d3faf) 33.70% compared to head (8f239d9) 33.70%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #34   +/-   ##
=======================================
  Coverage   33.70%   33.70%           
=======================================
  Files           1        1           
  Lines          89       89           
=======================================
  Hits           30       30           
  Misses         58       58           
  Partials        1        1           
Flag Coverage Δ
unittests 33.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zwzhang0107
Copy link
Contributor

PTAL @zxustc @xueche

statesInformerConf := statesinformer.NewDefaultConfig()

statesInformer := statesinformer.NewStatesInformer(statesInformerConf, kubeClient, nodeName)
statesInformer := statesinformer.NewStatesInformer(config.StatesInformerConf, kubeClient, nodeName)
Copy link
Contributor

Choose a reason for hiding this comment

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

now we can consider import statesinformer pkg from koordlet directly?

context *framework.Context
}

func NewMetricAdvisor(cfg *framework.Config, statesInformer statesinformer.StatesInformer) MetricAdvisor {
Copy link
Contributor

Choose a reason for hiding this comment

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

use the MetricAdvisor from koordlet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants