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

Add initial auto-generation support for streaming APIs #1114

Merged
merged 36 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9b1f514
adding support for sideband streaming
asumit Oct 24, 2024
2a45cc7
updating grpc-sideband submodule to latest
asumit Oct 25, 2024
59e91ce
adding data_moniker source and generated files to Integration and Sys…
asumit Oct 25, 2024
a3aedc1
Initial auto-generation
amehra-ni Oct 28, 2024
cbfd8e8
update grpc-streaming_type
amehra-ni Oct 28, 2024
8de6fc9
adding sideband_address to the server_config.json
asumit Oct 29, 2024
165405f
adding the sideband_streaming functionality under a feature toggle
asumit Oct 29, 2024
4bf5785
Fix some format changes
amehra-ni Oct 30, 2024
b7d8f15
adding RT specific scheduling under feature toggle
asumit Nov 1, 2024
3dc83c8
Fixing some build issues
amehra-ni Nov 4, 2024
329ca43
include copy at top
amehra-ni Nov 4, 2024
25ce023
resolve minor comments
amehra-ni Nov 4, 2024
b2858b2
add feature toggle helper
amehra-ni Nov 4, 2024
4521034
Merge branch 'users/sagrahar/add-sideband-support' of https://github.…
amehra-ni Nov 5, 2024
0771d7f
fixing minor comments
amehra-ni Nov 5, 2024
b8e5c49
resolving comments
amehra-ni Nov 5, 2024
a90f681
review comments
amehra-ni Nov 5, 2024
b4e473d
review comments
amehra-ni Nov 6, 2024
19ddbb3
update filter streaming functions
amehra-ni Nov 6, 2024
9f02326
use streaming_functions_to_generate
amehra-ni Nov 6, 2024
98bec2e
move define_streaming_api_body under else block
amehra-ni Nov 6, 2024
564e7e7
Merge branch 'main' of https://github.com/ni/grpc-device into users/a…
amehra-ni Nov 6, 2024
9b370e2
Resolve merge conflicts
amehra-ni Nov 6, 2024
9a5b281
fix build
amehra-ni Nov 6, 2024
903fa1f
resolve comments
amehra-ni Nov 7, 2024
e5c9879
remove unused functions
amehra-ni Nov 7, 2024
b6f207d
delete[] array
amehra-ni Nov 8, 2024
b45ead6
use vector instead of raw array
amehra-ni Nov 8, 2024
cd8f8c9
Fix indentation
amehra-ni Nov 9, 2024
c2464b0
include boolean functions
amehra-ni Nov 11, 2024
62afa43
Revert "include boolean functions"
amehra-ni Nov 11, 2024
0ac96fc
fix indentation
amehra-ni Nov 11, 2024
83d45bb
Add boolean functions
amehra-ni Nov 11, 2024
ca85ec1
Move RegisterMonikerEndpoints inside of driver specific registrar
amehra-ni Nov 11, 2024
0dd6460
remove unused code
amehra-ni Nov 12, 2024
81e05ec
revert register_all_services.cpp.mako
amehra-ni Nov 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "third_party/utfcpp"]
path = third_party/utfcpp
url = https://github.com/nemtrif/utfcpp
[submodule "third_party/grpc-sideband"]
path = third_party/grpc-sideband
url = https://github.com/ni/grpc-sideband.git
35 changes: 34 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ endif()
option(USE_NILRT_LEGACY_TOOLCHAIN "Enable to use tools and libraries from a NILRT compile toolchain." OFF)
option(USE_PYTHON_VIRTUALENV "Enable to use the automatically-generated python venv, local to this project source." ON)
option(USE_SUBMODULE_LIBS "Enable to link against the submodule libraries, rather than their native-OS equivalents." ON)
option(INCLUDE_SIDEBAND_RDMA "Include support for RDMA sideband transfers." OFF)
option(SIDEBAND_STATIC "Link grpc-sideband statically to current application." ON)

#----------------------------------------------------------------------
# Setup build dependencies, according to the toolchain options.
#----------------------------------------------------------------------

if(USE_SUBMODULE_LIBS)
# The archetypical WIN32 build case
# protobuf_INSTALL must be turned OFF whenever building it as a cmake subdir.
Expand All @@ -46,6 +47,7 @@ if(USE_SUBMODULE_LIBS)
add_subdirectory(third_party/gtest ${CMAKE_CURRENT_BINARY_DIR}/gtest EXCLUDE_FROM_ALL)
add_subdirectory(third_party/json ${CMAKE_CURRENT_BINARY_DIR}/json)
add_subdirectory(third_party/utfcpp ${CMAKE_CURRENT_BINARY_DIR}/utfcpp)
add_subdirectory(third_party/grpc-sideband ${CMAKE_CURRENT_BINARY_DIR}/grpc-sideband)

set(_PROTOBUF_PROTOC $<TARGET_FILE:protobuf::protoc>)
set(_REFLECTION grpc++_reflection)
Expand All @@ -54,6 +56,7 @@ if(USE_SUBMODULE_LIBS)
set(_GRPC_GRPCPP grpc++)
set(_PROTOBUF_LIBPROTOBUF libprotobuf)
set(_UTF8CPP utf8cpp)
set(_GRPC_SIDEBAND ni_grpc_sideband)
else()
find_program(_PROTOBUF_PROTOC protoc)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
Expand All @@ -71,6 +74,7 @@ else()
find_library(_GRPC_GRPCPP grpc++)
find_library(_PROTOBUF_LIBPROTOBUF protobuf)
find_library(_REFLECTION grpc++_reflection)
find_library(_GRPC_SIDEBAND ni_grpc_sideband REQUIRED)

find_package(gRPC REQUIRED)
find_package(GTest REQUIRED)
Expand Down Expand Up @@ -117,6 +121,8 @@ include_directories(
"./generated"
"./imports/include"
"./source"
"./third_party/grpc-sideband/src"
"./third_party/grpc-sideband/moniker_src"
)
if(WIN32)
link_directories("./imports/lib/win64")
Expand Down Expand Up @@ -272,6 +278,7 @@ get_filename_component(nidevice_proto "imports/protobuf/nidevice.proto" ABSOLUTE
get_filename_component(deviceid_restricted_proto "source/protobuf_restricted/deviceid_restricted.proto" ABSOLUTE)
get_filename_component(debugsessionproperties_restricted_proto "source/protobuf_restricted/debugsessionproperties_restricted.proto" ABSOLUTE)
get_filename_component(calibrationoperations_restricted_proto "source/protobuf_restricted/calibrationoperations_restricted.proto" ABSOLUTE)
get_filename_component(data_moniker_proto "imports/protobuf/data_moniker.proto" ABSOLUTE)
get_filename_component(session_proto_path "${session_proto}" PATH)

#----------------------------------------------------------------------
Expand Down Expand Up @@ -326,6 +333,10 @@ set(calibrationoperations_restricted_proto_srcs "${proto_srcs_dir}/calibrationop
set(calibrationoperations_restricted_proto_hdrs "${proto_srcs_dir}/calibrationoperations_restricted.pb.h")
set(calibrationoperations_restricted_grpc_srcs "${proto_srcs_dir}/calibrationoperations_restricted.grpc.pb.cc")
set(calibrationoperations_restricted_grpc_hdrs "${proto_srcs_dir}/calibrationoperations_restricted.grpc.pb.h")
set(data_moniker_proto_srcs "${proto_srcs_dir}/data_moniker.pb.cc")
set(data_moniker_proto_hdrs "${proto_srcs_dir}/data_moniker.pb.h")
set(data_moniker_grpc_srcs "${proto_srcs_dir}/data_moniker.grpc.pb.cc")
set(data_moniker_grpc_hdrs "${proto_srcs_dir}/data_moniker.grpc.pb.h")

GenerateGrpcSources(
PROTO
Expand Down Expand Up @@ -385,6 +396,16 @@ GenerateGrpcSources(
"${calibrationoperations_restricted_grpc_hdrs}"
)

GenerateGrpcSources(
PROTO
${data_moniker_proto}
OUTPUT
"${data_moniker_proto_srcs}"
"${data_moniker_proto_hdrs}"
"${data_moniker_grpc_srcs}"
"${data_moniker_grpc_hdrs}"
)

set(nidriver_service_library_hdrs
${nidriver_service_library_hdrs}
"${session_proto_hdrs}"
Expand Down Expand Up @@ -428,6 +449,7 @@ add_executable(ni_grpc_device_server
"source/server/calibration_operations_restricted_service.cpp"
"source/server/core_server.cpp"
"source/server/core_services_registrar.cpp"
"source/server/data_moniker_service.cpp"
"source/server/debug_session_properties_restricted_service_registrar.cpp"
"source/server/debug_session_properties_restricted_service.cpp"
"source/server/device_enumerator.cpp"
Expand Down Expand Up @@ -455,6 +477,8 @@ add_executable(ni_grpc_device_server
${debugsessionproperties_restricted_grpc_srcs}
${calibrationoperations_restricted_proto_srcs}
${calibrationoperations_restricted_grpc_srcs}
${data_moniker_proto_srcs}
${data_moniker_grpc_srcs}
${nidriver_service_srcs})

# Enable warnings only on source that we own, not generated code or dependencies
Expand Down Expand Up @@ -528,6 +552,7 @@ set(server_lib_deps
${_REFLECTION}
${_UTF8CPP}
${CMAKE_DL_LIBS}
${_GRPC_SIDEBAND}
nlohmann_json::nlohmann_json
)

Expand Down Expand Up @@ -566,6 +591,7 @@ add_executable(IntegrationTestsRunner
"source/server/calibration_operations_restricted_service_registrar.cpp"
"source/server/calibration_operations_restricted_service.cpp"
"source/server/core_services_registrar.cpp"
"source/server/data_moniker_service.cpp"
"source/server/debug_session_properties_restricted_service_registrar.cpp"
"source/server/debug_session_properties_restricted_service.cpp"
"source/server/device_enumerator.cpp"
Expand All @@ -590,6 +616,8 @@ add_executable(IntegrationTestsRunner
${debugsessionproperties_restricted_grpc_srcs}
${calibrationoperations_restricted_proto_srcs}
${calibrationoperations_restricted_grpc_srcs}
${data_moniker_proto_srcs}
${data_moniker_grpc_srcs}
${nidriver_service_srcs}
"${proto_srcs_dir}/nifake.pb.cc"
"${proto_srcs_dir}/nifake.grpc.pb.cc"
Expand Down Expand Up @@ -673,6 +701,8 @@ add_executable(UnitTestsRunner
${debugsessionproperties_restricted_grpc_srcs}
${calibrationoperations_restricted_proto_srcs}
${calibrationoperations_restricted_grpc_srcs}
${data_moniker_proto_srcs}
${data_moniker_grpc_srcs}
"${proto_srcs_dir}/nifake.pb.cc"
"${proto_srcs_dir}/nifake.grpc.pb.cc"
"${proto_srcs_dir}/nifake_extension.pb.cc"
Expand Down Expand Up @@ -783,6 +813,7 @@ set(system_test_runner_sources
"source/tests/system/visa_session_tests.cpp"
"source/server/calibration_operations_restricted_service_registrar.cpp"
"source/server/calibration_operations_restricted_service.cpp"
"source/server/data_moniker_service.cpp"
"source/server/debug_session_properties_restricted_service_registrar.cpp"
"source/server/debug_session_properties_restricted_service.cpp"
"source/server/device_enumerator.cpp"
Expand All @@ -807,6 +838,8 @@ set(system_test_runner_sources
${debugsessionproperties_restricted_grpc_srcs}
${calibrationoperations_restricted_proto_srcs}
${calibrationoperations_restricted_grpc_srcs}
${data_moniker_proto_srcs}
${data_moniker_grpc_srcs}
${nidriver_service_srcs}
${nidriver_client_srcs}
)
Expand Down
Loading
Loading