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

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

                Author: ASF GitHub Bot
            Created on: 18/Jan/22 20:08
            Start Date: 18/Jan/22 20:08
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on a change in pull request #16448:
URL: https://github.com/apache/beam/pull/16448#discussion_r787111889



##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -692,6 +718,46 @@ def _populate_requirements_cache(requirements_file, 
cache_dir):
       ]
       _LOGGER.info('Executing command: %s', cmd_args)
       processes.check_output(cmd_args, stderr=processes.STDOUT)
+    else:  # try to download wheels
+      language_implementation_tag = 'cp'
+      language_version_tag = '%d%d' % (
+          sys.version_info[0], sys.version_info[1])  # Python version
+      abi_suffix = 'm' if sys.version_info < (
+          3, 8) else ''  # ABI suffix to use for the whl
+      abi_tag = 'cp%d%d%s' % (
+          sys.version_info[0], sys.version_info[1], abi_suffix
+      )  # ABI tag to use
+      # install each package individually
+      for requirement in requirements_to_install:
+        try:
+          # download the bdist compatible with the debian platform
+          # TODO(anandinguva): the platform tag will get updated. Check PEP 600

Review comment:
       From offline discussions: 
   - We can rewrite TODO to make it more actionable (do X why Y is fixed)
   - _download_pypi_package currently does not do the command line 
   - We can likely use the same method for _download_pypi_package and 
_download_pypi_sdk_package if the download params are the same.

##########
File path: sdks/python/apache_beam/runners/portability/stager.py
##########
@@ -692,6 +718,46 @@ def _populate_requirements_cache(requirements_file, 
cache_dir):
       ]
       _LOGGER.info('Executing command: %s', cmd_args)
       processes.check_output(cmd_args, stderr=processes.STDOUT)
+    else:  # try to download wheels
+      language_implementation_tag = 'cp'
+      language_version_tag = '%d%d' % (
+          sys.version_info[0], sys.version_info[1])  # Python version
+      abi_suffix = 'm' if sys.version_info < (
+          3, 8) else ''  # ABI suffix to use for the whl
+      abi_tag = 'cp%d%d%s' % (
+          sys.version_info[0], sys.version_info[1], abi_suffix
+      )  # ABI tag to use
+      # install each package individually
+      for requirement in requirements_to_install:
+        try:
+          # download the bdist compatible with the debian platform
+          # TODO(anandinguva): the platform tag will get updated. Check PEP 600

Review comment:
       From offline discussion: 
   - We can rewrite TODO to make it more actionable (do X why Y is fixed)
   - _download_pypi_package currently does not do the command line 
   - We can likely use the same method for _download_pypi_package and 
_download_pypi_sdk_package if the download params are the same.




-- 
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: [email protected]

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


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

    Worklog Id:     (was: 710828)
    Time Spent: 6h 20m  (was: 6h 10m)

> Support staging binary distributions of dependency packages.
> ------------------------------------------------------------
>
>                 Key: BEAM-4032
>                 URL: https://issues.apache.org/jira/browse/BEAM-4032
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>            Reporter: Valentyn Tymofieiev
>            Assignee: Anand Inguva
>            Priority: P2
>          Time Spent: 6h 20m
>  Remaining Estimate: 0h
>
> requirements.txt only supports source-distribution dependencies [1].
> --extra_packages does not officially support wheel files [2].
> It is possible to expand this to support binary distributions as long as we 
> have the knowledge of the target platform.
> We should take into consideration the mechanisms of staging dependencies 
> through portability framework, and perhaps consolidate some of the existing 
> options.
> [https://github.com/apache/beam/blob/a79d1b4fc27eb81db0d9a773047820a206f3d238/sdks/python/apache_beam/runners/dataflow/internal/dependency.py#L260]
> [https://github.com/apache/beam/blob/a79d1b4fc27eb81db0d9a773047820a206f3d238/sdks/python/apache_beam/runners/dataflow/internal/dependency.py#L188]
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to