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

Support Rust SDK by gRPC-rs #230

Merged

Conversation

thara
Copy link
Contributor

@thara thara commented May 29, 2018

( This PR is restarted from #167 to keep things clean. )

Rust is a system programming language that runs fast, has memory safety.
It is good for game server implementation too.

Core implementations of the SDK functions are generated by gRPC-rs and located to sdks/rust/src/grpc directory.

@thara thara mentioned this pull request May 29, 2018
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: f46cc00f-46c8-416c-8ed3-63df602d3113

The following development artifacts have been built, and will exist for the next 30 days:

@markmandel
Copy link
Member

At first pass, this looks pretty awesome! I'll take a deeper look as soon as I can, but a few things to get this to completion:

I noticed that there is no Dockerfile, or gameserver.yaml for the example? We'll need those so people can test this out. Maybe we can do a multistage-build so people can test it without having to install anything? (We could actually do this for lots of our examples).

Also, can we have a README for the example, explaining what is does, how to build it, etc?

We will want to edit the sdk docs to include a reference to the Rust SDK. Which may mean we need some kind of Rust docs. Not sure if there is an auto-generated version like godoc we can use, or whether this should be just some hand written markdown?

Looking forward to taking this for a spin!

@markmandel markmandel added kind/feature New features for Agones area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) labels May 29, 2018
@thara
Copy link
Contributor Author

thara commented Jun 2, 2018

@markmandel I added gameserver.yaml for running minikude.
But I found that the example make the pod to make CrashLoopBackOff status.
I'm going to fix it.

Copy link
Collaborator

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

Quick question how do you generate the sdk code ? I think you should include that, unless I missed it.

Sample:

https://github.com/GoogleCloudPlatform/agones/blob/master/build/build-image/gen-grpc-cpp.sh

https://github.com/GoogleCloudPlatform/agones/blob/master/build/Makefile#L184

It looks good !

@thara
Copy link
Contributor Author

thara commented Jun 5, 2018

@Kuqd I added Rust SDK generation to gen-gameservers-sdk-grpc task in build/Makefile .
(I missed versions of SDK generation tools and bump up versions of them)

I'm still working to fix the CrashLoopBackOff bug in rust-sample.
Maybe I made a mistake on using health API.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 545ea3ff-8cf1-437c-97b1-007851d26d43

The following development artifacts have been built, and will exist for the next 30 days:

@cyriltovena
Copy link
Collaborator

cyriltovena commented Jun 5, 2018

Don't hesitate to ask questions on slack so we can help you troubleshoot, is the simple-udp working in your cluster ? By this I mean only your example is in crashloop, did you try other examples ? It could be a wrong installation...

@markmandel
Copy link
Member

This is looking awesome! Love the new docs, and the integration into the build system!

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

As a thought on your CrashLoopBackoff issue - you can test locally without having to push to minikube.
https://github.com/GoogleCloudPlatform/agones/tree/master/sdks#local-development

Maybe easier to determine exactly what the issue is (unless someone else wants to try building this, and see if they can see what is going wrong)

&& cd /usr/src/cmake \
&& ./configure && make -j$(nproc) && make install

## Go
Copy link
Member

Choose a reason for hiding this comment

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

Love the multi-stage builder image - we should do that more.

Out of curiosity, why do we need Go here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Out of curiosity, why do we need Go here?

This Rust SDK depends gRPC-RS.
It needs Go for TLS encryption and some authentication mechanism.
See also https://github.com/pingcap/grpc-rs#prerequisites.

spec:
containers:
- name: rust-simple
image: rust-simple-server:0.1
Copy link
Member

Choose a reason for hiding this comment

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

This should be:
gcr.io/agones-images/rust-simple-server:0.1

As once this gets merged, I'll build this, and push the image up to the public registry 👍

@thara
Copy link
Contributor Author

thara commented Jun 6, 2018

@Kuqd Thanks you for your concern.
The simple-udp is working correctly in my minikube cluster on my machine :)

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 38bda07b-e338-4cb9-898f-af003643d922

Build Logs
starting build "38bda07b-e338-4cb9-898f-af003643d922"

FETCHSOURCE
Initialized empty Git repository in /workspace/.git/
From https://source.developers.google.com/p/agones-images/r/agones
 * branch            acf24ecb1bdee8d63d54b14ac4a21c8250a7aa50 -> FETCH_HEAD
HEAD is now at acf24ec Pull the rust-simple image from public registry
BUILD
Starting Step #0
Step #0: Already have image (with digest): ubuntu
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/cloud-builders/docker
Step #1: Sending build context to Docker daemon  131.2MB

Step #1: Step 1/3 : FROM gcr.io/cloud-builders/docker
Step #1:  ---> 3c69959ba506
Step #1: Step 2/3 : RUN apt-get install make
Step #1:  ---> Running in 8ffb18e62fac
Step #1: Reading package lists...
Step #1: Building dependency tree...
Step #1: Reading state information...
Step #1: Suggested packages:
Step #1:   make-doc
Step #1: The following NEW packages will be installed:
Step #1:   make
Step #1: 0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Step #1: Need to get 151 kB of archives.
Step #1: After this operation, 365 kB of additional disk space will be used.
Step #1: Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 make amd64 4.1-6 [151 kB]
Step #1: Fetched 151 kB in 0s (265 kB/s)
Step #1: Selecting previously unselected package make.
Step #1: (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 11239 files and directories currently installed.)
Step #1: Preparing to unpack .../archives/make_4.1-6_amd64.deb ...
Step #1: Unpacking make (4.1-6) ...
Step #1: Setting up make (4.1-6) ...
Step #1: Removing intermediate container 8ffb18e62fac
Step #1:  ---> 5839e64c7014
Step #1: Step 3/3 : ENTRYPOINT ["/usr/bin/make"]
Step #1:  ---> Running in ed03a2717405
Step #1: Removing intermediate container ed03a2717405
Step #1:  ---> 3a181bcd8ece
Step #1: Successfully built 3a181bcd8ece
Step #1: Successfully tagged make-docker:latest
Finished Step #1
Starting Step #2
Step #2: Already have image: make-docker
Step #2: docker pull gcr.io/agones-images/agones-build:7072908ec5 && docker tag gcr.io/agones-images/agones-build:7072908ec5 agones-build:7072908ec5
Step #2: 7072908ec5: Pulling from agones-images/agones-build
Step #2: c73ab1c6897b: Pulling fs layer
Step #2: 3091fac74ac3: Pulling fs layer
Step #2: 32ec8f15f1df: Pulling fs layer
Step #2: ebd4b13b0864: Pulling fs layer
Step #2: a7e14886d7cb: Pulling fs layer
Step #2: 7cd5bad74f33: Pulling fs layer
Step #2: 3a0ca065e888: Pulling fs layer
Step #2: a465471fbe6c: Pulling fs layer
Step #2: 6d1f4184a3d0: Pulling fs layer
Step #2: 3745795fcdfc: Pulling fs layer
Step #2: 6ed8538e9e89: Pulling fs layer
Step #2: ccc7bb93026f: Pulling fs layer
Step #2: dc52b85b579f: Pulling fs layer
Step #2: 9afe8d056235: Pulling fs layer
Step #2: 46243f13dd8a: Pulling fs layer
Step #2: 184b5d94fcee: Pulling fs layer
Step #2: 71cc0aeddc41: Pulling fs layer
Step #2: 76da06ada5c3: Pulling fs layer
Step #2: 3f1d41eecc9e: Pulling fs layer
Step #2: ebd4b13b0864: Waiting
Step #2: a7e14886d7cb: Waiting
Step #2: 7cd5bad74f33: Waiting
Step #2: 3a0ca065e888: Waiting
Step #2: a465471fbe6c: Waiting
Step #2: 6d1f4184a3d0: Waiting
Step #2: 3745795fcdfc: Waiting
Step #2: 6ed8538e9e89: Waiting
Step #2: ccc7bb93026f: Waiting
Step #2: dc52b85b579f: Waiting
Step #2: 9afe8d056235: Waiting
Step #2: 46243f13dd8a: Waiting
Step #2: 184b5d94fcee: Waiting
Step #2: 71cc0aeddc41: Waiting
Step #2: 76da06ada5c3: Waiting
Step #2: 3f1d41eecc9e: Waiting
Step #2: c73ab1c6897b: Verifying Checksum
Step #2: c73ab1c6897b: Download complete
Step #2: c73ab1c6897b: Pull complete
Step #2: ebd4b13b0864: Verifying Checksum
Step #2: ebd4b13b0864: Download complete
Step #2: 3091fac74ac3: Verifying Checksum
Step #2: 3091fac74ac3: Download complete
Step #2: 7cd5bad74f33: Verifying Checksum
Step #2: 7cd5bad74f33: Download complete
Step #2: a7e14886d7cb: Verifying Checksum
Step #2: a7e14886d7cb: Download complete
Step #2: a465471fbe6c: Verifying Checksum
Step #2: a465471fbe6c: Download complete
Step #2: 3091fac74ac3: Pull complete
Step #2: 3a0ca065e888: Verifying Checksum
Step #2: 3a0ca065e888: Download complete
Step #2: 6d1f4184a3d0: Verifying Checksum
Step #2: 6d1f4184a3d0: Download complete
Step #2: 3745795fcdfc: Verifying Checksum
Step #2: 3745795fcdfc: Download complete
Step #2: ccc7bb93026f: Verifying Checksum
Step #2: ccc7bb93026f: Download complete
Step #2: 6ed8538e9e89: Verifying Checksum
Step #2: 6ed8538e9e89: Download complete
Step #2: 32ec8f15f1df: Verifying Checksum
Step #2: 32ec8f15f1df: Download complete
Step #2: 9afe8d056235: Verifying Checksum
Step #2: 9afe8d056235: Download complete
Step #2: 46243f13dd8a: Verifying Checksum
Step #2: 46243f13dd8a: Download complete
Step #2: 71cc0aeddc41: Verifying Checksum
Step #2: 71cc0aeddc41: Download complete
Step #2: 184b5d94fcee: Verifying Checksum
Step #2: 184b5d94fcee: Download complete
Step #2: 76da06ada5c3: Verifying Checksum
Step #2: 76da06ada5c3: Download complete
Step #2: 3f1d41eecc9e: Verifying Checksum
Step #2: 3f1d41eecc9e: Download complete
Step #2: dc52b85b579f: Verifying Checksum
Step #2: dc52b85b579f: Download complete
Step #2: 32ec8f15f1df: Pull complete
Step #2: ebd4b13b0864: Pull complete
Step #2: a7e14886d7cb: Pull complete
Step #2: 7cd5bad74f33: Pull complete
Step #2: 3a0ca065e888: Pull complete
Step #2: a465471fbe6c: Pull complete
Step #2: 6d1f4184a3d0: Pull complete
Step #2: 3745795fcdfc: Pull complete
Step #2: 6ed8538e9e89: Pull complete
Step #2: ccc7bb93026f: Pull complete
Step #2: dc52b85b579f: Pull complete
Step #2: 9afe8d056235: Pull complete
Step #2: 46243f13dd8a: Pull complete
Step #2: 184b5d94fcee: Pull complete
Step #2: 71cc0aeddc41: Pull complete
Step #2: 76da06ada5c3: Pull complete
Step #2: 3f1d41eecc9e: Pull complete
Step #2: Digest: sha256:ba5ed43afe1319883b3646990e62f8d9b34e6e2a2f60a40e68719ab8ffbab590
Step #2: Status: Downloaded newer image for gcr.io/agones-images/agones-build:7072908ec5
Finished Step #2
Starting Step #3
Step #3: Already have image: make-docker
Step #3: mkdir -p ~/.kube
Step #3: mkdir -p /workspace/build//.config/gcloud
Step #3: docker run --rm -v /workspace/build//.config/gcloud:/root/.config/gcloud -v ~/.kube:/root/.kube -v /workspace:/go/src/agones.dev/agones -w /go/src/agones.dev/agones  agones-build:7072908ec5 bash -c \
Step #3: 	"/root/gen-lint-exclude.sh && gometalinter --config .exclude.gometalinter.json --deadline=5m -t --skip vendor ./..."
Step #3: WARNING: deadline exceeded by linter megacheck (try increasing --deadline)
Step #3: WARNING: deadline exceeded by linter structcheck (try increasing --deadline)
Step #3: make: *** [lint] Error 2
Step #3: Makefile:141: recipe for target 'lint' failed
Finished Step #3
ERROR
ERROR: build step 3 "make-docker" failed: exit status 2

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 969c1b2f-3d5e-4d5e-bf17-f235e243b0af

The following development artifacts have been built, and will exist for the next 30 days:

@markmandel markmandel removed the feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) label Jun 6, 2018
@markmandel
Copy link
Member

I just looked - can we rebase this down to a single commit? Once that's done, we should merge this in!

@markmandel markmandel added this to the 0.3.0 milestone Jun 6, 2018
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: a72ddab9-cdbb-4039-81c4-44431fc634e0

The following development artifacts have been built, and will exist for the next 30 days:

@thara
Copy link
Contributor Author

thara commented Jun 8, 2018

I fixed the CrashLoopBackOff bug in rust-sample.

@thara thara force-pushed the support-rust-sdk-by-grpcrs branch from 54c51e7 to 7749145 Compare June 8, 2018 13:49
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 295ca252-2206-43f9-9d78-3265989d6c0f

The following development artifacts have been built, and will exist for the next 30 days:

@thara
Copy link
Contributor Author

thara commented Jun 8, 2018

@markmandel I rebased to a single commit.
(I left the old commit logs in thara/support-rust-sdk-by-grpcrs-backup in just for the record)

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 61b6992c-b35c-4011-afc8-f3fcd3607b40

The following development artifacts have been built, and will exist for the next 30 days:

@cyriltovena cyriltovena force-pushed the support-rust-sdk-by-grpcrs branch from 7749145 to 3825db1 Compare June 8, 2018 14:20
@cyriltovena
Copy link
Collaborator

cyriltovena commented Jun 8, 2018

sorry I merged a PR in between, so I rebased your branch, will merge asap.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 63af5572-d524-4b77-97c8-90feda3e93b9

The following development artifacts have been built, and will exist for the next 30 days:

@cyriltovena cyriltovena merged commit 9e024d8 into googleforgames:master Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/feature New features for Agones
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants