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

Conversation

amehra-ni
Copy link
Contributor

@amehra-ni amehra-ni commented Oct 28, 2024

What does this Pull Request accomplish?

This PR adds initial support for auto-generation of streaming APIs. This might not be complete, but we will be iteratively covering cases in follow-ups.

Why should this Pull Request be merged?

  • Metadata Update: Enhanced the metadata for FPGA functions to include additional information regarding streaming. This updated metadata is utilized in the metadata_mutation.py to create streaming functions and integrate them into the original function list. list.
  • Condition Check for Streaming API: Added condition checks in service.cpp.mako and other relevant files to generate streaming APIs. These checks invoke helper Mako files to generate the streaming function body.
    Struct Generation: First, generate the necessary structs for the streaming API.
    Moniker Functions: Next, generate the Moniker functions required for streaming.
    Function Generation: Finally, generate the streaming functions themselves.
  • Service Helpers: Added logic in service_helpers.mako to auto-generate the streaming function bodies. The generated functions are designed to handle various parameter and streaming types, similar to the example provided here
  • Proto Mako: Added support for including additional proto files in the proto.mako file.
  • In a follow-up PR, plan to extract common helper methods that can be used by both the new and existing code. This iterative approach will enhance the auto-generation process to handle additional cases more effectively.

What testing has been done?

Both grpc-server and sideband server runs fine. I'm able to use the client code and call the server with all the new streaming APIs and talk with the VI.

@amehra-ni amehra-ni changed the title Users/amehra/auto generate api Add initial auto-generation support for streaming APIs Oct 28, 2024
source/codegen/metadata_mutation.py Outdated Show resolved Hide resolved
source/codegen/metadata_mutation.py Outdated Show resolved Hide resolved
source/codegen/metadata/nifpga/config.py Show resolved Hide resolved
source/codegen/common_helpers.py Outdated Show resolved Hide resolved
source/codegen/templates/register_all_services.cpp.mako Outdated Show resolved Hide resolved
source/codegen/templates/register_all_services.cpp.mako Outdated Show resolved Hide resolved
source/codegen/common_helpers.py Outdated Show resolved Hide resolved
source/codegen/templates/service.h.mako Outdated Show resolved Hide resolved
source/codegen/templates/service.h.mako Outdated Show resolved Hide resolved
source/codegen/service_helpers.py Outdated Show resolved Hide resolved
source/codegen/templates/service.h.mako Outdated Show resolved Hide resolved
source/codegen/templates/service.cpp.mako Outdated Show resolved Hide resolved
source/codegen/templates/service_helpers.mako Outdated Show resolved Hide resolved
source/codegen/templates/service_helpers.mako Show resolved Hide resolved
source/codegen/templates/service.cpp.mako Outdated Show resolved Hide resolved
source/codegen/templates/service.cpp.mako Outdated Show resolved Hide resolved
source/codegen/templates/service.cpp.mako Outdated Show resolved Hide resolved
source/codegen/metadata/nifpga/config.py Outdated Show resolved Hide resolved
source/codegen/common_helpers.py Outdated Show resolved Hide resolved
source/codegen/common_helpers.py Outdated Show resolved Hide resolved
source/codegen/templates/service.h.mako Outdated Show resolved Hide resolved
source/codegen/templates/service.h.mako Outdated Show resolved Hide resolved
source/codegen/templates/service.cpp.mako Outdated Show resolved Hide resolved
source/codegen/templates/service_helpers.mako Show resolved Hide resolved
source/codegen/templates/service_helpers.mako Outdated Show resolved Hide resolved
Base automatically changed from users/sagrahar/add-sideband-support to main November 6, 2024 15:55
@amehra-ni amehra-ni marked this pull request as ready for review November 7, 2024 11:25
Copy link
Collaborator

@maxxboehme maxxboehme left a comment

Choose a reason for hiding this comment

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

Both grpc and sideband servers runs fine.

Can you add more details about the testing done since no automated testing was added in the PR.

generated/nifpga/nifpga_service.cpp Outdated Show resolved Hide resolved
generated/nifpga/nifpga_service.cpp Outdated Show resolved Hide resolved
generated/nifpga/nifpga_service.cpp Outdated Show resolved Hide resolved
generated/nifpga/nifpga_service.cpp Outdated Show resolved Hide resolved
source/server/data_moniker_service.cpp Outdated Show resolved Hide resolved
@amehra-ni amehra-ni merged commit 6e312a2 into main Nov 12, 2024
8 of 10 checks passed
@amehra-ni amehra-ni deleted the users/amehra/auto-generate-api branch November 12, 2024 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants