nguymin4 opened a new issue, #35392:
URL: https://github.com/apache/beam/issues/35392

   ### What would you like to happen?
   
   ### Context
   - I tried to run the example of [Go SDK - 
SQL](https://github.com/apache/beam/blob/master/sdks/go/examples/xlang/sql/sql.go)
 locally with Prism Runner
     - Linux: ✅ - Succeeded
     - MacOS: ❌ - Failed 
   
   ### Issue
   `localhost` is set and used in many places in `Prism` runner (Go) and thus 
this doesn't work on Mac as we should use `host.docker.internal` similar to 
[Python 
SDK](https://github.com/apache/beam/blob/2b4056bcbb3ea66f9df5f9ebb1ea1765135b85cd/sdks/python/apache_beam/runners/portability/fn_api_runner/worker_handlers.py#L747)
 and [Java 
SDK](https://github.com/apache/beam/blob/2b4056bcbb3ea66f9df5f9ebb1ea1765135b85cd/runners/java-fn-execution/src/main/java/org/apache/beam/runners/fnexecution/environment/DockerEnvironmentFactory.java#L209)
   
   ### Proposed changes
   I now have a working solution for this issue locally.
   Based on my testing, there are at least 2-3 places needs to be modified 
(depends on implementation)
     -  [`func 
GetProvisionInfo`](https://github.com/apache/beam/blob/2b4056bcbb3ea66f9df5f9ebb1ea1765135b85cd/sdks/go/pkg/beam/runners/prism/internal/worker/worker.go#L128)
     - [`func 
NewMultipleW`](https://github.com/apache/beam/blob/2b4056bcbb3ea66f9df5f9ebb1ea1765135b85cd/sdks/go/pkg/beam/runners/prism/internal/worker/worker.go#L683)
     - [`func 
dockerEnvironment`](https://github.com/apache/beam/blob/2b4056bcbb3ea66f9df5f9ebb1ea1765135b85cd/sdks/go/pkg/beam/runners/prism/internal/environments.go#L210)
   
   ### Challenges
   1. I saw a TODO in `pkg/beam/runners/prism/internal/environments.go` `// 
TODO move environment handling to the worker package.` but I don't know our 
current plan with this.
   2. We need to modify the `GetProvisionInfo` and `dockerEnvironment` at the 
same time for pretty much similar thing. But I found this ticket 
https://issues.apache.org/jira/browse/BEAM-8201
   => If I understand correctly, it still relies on the combination of the CLI 
args and the provisioning API. We probably want to consolidate this?
   3. In `NewMultipleW` actually I can only make this work if I replace 
`localhost` with the actual ipv4 address of host e.g. `192.168.x.x`
   => And if we use the IP address, we don't need to modify `func 
dockerEnvironment`. But I'm open for  advice and suggestion as I don't like 
using IP like this either.
   
   ### Summary
   I have a working version in my local machine, tested on both Linux and 
MacOS. However, as mentioned in the challenges section. I don't want to create 
a PR before some maintainer go through my plan above.
   
   ### Issue Priority
   
   Priority: 2 (default / most feature requests should be filed as P2)
   
   ### Issue Components
   
   - [ ] Component: Python SDK
   - [ ] Component: Java SDK
   - [x] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to