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

SDN-5393: eBPF agent intg with bpfman for ebpf progs life cycle mgmts #443

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

Conversation

msherif1234
Copy link
Contributor

@msherif1234 msherif1234 commented Oct 29, 2024

Description

prepare ebpf agent to use bpfman to manage netobserv ebpf programs

Dependencies

netobserv/network-observability-operator#829

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Oct 29, 2024

@msherif1234: This pull request references SDN-5393 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

Description

prepare ebpf agent to use bpfman to manage netobserv ebpf programs

Dependencies

n/a

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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 openshift-eng/jira-lifecycle-plugin repository.

Copy link

openshift-ci bot commented Oct 29, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from msherif1234. For more information see the Kubernetes Code Review Process.

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

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 1.42857% with 207 lines in your changes missing coverage. Please review.

Project coverage is 29.23%. Comparing base (626d526) to head (9bd714a).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pkg/tracer/tracer.go 0.00% 189 Missing ⚠️
pkg/agent/packets_agent.go 0.00% 13 Missing ⚠️
pkg/agent/agent.go 37.50% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #443      +/-   ##
==========================================
- Coverage   29.71%   29.23%   -0.48%     
==========================================
  Files          50       50              
  Lines        4877     4959      +82     
==========================================
+ Hits         1449     1450       +1     
- Misses       3322     3403      +81     
  Partials      106      106              
Flag Coverage Δ
unittests 29.23% <1.42%> (-0.48%) ⬇️

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

Files with missing lines Coverage Δ
pkg/agent/config.go 8.33% <ø> (ø)
pkg/agent/agent.go 33.74% <37.50%> (-0.01%) ⬇️
pkg/agent/packets_agent.go 0.00% <0.00%> (ø)
pkg/tracer/tracer.go 0.00% <0.00%> (ø)

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Oct 29, 2024

@msherif1234: This pull request references SDN-5393 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.18.0" version, but no target version was set.

In response to this:

Description

prepare ebpf agent to use bpfman to manage netobserv ebpf programs

Dependencies

netobserv/network-observability-operator#829

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Will this change affect NetObserv / Network Observability operator? If not, you can ignore the rest of this checklist.
  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

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 openshift-eng/jira-lifecycle-plugin repository.

@msherif1234 msherif1234 force-pushed the bpfman_intg branch 2 times, most recently from eed3217 to 7b5953d Compare October 30, 2024 11:21
@msherif1234 msherif1234 marked this pull request as draft October 30, 2024 12:58
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Oct 30, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:af27118

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=af27118 make set-agent-image

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Oct 30, 2024
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Oct 30, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:dc5079c

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=dc5079c make set-agent-image

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Oct 31, 2024
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Oct 31, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:b04ad60

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=b04ad60 make set-agent-image

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Oct 31, 2024
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Oct 31, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:4b53105

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=4b53105 make set-agent-image

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 6, 2024
Copy link

github-actions bot commented Nov 6, 2024

New image:
quay.io/netobserv/netobserv-ebpf-agent:469ccb5

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=469ccb5 make set-agent-image

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 11, 2024
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 11, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:194fdb1

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=194fdb1 make set-agent-image

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 11, 2024
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 11, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:4ab660f

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=4ab660f make set-agent-image

@msherif1234 msherif1234 marked this pull request as ready for review November 11, 2024 16:11
@msherif1234 msherif1234 changed the title WIP: SDN-5393: eBPF agent intg with bpfman for ebpf progs life cycle mgmts SDN-5393: eBPF agent intg with bpfman for ebpf progs life cycle mgmts Nov 11, 2024
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 11, 2024
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 11, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:3ca4ab3

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=3ca4ab3 make set-agent-image

@@ -40,4 +40,4 @@ spec:
- name: bpf-kernel-debug
hostPath:
path: /sys/kernel/debug
type: Directory
type: Directory
Copy link

Choose a reason for hiding this comment

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

Was there a reason to change this file and remove the linefeed char?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no reason I was just doing some changes there but reverted once found a way to work in none privileged mode will revert the whitespace changes

@@ -38,4 +38,4 @@ spec:
- name: bpf-kernel-debug
hostPath:
path: /sys/kernel/debug
type: Directory
type: Directory
Copy link

Choose a reason for hiding this comment

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

Same here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same

\"kfree_skb\":\"tracepoint\",\
\"rh_network_events_monitoring\":\"kprobe\"\
}"

Copy link

@stleerh stleerh Nov 12, 2024

Choose a reason for hiding this comment

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

This could be a lot more readable if you remove all backslashes and use a single quote around the entire string like this:

PROGRAMS='{
"tcx_ingress_flow_parse":"tcx",
"tcx_egress_flow_parse":"tcx",
"tc_ingress_flow_parse":"tc",
"tc_egress_flow_parse":"tc",
"tcx_ingress_pca_parse":"tcx",
"tcx_egress_pca_parse":"tcx",
"tc_ingress_pca_parse":"tc",
"tc_egress_pca_parse":"tc",
"tcp_rcv_fentry":"fentry",
"tcp_rcv_kprobe":"kprobe",
"kfree_skb":"tracepoint",
"rh_network_events_monitoring":"kprobe"
}'

Note: Each new line does add a space and the only way to get rid of that is to put it all on the same line, which is undesirable. Most likely, the spaces won't matter if you quote the variable like "$PROGRAM".

\"dns_flows\":\"hash\",\
\"global_counters\":\"per_cpu_array\",\
\"filter_map\":\"lpm_trie\"\
}"
Copy link

Choose a reason for hiding this comment

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

Similar to above.

MAPS='{
"direct_flows":"ringbuf",
"aggregated_flows":"per_cpu_hash",
"packets_record":"perf_event_array",
"dns_flows":"hash",
"global_counters":"per_cpu_array",
"filter_map":"lpm_trie"
}'

if !cfg.UseEbpfManager {
if err := rlimit.RemoveMemlock(); err != nil {
log.WithError(err).
Warn("can't remove mem lock. The agent could not be able to start eBPF programs")
Copy link

Choose a reason for hiding this comment

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

I know this was existing code. I think the message is suppose to say:
The agent might not be able to start the eBPF programs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The agent will not be able to start the eBPF programs. WDYT?

Signed-off-by: Mohamed Mahmoud <mmahmoud@redhat.com>
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 12, 2024
@msherif1234
Copy link
Contributor Author

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Nov 12, 2024
Copy link

New image:
quay.io/netobserv/netobserv-ebpf-agent:cb970b1

It will expire after two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=cb970b1 make set-agent-image

@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira/valid-reference needs-rebase ok-to-test To set manually when a PR is safe to test. Triggers image build on PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants