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

SOME/IP input plugin #9570

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

anthonypayne-GM
Copy link

This change introduces a new input plugin, in_someip. This plugin is used to subscribe to events and capture notifications from a SOME/IP network. It also can be used in inject SOME/IP requests and capture the response to the data pipeline.

The input plugin uses an open source implementation of the SOME/IP stack, vsomeip. This library is used unchanged, but a wrapper library, libsomeip-c, exposing C-language APIs is part of the PR.

For reference to SOME/IP: protocol specification.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A ] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

The SOME/IP C library is a wrapper around vsomeip.

Signed-off-by: Anthony Payne <[email protected]>
All tests pass and valgrind does not show any memory errors.

Signed-off-by: Anthony Payne <[email protected]>
Added code in error legs to free decode buffer.

Signed-off-by: Anthony Payne <[email protected]>
@anthonypayne-GM
Copy link
Author

Example config file is included in the PR, conf/in_someip.conf:

[INPUT]
    Name someip
    Tag  in.someip

    # Events to subscribe to.
    # Each event should have form:
    #    Event <service id>,<instance id>,<event id>,<event group 1>,...
    #
    # Each event must have at least one event group
    Event 4,1,32768,1
    Event 4,1,32769,2

    # RPC to send on startup
    # Each RPC entry should have form:
    #    RPC <service id>,<instance id>,<method id>,<Request Payload>
    #
    # Request payload should be base64 encoded
    RPC   4,1,1,CgAQAw==

@anthonypayne-GM
Copy link
Author

Debug log from runtime tests is attached.
rt_test.log

@anthonypayne-GM
Copy link
Author

Output from valgrind:

[ OK ]
SUCCESS: All unit tests have passed.
==7910== 
==7910== HEAP SUMMARY:
==7910==     in use at exit: 5,741 bytes in 13 blocks
==7910==   total heap usage: 17,360 allocs, 17,347 frees, 5,723,214 bytes allocated
==7910== 
==7910== LEAK SUMMARY:
==7910==    definitely lost: 0 bytes in 0 blocks
==7910==    indirectly lost: 0 bytes in 0 blocks
==7910==      possibly lost: 0 bytes in 0 blocks
==7910==    still reachable: 5,741 bytes in 13 blocks
==7910==         suppressed: 0 bytes in 0 blocks
==7910== Rerun with --leak-check=full to see details of leaked memory
==7910== 
==7910== For lists of detected and suppressed errors, rerun with: -s
==7910== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Copy link
Contributor

@patrick-stephens patrick-stephens left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, I think we need to look at those runtime dependencies though at the very least - also do we need to include them in the target builds as well under ./packaging/distros?

I don't think we can realistically globally enable this for every supported target. It also seems to use C++ compilation and dependencies.

Comment on lines +147 to +149
libboost-system-dev \
libboost-thread-dev \
libboost-filesystem-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

This is including the dev libraries in the runtime image - we should just have the minimal set of libraries needed for running fluent bit, not those for building it.

@@ -221,6 +227,9 @@ RUN echo "deb http://deb.debian.org/debian bookworm-backports main" >> /etc/apt/
libatomic1 \
libgcrypt20 \
libyaml-0-2 \
libboost-system-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

As above, do we really need the development libraries here or can we just use the runtime ones?

Comment on lines +58 to +60
libboost-system-dev \
libboost-thread-dev \
libboost-filesystem-dev \
Copy link
Contributor

Choose a reason for hiding this comment

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

We're including these development libraries but not actually enabling the plugin itself - is that right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, we globally enabled it which may be an entirely separate issue.

Comment on lines +4 to +9
FetchContent_Declare(
vsomeip3
GIT_REPOSITORY https://github.com/COVESA/vsomeip
GIT_TAG 0b83e24d16e1611958194e9b727136522f46556b # 3.5.1
)
FetchContent_MakeAvailable(vsomeip3)
Copy link
Contributor

Choose a reason for hiding this comment

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

Dependencies are generally vendored into the /lib directory and not fetched remotely.

@@ -227,6 +227,7 @@ if(FLB_ALL)
set(FLB_IN_NGINX_STATUS 1)
set(FLB_IN_EXEC 1)
set(FLB_IN_UNIX_SOCKET 1)
set(FLB_IN_SOMEIP 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you can enable this globally without considering all platforms that are supported including Windows and macOS configuration.

@@ -0,0 +1,138 @@
/* Fluent Bit
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be a C++ file, is that just a standard example and/or can it be C only? It seems to require a C++ compiler by looking at the example cmake linkage.

@patrick-stephens
Copy link
Contributor

For new plugins we must ensure it builds for all targets and CI so I've triggered that. It looks like we have a lot of failures around missing dependencies and the like in various places/platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-required ok-package-test Run PR packaging tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants