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

GEODE-8398: Add SNI support to .NET API #634

Merged
merged 4 commits into from Aug 19, 2020

Conversation

mmartell
Copy link
Contributor

This adds a new .NET API to the nativeclient to support SNI.

Notes:

  • This ticket usurps GEODE-8156. Since we need the new SetSniProxy API to run the test, we'll use this GEODE-8398 for the pull request.
  • The SNI tests are currently disabled on Windows platforms due to issues with running docker in the CI.

Copy link
Contributor

@jake-at-work jake-at-work left a comment

Choose a reason for hiding this comment

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

I am concerned with the deviation without discussion from the establish API based on the SNI Proxy RFC that was previously approved. Can you please open a discussion thread on dev@geode regarding the reasons for the C++ and .NET APIs deviate from the RFC? I would have expected work like this to have come with it's own RFC if it was going to deviate from previous RFCs.

https://cwiki.apache.org/confluence/display/GEODE/Client+side+configuration+for+a+SNI+proxy

var dockerComposeProc = Process.Start(@"C:\Program Files\docker\docker\resources\bin\docker-compose.exe", "stop");
dockerComposeProc.WaitForExit();

var dockerProc = Process.Start(@"C:\Program Files\docker\docker\resources\bin\docker.exe", "container prune -f");
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a Docker C++ SDK we could use rather than forking an executable.

Choose a reason for hiding this comment

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

not that we have found, unfortunately...

Copy link
Contributor

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

thx! we'll take a look at this for future improvements, current deadline isn't going to allow

Copy link
Member

Choose a reason for hiding this comment

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

Still, it is odd to hard code the docker executable paths.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh good catch. I didn't even notice that initially over the whole, why not use the SDK thing. If the absolute path is necessary, which I doubt it is, then use CMake find_program and inject. It should be sufficient to just make sure docker is in the PATH or add it to the PATH in the CTest definition.

cache_.Close();
}

[Fact (Skip = "Docker nut supported in Windows CI")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps you mean "not" rather than "nut". Also that statement is false, Docker is fully supported in Windows so why are we not skipping it?

Choose a reason for hiding this comment

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

its Docker on GCP that is specifically the issue, but thanks for catching the typo

Copy link
Contributor

Choose a reason for hiding this comment

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

I am running Docker on Windows in GCP just fine. Can I help?

clicache/src/PoolFactory.hpp Show resolved Hide resolved
cppcache/include/geode/PoolFactory.hpp Show resolved Hide resolved

region->put("1", "one");

cache.close();
}

TEST_F(SNITest, connectionFailsTest) {
#if defined(_WIN32)
TEST_F(SNITest, DISABLE_connectWithoutProxyFails) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this test disabled on Windows?

Choose a reason for hiding this comment

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

aforementioned Docker issues...

cppcache/src/PoolAttributes.cpp Show resolved Hide resolved
cppcache/src/TcpSslConn.cpp Outdated Show resolved Hide resolved
cppcache/src/TcpSslConn.hpp Outdated Show resolved Hide resolved
cppcache/src/ThinClientLocatorHelper.hpp Show resolved Hide resolved
sni-test-config/docker-compose.yml Show resolved Hide resolved
Copy link
Member

@moleske moleske left a comment

Choose a reason for hiding this comment

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

There's no instructions on how to run the Fact (Skip = "... tests. I assume you need docker installed but is there anything else. There should be instructions probably in CONTRIBUTING.md because folks will want to run these tests on their own machines.

Also, it is really strange to add "Skip CI" on tests when we don't have a CI that runs these tests. If one is running a private CI pipeline, that sounds like the skipping of tests should be done in your private pipeline, not the public code

var dockerComposeProc = Process.Start(@"C:\Program Files\docker\docker\resources\bin\docker-compose.exe", "stop");
dockerComposeProc.WaitForExit();

var dockerProc = Process.Start(@"C:\Program Files\docker\docker\resources\bin\docker.exe", "container prune -f");
Copy link
Member

Choose a reason for hiding this comment

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

Still, it is odd to hard code the docker executable paths.

var dockerComposeProc = Process.Start(@"C:\Program Files\docker\docker\resources\bin\docker-compose.exe", "stop");
dockerComposeProc.WaitForExit();

var dockerProc = Process.Start(@"C:\Program Files\docker\docker\resources\bin\docker.exe", "container prune -f");
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh good catch. I didn't even notice that initially over the whole, why not use the SDK thing. If the absolute path is necessary, which I doubt it is, then use CMake find_program and inject. It should be sufficient to just make sure docker is in the PATH or add it to the PATH in the CTest definition.

- TcpSslConn ctor was getting a string "host:port" instead of just "host", and needed to split off just the hostname
- Remove hard-coded path to Docker binaries
- Update "Skip" comment for SNI tests
@echobravopapa
Copy link

@pivotal-jbarrett latest mergable is up...

@pdxcodemonkey pdxcodemonkey merged commit 557e018 into apache:develop Aug 19, 2020
@mmartell mmartell deleted the GEODE-8398-sni-support-dotnet branch November 17, 2021 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants