I'm trying to create docker-compose config for all the languages of the project as for most of developers wanting to play with it it's unlikely to have all the required build tools on their dev macheine. Moreover it's unlikely for them to be familiar with every platform caveats.
First let's dive into architecture caveats similar for any of the platforms. Of course the most important is the fact that doc implies usage of a separate docker-compose to spawn the Temporal server. The problem is that Every SDK is written with 'localhost' hardcoded and neither of SDK's has client's constructor documented in details. So every SDK needs some time for digging into vendor source to change the Temporal server address to connect to. Next it's time to choose HOW exactly to specify it's address as there are 2 variants. The first is to use a physical interface IP address which is simplier and which I've choosed to start with.
It would be simplier if docker had some universal domain name which points to the host but it does not. Though actually it has but only on Windows - see https://github.com/docker/for-linux/issues/264
So to stay cross platform it's better to include the Temporal itself to the same docker-compose as this playground project which I'll do later. This approach entails reading server URL from ENV on each platform.
It's just a kind of things to think about so let's switch to practical per-platform problems.
PHP
Not sure why repo contains prebuilt rr in the project root. For me it blaimed smth like unexpected curly brace which looks like binary incompatibility. Maybe it was built on mac or arm or maybe it's 32bit. Anyway I've added it's reinstallation to docker's entrypoint script. Then it started spawning smth.
The doc tells to execute php app.php simple after that. What for are we spawning two binaries? There's no explanation. Anyway for second to launch I've added an ampersand and few seconds sleep after the rr command.
I couldn't test it because anyway app.php blaims:
app-php_1 | PHP Fatal error: Uncaught Error: Class 'Grpc\ChannelCredentials' not found in /code/vendor/temporal/sdk/src/Client/GRPC/BaseClient.php:57
app-php_1 | Stack trace:
app-php_1 | #0 /code/app.php(28): Temporal\Client\GRPC\BaseClient::create()
app-php_1 | #1 {main}
app-php_1 | thrown in /code/vendor/temporal/sdk/src/Client/GRPC/BaseClient.php on line 57
ChannelCredentials class is really missing in vendor/grpc. Looks like grpc and temporal sdk version mismatch. One of them is outdated and either has to be upgraded or the playground needs a stricter composer.json
Go
The most successful one. The only which caused me to see a workflow appeared in Temporal UI.
However I see the next message in output:
app-go_1 | 2021/08/24 18:17:40 INFO No logger configured for temporal client. Created default one.
app-go_1 | 2021/08/24 18:17:40 Unable to create client health check error: last connection error: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:7233: connect: connection refused"
app-go_1 | exit status 1
Seems like another SDK place with localhost or 127.0.0.1 hardcoded. As for me it's an SDK architectural issue. It definitely should not assume defaults for some fields. It should rather fail with error. This way it would be easier to find the cause.
Java
app-java_1 | [ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/code). Please verify you invoked Maven from the correct directory. -> [Help 1]
No comments. I'm proficent with a bunch of languages including Java but I'm definitely not a Maven guy, sorry. At the times I was using Java ant ruled the world.
Node
It's the most interesting:
app-node_1 | [TransportError: transport error: error trying to connect: tcp connect error: Cannot assign requested address (os error 99)]
First of all I want to tell that it's working nicely when I start it on host machine without docker.
As for the error - first I thought that it doesn't have a proper Temporal address and changed it. Unfortunately nothing has changed. The error itself disregarding to the project looks like port binding issue. Then what is is it trying to bind and what for? This question is actually similar to the one I've asked earlier for PHP where I didn't realize what for the two simultaneously running binaries are.
Thank's for reading this novel and have a nice day ;-)
Hello!
I'm trying to create docker-compose config for all the languages of the project as for most of developers wanting to play with it it's unlikely to have all the required build tools on their dev macheine. Moreover it's unlikely for them to be familiar with every platform caveats.
So. Here's what I've tried to do so far: https://github.com/programmador/temporal-polyglot/commit/bac920fe372ecc5dfef4d945bf6bc1f8eacc1720 It's not ready for contribution because from 4 platforms actually neither did work without any problems.
First let's dive into architecture caveats similar for any of the platforms. Of course the most important is the fact that doc implies usage of a separate docker-compose to spawn the Temporal server. The problem is that Every SDK is written with 'localhost' hardcoded and neither of SDK's has client's constructor documented in details. So every SDK needs some time for digging into vendor source to change the Temporal server address to connect to. Next it's time to choose HOW exactly to specify it's address as there are 2 variants. The first is to use a physical interface IP address which is simplier and which I've choosed to start with. It would be simplier if docker had some universal domain name which points to the host but it does not. Though actually it has but only on Windows - see https://github.com/docker/for-linux/issues/264 So to stay cross platform it's better to include the Temporal itself to the same docker-compose as this playground project which I'll do later. This approach entails reading server URL from ENV on each platform.
It's just a kind of things to think about so let's switch to practical per-platform problems.
PHP
Not sure why repo contains prebuilt
rr
in the project root. For me it blaimed smth likeunexpected curly brace
which looks like binary incompatibility. Maybe it was built on mac or arm or maybe it's 32bit. Anyway I've added it's reinstallation to docker's entrypoint script. Then it started spawning smth. The doc tells to executephp app.php simple
after that. What for are we spawning two binaries? There's no explanation. Anyway for second to launch I've added an ampersand and few seconds sleep after therr
command. I couldn't test it because anywayapp.php
blaims:ChannelCredentials class is really missing in vendor/grpc. Looks like grpc and temporal sdk version mismatch. One of them is outdated and either has to be upgraded or the playground needs a stricter composer.json
Go
The most successful one. The only which caused me to see a workflow appeared in Temporal UI. However I see the next message in output:
Seems like another SDK place with
localhost
or127.0.0.1
hardcoded. As for me it's an SDK architectural issue. It definitely should not assume defaults for some fields. It should rather fail with error. This way it would be easier to find the cause.Java
No comments. I'm proficent with a bunch of languages including Java but I'm definitely not a Maven guy, sorry. At the times I was using Java
ant
ruled the world.Node
It's the most interesting:
First of all I want to tell that it's working nicely when I start it on host machine without docker. As for the error - first I thought that it doesn't have a proper Temporal address and changed it. Unfortunately nothing has changed. The error itself disregarding to the project looks like port binding issue. Then what is is it trying to bind and what for? This question is actually similar to the one I've asked earlier for PHP where I didn't realize what for the two simultaneously running binaries are.
Thank's for reading this novel and have a nice day ;-)