You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/02/12 19:34:36 UTC

[GitHub] [beam] ihji commented on a change in pull request #13607: [BEAM-11520] Stage extra PyPI dependencies with generated requirements

ihji commented on a change in pull request #13607:
URL: https://github.com/apache/beam/pull/13607#discussion_r575475373



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -114,10 +117,48 @@ def get_sdk_package_name():
         Returns the PyPI package name to be staged."""
     return names.BEAM_PACKAGE_NAME
 
+  @staticmethod
+  def _create_file_stage_to_artifact(local_path, staged_name):
+    return beam_runner_api_pb2.ArtifactInformation(
+        type_urn=common_urns.artifact_types.FILE.urn,
+        type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+            path=local_path).SerializeToString(),
+        role_urn=common_urns.artifact_roles.STAGING_TO.urn,
+        role_payload=beam_runner_api_pb2.ArtifactStagingToRolePayload(
+            staged_name=staged_name).SerializeToString())
+
+  @staticmethod
+  def _create_file_pip_requirements_artifact(local_path):
+    return beam_runner_api_pb2.ArtifactInformation(
+        type_urn=common_urns.artifact_types.FILE.urn,
+        type_payload=beam_runner_api_pb2.ArtifactFilePayload(
+            path=local_path).SerializeToString(),
+        role_urn=common_urns.artifact_roles.PIP_REQUIREMENTS_FILE.urn)
+
+  @staticmethod
+  def extract_staging_tuple_iter(
+      artifacts: List[beam_runner_api_pb2.ArtifactInformation]):
+    for artifact in artifacts:
+      if artifact.type_urn == common_urns.artifact_types.FILE.urn:

Review comment:
       Done.




----------------------------------------------------------------
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:
users@infra.apache.org