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

WIP NETOBSERV-1471 add tcp write stage #604

Closed
wants to merge 1 commit into from

Conversation

jpinsonneau
Copy link
Collaborator

@jpinsonneau jpinsonneau commented Feb 21, 2024

Description

This PR adds TCP write stage to FLP.
We need to decide if we move to gRPC instead before merging.

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).

Copy link

openshift-ci bot commented Feb 21, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link

openshift-ci bot commented Feb 21, 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 jpinsonneau. 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 Feb 21, 2024

Codecov Report

Attention: 36 lines in your changes are missing coverage. Please review.

Comparison is base (831e2ad) 66.06% compared to head (7dec780) 65.77%.
Report is 3 commits behind head on main.

Files Patch % Lines
pkg/pipeline/write/write_tcp.go 0.00% 30 Missing ⚠️
pkg/config/pipeline_builder.go 0.00% 2 Missing ⚠️
pkg/config/stage_params.go 0.00% 2 Missing ⚠️
pkg/pipeline/pipeline_builder.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
- Coverage   66.06%   65.77%   -0.29%     
==========================================
  Files         103      104       +1     
  Lines        7509     7545      +36     
==========================================
+ Hits         4961     4963       +2     
- Misses       2255     2290      +35     
+ Partials      293      292       -1     
Flag Coverage Δ
unittests 65.77% <0.00%> (-0.29%) ⬇️

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.

@@ -0,0 +1,69 @@
/*
* Copyright (C) 2021 IBM, Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fix (or remove) Copyright statement

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is coming from both eBPF packets exporter and flp stdout write stage 😄

I just copied the code from there but I can remove the copyright if you want.

Comment on lines +57 to +62
l, err := net.Listen("tcp", writeTCP.address)
if err != nil {
return nil, err
}
defer l.Close()
clientConn, err := l.Accept()
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like you are expecting some other entity to initiate a TCP connection to FLP to which FLP will write its flow logs.
The code will block here until a single connection is completed. The rest of FLP will wait on this connection. Is this the desired behavior?

What is the use case you have in mind?

What if I have multiple targets to which I want to send my data via TCP? Can I set up multiple writeTCP stages? How will it work? or do we want to put the listen() operation into a separate thread and accumulate the connections that were attempted and send flow logs to all current connections?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a temporary PR used in netobserv CLI: netobserv/network-observability-cli#2 (comment)

The CLI deploys eBPF agents using direct-flp mode which embedd flowlogs-pipeline into the same pods.
Currently the connection between these pods and cli is made using TCP after calling oc port-forward commands.
Using gRPC instead is still in discussion.

If we keep that TCP implementation, we can indeed improve and makes the wait optionnal + allow multiple targets 👍

@jpinsonneau jpinsonneau mentioned this pull request Mar 4, 2024
11 tasks
@jpinsonneau
Copy link
Collaborator Author

Closing this in favor of #621

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

Successfully merging this pull request may close these issues.

None yet

2 participants