-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
What would you like to happen?
I tried to run the example of Go SDK - SQL 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 instead
- Python SDK
beam/sdks/python/apache_beam/runners/portability/fn_api_runner/worker_handlers.py
Line 747 in 2b4056b
return 'host.docker.internal' - Java SDK
Line 209 in 2b4056b
private static final String DOCKER_FOR_MAC_HOST = "host.docker.internal";
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 GetProvisionInfofunc (wk *W) GetProvisionInfo(_ context.Context, _ *fnpb.GetProvisionInfoRequest) (*fnpb.GetProvisionInfoResponse, error) { func NewMultipleWendpoint: "localhost:" + p, func dockerEnvironmentccr, err := cli.ContainerCreate(ctx, &container.Config{
Challenges
-
We need to modify the
GetProvisionInfoanddockerEnvironmentat the same time. 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? -
In
NewMultipleWactually I can only make this work if I replacelocalhostwith the actual ipv4 address of host e.g.192.168.x.x
=> And if we use the IP address, we don't need to modifyfunc dockerEnvironment. But I'm open for advice and suggestion as I don't like using IP like this either. -
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.
Summary
- I have a working version in my local machine, tested on both Linux and MacOS.
- However, as mentioned in the challenges section, before creating the PR, I hope we can discuss my implementation plan above.
- I can contribute more to this beside my issue with Docker on MacOS
Issue Priority
Priority: 2 (default / most feature requests should be filed as P2)
Issue Components
- Component: Python SDK
- Component: Java SDK
- 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