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

[Flight] Demonstrate TLS options #173

Open
lidavidm opened this issue Apr 1, 2022 · 8 comments
Open

[Flight] Demonstrate TLS options #173

lidavidm opened this issue Apr 1, 2022 · 8 comments

Comments

@lidavidm
Copy link
Member

lidavidm commented Apr 1, 2022

No description provided.

@thatstatsguy
Copy link
Contributor

thatstatsguy commented Apr 4, 2022

@lidavidm happy to neaten up my self-signed certificate approach from this ticket and convert it into an article if you want?

Should be able to do it for C# and Python if needed.

@lidavidm
Copy link
Member Author

lidavidm commented Apr 4, 2022

@thatstatsguy that would be much appreciated!

We don't have a C# cookbook yet, if you are interested in that, we can scaffold it and get it set up perhaps. (Not sure how best to handle recipes, though; C++/Java have some custom Sphinx work to enable it and Python relies on Sphinx being able to evaluate inline Python.)

@thatstatsguy
Copy link
Contributor

Python article in progress...
@lidavidm once the python one is in we can have a go at the C# one?

@lidavidm
Copy link
Member Author

lidavidm commented Apr 5, 2022

No problem. We can scaffold the C♯ cookbook. Though, I'm not super familiar with .NET, so I'd appreciate any suggestions on how best to approach the integration with Sphinx for recipes and recipe output.

@thatstatsguy
Copy link
Contributor

Pull request available for python article. #177

Will have to do some research on Sphinx and how it might integrate with C# (first-time user Sphinx here 😅)

@lidavidm
Copy link
Member Author

lidavidm commented Apr 5, 2022

Thanks!

I was mostly wondering if there's a standard integration for .NET and Sphinx. If not, we can write our own (we already do for C++ and Java), it's then mostly a question of what would be most convenient.

For example: in C++, we create a normal C++ project with unit tests. The unit tests are annotated with function calls that record output between certain points in the code and dump them to a file. The Sphinx plugin then reads in the file and inserts the output into the documentation, along with the section of code (which is automatically determined by looking for the start/stop function calls). That might work well for .NET too.

If .NET has a REPL, that may also work; then we can embed code in the Sphinx docs, and write a plugin to evaluate them with the REPL. Personally I don't like it as much since it makes it hard to edit longer examples; Python gets by because Python is relatively concise, but for Java this approach is rather unwieldy.

@thatstatsguy
Copy link
Contributor

Haven't found any C# integration, but C# does have a REPL
https://dzone.com/articles/c-interactive-in-visual-studio

Happy to tackle the MTLS example as well. Should be fairly similar to the TLS example

@lidavidm
Copy link
Member Author

lidavidm commented Apr 13, 2022

Thanks. Hmm, I'd probably prefer to set things up the way C++ has done it over the way Java has, just because then it's much much easier to edit the examples. For example:

StartRecipe("ParquetStorageService::StartServer");
auto fs = std::make_shared<arrow::fs::LocalFileSystem>();
ARROW_RETURN_NOT_OK(fs->CreateDir("./flight_datasets/"));
ARROW_RETURN_NOT_OK(fs->DeleteDirContents("./flight_datasets/"));
auto root = std::make_shared<arrow::fs::SubTreeFileSystem>("./flight_datasets/", fs);
arrow::flight::Location server_location;
ARROW_RETURN_NOT_OK(
arrow::flight::Location::ForGrpcTcp("0.0.0.0", 0, &server_location));
arrow::flight::FlightServerOptions options(server_location);
auto server = std::unique_ptr<arrow::flight::FlightServerBase>(
new ParquetStorageService(std::move(root)));
ARROW_RETURN_NOT_OK(server->Init(options));
rout << "Listening on port " << server->port() << std::endl;
EndRecipe("ParquetStorageService::StartServer");

The code and output then get inserted with a custom Sphinx extension:

First, we'll start our server:
.. recipe:: ../code/flight.cc ParquetStorageService::StartServer
:dedent: 2

Would that feel reasonably natural to a C♯ dev? If so we can get the C♯ cookbook scaffolded and ready for writing.

Please feel free to add the mTLS example as well - it's much appreciated.

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

No branches or pull requests

2 participants