[ 
https://issues.apache.org/jira/browse/BEAM-3418?focusedWorklogId=82469&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-82469
 ]

ASF GitHub Bot logged work on BEAM-3418:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/Mar/18 20:39
            Start Date: 20/Mar/18 20:39
    Worklog Time Spent: 10m 
      Work Description: aaltay commented on a change in pull request #4587: 
[BEAM-3418] Send worker_id in all grpc channels to runner harness
URL: https://github.com/apache/beam/pull/4587#discussion_r175910440
 
 

 ##########
 File path: sdks/python/apache_beam/runners/worker/worker_id_interceptor.py
 ##########
 @@ -0,0 +1,54 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+"""Client Interceptor to inject worker_id"""
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function
+
+import collections
+import os
+import uuid
+
+import grpc
+
+
+class _ClientCallDetails(
+    collections.namedtuple('_ClientCallDetails',
+                           ('method', 'timeout', 'metadata', 'credentials')),
+    grpc.ClientCallDetails):
+  pass
+
+
+class WorkerIdInterceptor(grpc.StreamStreamClientInterceptor):
+
+  # Unique worker Id for this worker.
+  _worker_id = os.environ['WORKER_ID'] if os.environ.has_key(
 
 Review comment:
   Do we want to fail if WORKER_ID is not found?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 82469)
    Time Spent: 1h 20m  (was: 1h 10m)

> Python Fnapi - Support Multiple SDK workers on a single VM
> ----------------------------------------------------------
>
>                 Key: BEAM-3418
>                 URL: https://issues.apache.org/jira/browse/BEAM-3418
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-harness
>            Reporter: Ankur Goenka
>            Assignee: Ankur Goenka
>            Priority: Major
>              Labels: performance, portability
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Support multiple python SDK process on a VM to fully utilize a machine.
> Each SDK Process will work in isolation and interact with Runner HarnessĀ 
> independently.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to