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

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

                Author: ASF GitHub Bot
            Created on: 20/Apr/21 15:36
            Start Date: 20/Apr/21 15:36
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on a change in pull request #14390:
URL: https://github.com/apache/beam/pull/14390#discussion_r616801819



##########
File path: sdks/python/apache_beam/runners/pipeline_context.py
##########
@@ -274,5 +283,36 @@ def to_runner_api(self):
     return context_proto
 
   def default_environment_id(self):
-    # type: () -> Optional[str]
+    # type: () -> str
     return self._default_environment_id
+
+  def get_environment_id_for_resource_hints(
+      self, hints):  # type: (Dict[str, bytes]) -> str
+    """Returns an environment id that has necessary resource hints."""
+    if not hints:
+      return self.default_environment_id()
+
+    def get_or_create_environment_with_resource_hints(
+        template_env_id,
+        resource_hints,
+    ):  # type: (str, Dict[str, bytes]) -> str
+      """Creates an environment that has necessary hints and returns its id."""
+      template_env = self.environments.get_proto_from_id(template_env_id)
+      cloned_env = type(template_env)(
+      )  # type: beam_runner_api_pb2.Environment  # type: ignore
+      cloned_env.CopyFrom(template_env)
+      cloned_env.resource_hints.clear()
+      for hint, value in resource_hints.items():

Review comment:
       it does, thanks.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 585918)
    Time Spent: 23h 40m  (was: 23.5h)

> Transforms could give hints to runners on resource requirements
> ---------------------------------------------------------------
>
>                 Key: BEAM-2085
>                 URL: https://issues.apache.org/jira/browse/BEAM-2085
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model, runner-core, sdk-java-core
>    Affects Versions: Not applicable
>            Reporter: Ismaël Mejía
>            Assignee: Valentyn Tymofieiev
>            Priority: P3
>              Labels: Clarified
>          Time Spent: 23h 40m
>  Remaining Estimate: 0h
>
> As discussed in BEAM-673 runners can allocate workers to accomplish their 
> work in a better way if they can take into account some hints from the 
> transforms, e.g. a source can hint data locality and with this information 
> the runner can allocate the workers in an better way, this can also be the 
> case with a particular transform that can suggest to the runner to be 
> executed in a worker with a specific resource, e.g. GPU.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to