grpc / grpc-docker-library

Contains dockerfiles for gRPC in different languages
Apache License 2.0
207 stars 83 forks source link

PHP onbuild image is missing #39

Closed smolinari closed 7 years ago

smolinari commented 7 years ago

Hi,

The onbuild image is missing, so working with the php-grpc-client container as documented won't work. The files are missing.

Scott

markmandel commented 7 years ago

Wh00ps! You are 100% correct. Let me test the image, make sure it builds, and I'll get that uploaded early next week.

smolinari commented 7 years ago

Thanks for replying.

It would also be cool, if the README.md would also cover the Greeter example, maybe also asking the user, if they want to test the client properly, to fire up the Node server.

Also, is the "localhost:50051" the correct setting in the client for working with the Node server? I am having trouble making a connection at all.

If I can ever get a connection working, I'd be glad to offer up a PR to improve the docs.

Scott

smolinari commented 7 years ago

If you could check my work out, maybe you'd find a stupid mistake. I've been turning circles for a few days now. The only differences I have is I am using php-fpm and nginx. Despite that, I've also tried the apache version.

This is what I have up till now.

https://github.com/skooppaos/grpc-php-demo

Scott

markmandel commented 7 years ago

So I'm going to restrict my response to this bug to the initially reported issue - but suggest you follow the quickstart in the mean time. http://www.grpc.io/docs/quickstart/php.html

If you are having wider issues outside of this repository, I suggest contacting the mailing list or gitter, which can be found on the community page: http://www.grpc.io/community/

smolinari commented 7 years ago

The quickstart is not aimed at a Docker installation, but rather a local install, which sort of defeats the purpose of microservices. And you have to admit, gRPC is supposed to work with Docker from the start as the containerization platform for microservices. It's what Kubernetes supports.

I've gotten a bit further and now know, the PHP container can communicate with the node container. However, I can't tell if the call to the node server is working properly or if the message reply isn't getting through. I'm going to dig deeper. Is there a particular method to troubleshoot gRPC?

Maybe the onbuild version might help me too, because maybe I am building the PHP container wrong. So, if you could fix that, it would be another angle of attack for me. Thanks.

Scott

markmandel commented 7 years ago

Okay - there is now a php-onbuild image. https://hub.docker.com/r/grpc/php/tags/

@nathanielmanistaatgoogle , @nicolasnoble I feel this issue can be closed now.

@smolinari - Personally, I wouldn't use these images for production builds - I'd use them for development build / CI / CD systems (see my thoughts) - there is little reason to have the full development toolchain in your Docker image. As we get more releases for gRPC, I will likely file a PR to remove the on-build images, because as I can see, they are confusing for this reason (and update the README, so this is more clear)

smolinari commented 7 years ago

Thanks for fixing the missing image. I'll close the issue.

For sure these images aren't "finished". They are a start.

As for Java, you can use a pre-built Java image in the dockerfile (if the repo is a trusted source) and just go from there. There is no reason not to have a finished Java gRPC containers set up.

In general too and I am sure you know this, I've found it is easier to work with volumes, because then the developer can change files locally and have them also change in the container immediately. This saves the effort of continually having to build the container and run it, in order to get any changes into it. Also, using docker-compose allows the developer to develop with a number of "services" at one time with fewer commands to get them all "up" and running to work with them (my repo demonstrates these advantages).

In fact, it would make a lot more sense and sell gRPC better to have a client and server container setup with each language in a docker compose file, demonstrating hello world. In other words, it would be cool to just docker-compose up -d within each languages version and then go to either a console or a browser and to call on the client to get the "hello world" message from the server. Right now, the PHP container does nothing except respond with the client object. What everyone needs is a working gRPC message from the server in the response from the client. 😄

Scott