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

C++ SDK Cross compilation and testing #134

Closed
markmandel opened this issue Mar 8, 2018 · 20 comments
Closed

C++ SDK Cross compilation and testing #134

markmandel opened this issue Mar 8, 2018 · 20 comments
Labels
area/build-tools Development tooling. I.e. pretty much everything in the `build` directory. good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! kind/design Proposal discussing new features / fixes and how they should be implemented stale Pending closure unless there is a strong objection. wontfix Sorry, but we're not going to do that.

Comments

@markmandel
Copy link
Member

markmandel commented Mar 8, 2018

Problem

Our current support for low dependency, cross compilation for the C++ SDK is very poor. Things work on Linux, because of make and not much else. We also have no tests.

Right now, the C++ SDK is built on top of gRPC, which may be adding too many dependencies to be used in a valuable way across platforms?

Code is here: https://github.com/GoogleCloudPlatform/agones/tree/master/sdks/cpp

Requirements

  1. Review the current state of cross complication and dependency with gRPC.
  2. Review the SDK REST api endpoints, and see if that would be a better fit than connecting via gRPC.
  3. Depending on that, prepare a design doc (added here is fine), with the following things in mind:
    1. Ability to cross compile on Linux/Mac/Windows
    2. Add some kind of unit tests, build tests, etc ideally with automation
    3. Anything else that is important to the C++ ecosystem (dependencies?)

Caveat: This is written by @markmandel who has little to no idea about C++ and its ecosystem, so direction on the above is also appreciated.

Research

https://github.com/grpc/grpc/blob/master/src/cpp/README.md#make
https://www.appveyor.com
https://circleci.com/build-environments/xcode/osx/
https://docs.travis-ci.com/user/reference/osx/

History

@markmandel markmandel added help wanted We would love help on these issues. Please come help us! kind/design Proposal discussing new features / fixes and how they should be implemented area/build-tools Development tooling. I.e. pretty much everything in the `build` directory. labels Mar 8, 2018
@markmandel markmandel added this to the 0.2 milestone Mar 8, 2018
@markmandel markmandel added the good first issue These are great first issues. If you are looking for a place to start, start here! label Mar 8, 2018
@SurferJeffAtGoogle
Copy link

CMake is the defacto standard for building C and C++ code across platforms.

@markmandel
Copy link
Member Author

Totally happy to have this rewritten with CMake (or whatever is appropriate) - I totally bashed this together with the help of someone with (somewhat?) more C++ experience than me, and this is an ecosystem I am very much not familiar with.

@cyriltovena
Copy link
Collaborator

/cc @sylvainduchesne

@dzlier-gcp dzlier-gcp self-assigned this Mar 28, 2018
@dzlier-gcp
Copy link
Contributor

Notes doc after meeting with rennie@, markmandel@ and myself.

@markmandel markmandel modified the milestones: 0.2.0, 0.3.0 May 30, 2018
@markmandel markmandel modified the milestones: 0.3.0, 0.4.0 Jul 17, 2018
@markmandel markmandel modified the milestones: 0.4.0, 0.5.0 Aug 28, 2018
@markmandel markmandel changed the title C++ SDK compilation and libraries for Windows C++ SDK Cross compilation Oct 9, 2018
@markmandel markmandel changed the title C++ SDK Cross compilation C++ SDK Cross compilation and testing Oct 9, 2018
@markmandel
Copy link
Member Author

@martin-z-google This is the current state of the C++ SDK situation - please let me know if this makes no sense 😄

@markmandel markmandel modified the milestones: 0.5.0, 0.6.0 Oct 9, 2018
@ortho
Copy link

ortho commented Oct 13, 2018

Do you want to run protoc during build phase when using cmake or just want to compile current source using cmake (to make small step to cross building)?

@markmandel
Copy link
Member Author

@ortho I think I understand the question? (I'm not 100% sure)

We generate the code from protoc and store it in our github repo - since it's not going to change. We only change it when the .proto file changes -- and you can run make gen-gameservers-sdk-grpc to regenerate as needed.

Does that answer the question?

@ortho
Copy link

ortho commented Oct 16, 2018

Sorry, English is not my native language. :(

Let me try again.

I'm going to close this issue.
There are two ways to make it done.

First way (simplest):
Rewrite sdks/cpp/Makefile to CMake sdks/cpp/CMakeLists.txt

Second way:

  1. Remove all *.pb.cc and *.pb.h files in sdks/cpp/**.
  2. Create CMake script in sdks/cpp/CMakeLists.txt
  3. "Script" try to find protobuf, grpc packages in system (during configure phase).
  4. Generate all needed *.pb.cc and *.pb.h files during build phase (without en-grpc-cpp.sh)

Which one would be preferable?

@markmandel
Copy link
Member Author

@ortho - so right now, @martin-z-google is working on the first way. There are still runtime dependencies on protobuf's libraries, outside of the code generation (if i understand correctly, although martin can explain better than I can)

Personally, I'm not seeing any benefit in the second way -- it's not as if the generate code ever changes. But maybe I'm missing something?

@martin-z-google
Copy link

FYI pull request is up: #421

@markmandel markmandel modified the milestones: 0.6.0, 0.7.0 Nov 20, 2018
@markmandel markmandel modified the milestones: 0.7.0, 0.8 Jan 2, 2019
@markmandel markmandel modified the milestones: 0.8.0, 0.9.0 Feb 13, 2019
@markmandel markmandel modified the milestones: 0.9.0, 0.10.0 Mar 26, 2019
@roberthbailey
Copy link
Member

From the requirements in the initial issue comment, did anyone ever take a look into

  1. Review the SDK REST api endpoints, and see if that would be a better fit than connecting via gRPC.

and write up rationale for continuing to invest in the gRPC wrappers?

@dsazonoff
Copy link
Contributor

@roberthbailey I think that we should continue to use gRPC, because it is possible to have connection with most languages (even js). Nginx already supports forwarding of grpc traffic. And it is possible to create some kind of proxy over grpc->http, but I don't see any real cases when we may need it. But I'm not good in this area.

@markmandel
Copy link
Member Author

Was digging through community build steps - found this, thought it might be interesting:
https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/windows-builder

@roberthbailey
Copy link
Member

@dsazonoff - If the argument is about language support, then pretty much any language you'd encounter today will support sending an HTTP request. And since HTTP is a core part of the language, we don't need to worry about how well / long it is supported or compiler compatibility / etc.

On the server side, I'm all in favor of grpc and http endpoints both being exposed. The question was more along the lines of whether it makes sense for the clients we build to depend on grpc or whether HTTP is sufficient as it is possible a smaller code.

@sylvainduchesne
Copy link

Both will work for the work, and admittedly HTTP is simpler to integrate. However, you need to poll for the GameSession status over HTTP, whereas that callback should come in automatically over gRPC.

Personally, I don't find that convenience to be enough to warrant integrating gRPC on the client, since most codebases will already have HTTP clients integrated.

@markmandel markmandel modified the milestones: 0.10.0, 0.11.0 May 7, 2019
@markmandel markmandel modified the milestones: 0.11.0, 0.12.0 Jun 18, 2019
@markmandel markmandel modified the milestones: 0.12.0, 1.0 Aug 1, 2019
@markmandel markmandel modified the milestones: 1.0.0, 1.1.0 Sep 10, 2019
@markmandel markmandel modified the milestones: 1.1.0, 1.2.0 Oct 22, 2019
@markmandel markmandel removed this from the 1.2.0 milestone Dec 4, 2019
@roberthbailey roberthbailey added the stale Pending closure unless there is a strong objection. label Sep 22, 2022
@roberthbailey
Copy link
Member

I've marked this issue as stale. If you still find it relevant please leave a note, otherwise we will close it during our next round of triage.

@markmandel
Copy link
Member Author

Closing, since it doesn't look like we have the capability to do this right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-tools Development tooling. I.e. pretty much everything in the `build` directory. good first issue These are great first issues. If you are looking for a place to start, start here! help wanted We would love help on these issues. Please come help us! kind/design Proposal discussing new features / fixes and how they should be implemented stale Pending closure unless there is a strong objection. wontfix Sorry, but we're not going to do that.
Projects
None yet
Development

No branches or pull requests

9 participants