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
merged 1 commit into from Jun 8, 2018

Conversation

Projects
None yet
4 participants
@thara
Copy link
Contributor

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 referenced this pull request May 29, 2018

Closed

Support Rust SDK #167

@agones-bot

This comment has been minimized.

Copy link
Collaborator

agones-bot commented May 29, 2018

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

This comment has been minimized.

Copy link
Collaborator

markmandel commented May 29, 2018

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!

@thara

This comment has been minimized.

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.

@Kuqd
Copy link
Collaborator

Kuqd left a comment

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

agones-bot commented Jun 5, 2018

Build Succeeded 👏

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

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

@Kuqd

This comment has been minimized.

Copy link
Collaborator

Kuqd 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

This comment has been minimized.

Copy link
Collaborator

markmandel commented Jun 5, 2018

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

@markmandel
Copy link
Collaborator

markmandel left a comment

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

This comment has been minimized.

@markmandel

markmandel Jun 5, 2018

Collaborator

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

Out of curiosity, why do we need Go here?

This comment has been minimized.

@thara

thara Jun 6, 2018

Author Contributor

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

This comment has been minimized.

@markmandel

markmandel Jun 5, 2018

Collaborator

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

agones-bot commented Jun 6, 2018

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

@Kuqd

Kuqd approved these changes Jun 6, 2018

@agones-bot

This comment has been minimized.

Copy link
Collaborator

agones-bot commented Jun 6, 2018

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

This comment has been minimized.

Copy link
Collaborator

markmandel commented Jun 6, 2018

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

This comment has been minimized.

Copy link
Collaborator

agones-bot commented Jun 6, 2018

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

This comment has been minimized.

Copy link
Contributor Author

thara commented Jun 8, 2018

I fixed the CrashLoopBackOff bug in rust-sample.

@thara thara force-pushed the thara:support-rust-sdk-by-grpcrs branch from 54c51e7 to 7749145 Jun 8, 2018

@agones-bot

This comment has been minimized.

Copy link
Collaborator

agones-bot commented Jun 8, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Collaborator

agones-bot commented Jun 8, 2018

Build Succeeded 👏

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

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

@Kuqd Kuqd force-pushed the thara:support-rust-sdk-by-grpcrs branch from 7749145 to 3825db1 Jun 8, 2018

@Kuqd

This comment has been minimized.

Copy link
Collaborator

Kuqd commented Jun 8, 2018

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

@agones-bot

This comment has been minimized.

Copy link
Collaborator

agones-bot commented Jun 8, 2018

Build Succeeded 👏

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

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

@Kuqd Kuqd merged commit 9e024d8 into GoogleCloudPlatform:master Jun 8, 2018

2 checks passed

agones-bot Build 63af5572-d524-4b77-97c8-90feda3e93b9 succeeded
Details
cla/google All necessary CLAs are signed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment