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

thrift: module integration, samples, and tests #54013

Merged

Conversation

cfriedt
Copy link
Member

@cfriedt cfriedt commented Jan 23, 2023

Note: Compliance failures are false positives

Closes #51620

@zephyrbot zephyrbot added manifest manifest-thrift DNM This PR should not be merged (Do Not Merge) labels Jan 23, 2023
@zephyrbot
Copy link
Collaborator

zephyrbot commented Jan 23, 2023

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
thrift N/A zephyrproject-rtos/thrift@1002364 (zephyr) N/A

Note: This message is automatically posted and updated by the Manifest GitHub Action.

west.yml Outdated Show resolved Hide resolved
@cfriedt
Copy link
Member Author

cfriedt commented Jan 24, 2023

All samples & tests passing with the addition of the following in ../modules/lib/thrift/zephyr/module.yml:

name: thrift
build:
  cmake-ext: True
  kconfig-ext: True
#
# Run Test
#
twister --retry-failed 3 -G -T tests/lib/thrift/
ZEPHYR_BASE unset, using "/home/cfriedt/zephyrproject/zephyr"
Renaming output directory to /home/cfriedt/zephyrproject/zephyr/twister-out.2
INFO    - Using Ninja..
INFO    - Zephyr version: zephyr-v3.2.0-3787-gb22347e7b20e
INFO    - Using 'zephyr' toolchain.
INFO    - Selecting default platforms per test case
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /home/cfriedt/zephyrproject/zephyr/twister-out/testplan.json
INFO    - JOBS: 32
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - Total complete:   36/  36  100%  skipped:    0, failed:    0
INFO    - 7 test scenarios (36 test instances) selected, 0 configurations skipped (0 by static filter, 0 at runtime).
INFO    - 36 of 36 test configurations passed (100.00%), 0 failed, 0 skipped with 0 warnings in 235.66 seconds
INFO    - In total 538 test cases were executed, 0 skipped on 7 out of total 535 platforms (1.31%)
INFO    - 36 test configurations executed on platforms, 0 test configurations were only built.
INFO    - Saving reports...
INFO    - Writing JSON report /home/cfriedt/zephyrproject/zephyr/twister-out/twister.json
INFO    - Writing xunit report /home/cfriedt/zephyrproject/zephyr/twister-out/twister.xml...
INFO    - Writing xunit report /home/cfriedt/zephyrproject/zephyr/twister-out/twister_report.xml...
INFO    - Run completed

#
# Build samples
#
twister --build-only -G -T samples/modules/thrift/
INFO    - Using Ninja..
INFO    - Zephyr version: zephyr-v3.2.0-3787-gb22347e7b20e
INFO    - Using 'zephyr' toolchain.
INFO    - Selecting default platforms per test case
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /home/cfriedt/zephyrproject/zephyr/twister-out/testplan.json
INFO    - JOBS: 64
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - Total complete:    8/   8  100%  skipped:    0, failed:    0
INFO    - 8 test scenarios (8 test instances) selected, 0 configurations skipped (0 by static filter, 0 at runtime).
INFO    - 8 of 8 test configurations passed (100.00%), 0 failed, 0 skipped with 0 warnings in 29.26 seconds
INFO    - 0 test configurations executed on platforms, 8 test configurations were only built.
INFO    - Saving reports...
INFO    - Writing JSON report /home/cfriedt/zephyrproject/zephyr/twister-out/twister.json
INFO    - Writing xunit report /home/cfriedt/zephyrproject/zephyr/twister-out/twister.xml...
INFO    - Writing xunit report /home/cfriedt/zephyrproject/zephyr/twister-out/twister_report.xml...
INFO    - Run completed

@cfriedt cfriedt added the TSC Topics that need TSC discussion label Jan 24, 2023
@cfriedt cfriedt marked this pull request as ready for review January 24, 2023 04:42
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

A very quick cursory glance

modules/thrift/include/muzic/uzlib.h Outdated Show resolved Hide resolved
modules/thrift/misc/hello.thrift Outdated Show resolved Hide resolved
modules/thrift/src/thrift/config.h Outdated Show resolved Hide resolved
modules/thrift/src/thrift/config.h Outdated Show resolved Hide resolved
modules/thrift/src/thrift/server/TFDServer.cpp Outdated Show resolved Hide resolved
samples/modules/thrift/hello_common/native-cert.pem Outdated Show resolved Hide resolved
samples/modules/thrift/hello_server/CMakeLists.txt Outdated Show resolved Hide resolved
samples/modules/thrift/hello_server/Kconfig Outdated Show resolved Hide resolved
samples/modules/thrift/hello_server/Makefile Outdated Show resolved Hide resolved
tests/lib/thrift/ThriftTest/src/client.cpp Outdated Show resolved Hide resolved
doc/develop/getting_started/index.rst Outdated Show resolved Hide resolved
doc/develop/getting_started/installation_linux.rst Outdated Show resolved Hide resolved
modules/thrift/Kconfig Outdated Show resolved Hide resolved
modules/thrift/Kconfig Outdated Show resolved Hide resolved
modules/thrift/Kconfig Outdated Show resolved Hide resolved
samples/modules/thrift/hello_client/prj.conf Outdated Show resolved Hide resolved
doc/develop/getting_started/index.rst Outdated Show resolved Hide resolved
cmake/util/thrift.cmake Outdated Show resolved Hide resolved
@cfriedt
Copy link
Member Author

cfriedt commented Feb 1, 2023

Note: TSC vote is not about code review, it's about allowing the exception for being past feature-freeze

  • Ready again
  • This module has been more or less ready to merge since October but was delayed on reviews for fixes to other subsystems
  • Also again, just to clarify, some Thrift sources are re-implemented in Zephyr as a workaround for Zephyr's lack of support for std::thread, std::mutex, etc. Those are on the C++ Roadmap
  • Once Zephyr has support for std::thread, std::mutex, etc, we can drop the workarounds to use unmodified upstream sources.
  • Yes, upstream Thrift header files end in .h and not in .hpp. Yes, the copies of those files with slight workarounds need to keep the .h extension. Yes, that has already been discussed here. No, they will not be renamed, because it is not part of Zephyr's C++ coding style to force external projects to name C++ header files with the extension .hpp.
  • Mainly, the only sources that will persist in the modules/ directory are related to SSL / TLS and require some finesse due to Zephyr's TLS socket implementation

Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

Final change and +1 from me

tests/lib/thrift/ThriftTest/src/server.hpp Outdated Show resolved Hide resolved
nordicjm
nordicjm previously approved these changes Feb 3, 2023
@cfriedt cfriedt added this to the v3.3.0 milestone Feb 7, 2023
@stephanosio
Copy link
Member

#54626, which includes thrift-compiler has been merged.

Rebasing

@stephanosio
Copy link
Member

@cfriedt FYI, this PR is currently pointing to add-zephyr-module-dir branch in the module.

@cfriedt
Copy link
Member Author

cfriedt commented Feb 9, 2023

@cfriedt FYI, this PR is currently pointing to add-zephyr-module-dir branch in the module.

Let me update that. Thanks @stephanosio

Add a manifest entry pointing to Zephyr's fork of `apache/thrift`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
Add an entry for Apache Thrift and myself as maintainer.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
Add glue code for the thrift module. This includes:
* workarounds for Zephyr's missing C++ facilities
* thrift config.h

This code was merged from the following repository
at the commit specified below, with minor formatting
and coding-style modifications.

https://github.com/zephyrproject-rtos/gsoc-2022-thrift
e12e014d295918cc5ba0b4c507d1bf595a2f539a

Signed-off-by: Chris Friedt <cfriedt@meta.com>
These tests include:
* ThriftTest - an upstream exercies for all Thrift facilities

This code was merged from the following repository
at the commit specified below, with minor formatting
and coding-style modifications.

https://github.com/zephyrproject-rtos/gsoc-2022-thrift
e12e014d295918cc5ba0b4c507d1bf595a2f539a

Signed-off-by: Chris Friedt <cfriedt@meta.com>
Here we add a client and server samples for the basic
"hello" service.

These samples are designed to be run by either Zephyr or
the host machine, interchangeably.

Additionally, there is a python version of the client
to demonstrate Thrift's cross-language capabilities.

This code was merged from the following repository
at the commit specified below, with minor formatting
and coding-style modifications.

https://github.com/zephyrproject-rtos/gsoc-2022-thrift
e12e014d295918cc5ba0b4c507d1bf595a2f539a

Signed-off-by: Chris Friedt <cfriedt@meta.com>
@cfriedt
Copy link
Member Author

cfriedt commented Feb 9, 2023

@cfriedt
Copy link
Member Author

cfriedt commented Feb 9, 2023

@nordicjm - please re-ack when you have a moment

@stephanosio stephanosio removed the DNM This PR should not be merged (Do Not Merge) label Feb 9, 2023
@stephanosio stephanosio merged commit 3ea28b2 into zephyrproject-rtos:main Feb 9, 2023
@cfriedt cfriedt deleted the merge-thrift-into-zephyr branch February 9, 2023 23:46
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.

Add Apache Thrift Module (from GSoC 2022 Project)
7 participants