@@ -699,6 +699,8 @@ def _get_platform_for_default_sdk_container():
699699 # Base image
700700 pip_version = pkg_resources .get_distribution ('pip' ).version
701701 if parse_version (pip_version ) >= parse_version ('19.3' ):
702+ # pip can only recognize manylinux2014_x86_64 wheels
703+ # from version 19.3.
702704 return 'manylinux2014_x86_64'
703705 else :
704706 return 'manylinux2010_x86_64'
@@ -830,13 +832,15 @@ def _create_beam_sdk(sdk_remote_location, temp_dir):
830832 try :
831833 abi_suffix = 'm' if sys .version_info < (3 , 8 ) else ''
832834 # Stage binary distribution of the SDK, for now on a best-effort basis.
835+ platform_tag = Stager ._get_platform_for_default_sdk_container ()
833836 sdk_local_file = Stager ._download_pypi_sdk_package (
834837 temp_dir ,
835838 fetch_binary = True ,
836839 language_version_tag = '%d%d' %
837840 (sys .version_info [0 ], sys .version_info [1 ]),
838841 abi_tag = 'cp%d%d%s' %
839- (sys .version_info [0 ], sys .version_info [1 ], abi_suffix ))
842+ (sys .version_info [0 ], sys .version_info [1 ], abi_suffix ),
843+ platform_tag = platform_tag )
840844 sdk_binary_staged_name = Stager .\
841845 _desired_sdk_filename_in_staging_location (sdk_local_file )
842846 _LOGGER .info (
@@ -873,10 +877,10 @@ def _create_beam_sdk(sdk_remote_location, temp_dir):
873877 def _download_pypi_sdk_package (
874878 temp_dir ,
875879 fetch_binary = False ,
876- language_version_tag = '27 ' ,
880+ language_version_tag = '39 ' ,
877881 language_implementation_tag = 'cp' ,
878- abi_tag = 'cp27mu ' ,
879- platform_tag = 'manylinux1_x86_64 ' ):
882+ abi_tag = 'cp39 ' ,
883+ platform_tag = 'manylinux2014_x86_64 ' ):
880884 """Downloads SDK package from PyPI and returns path to local path."""
881885 package_name = Stager .get_sdk_package_name ()
882886 try :
@@ -911,7 +915,10 @@ def _download_pypi_sdk_package(
911915 '--platform' ,
912916 platform_tag
913917 ])
914- # Example wheel: apache_beam-2.4.0-cp27-cp27mu-manylinux1_x86_64.whl
918+ # Example wheel: with manylinux14 tag.
919+ # apache_beam-2.43.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl # pylint: disable=line-too-long
920+ if platform_tag == 'manylinux2014_x86_64' :
921+ platform_tag = 'manylinux_2_17_x86_64.' + platform_tag
915922 expected_files = [
916923 os .path .join (
917924 temp_dir ,
@@ -921,8 +928,9 @@ def _download_pypi_sdk_package(
921928 language_implementation_tag ,
922929 language_version_tag ,
923930 abi_tag ,
924- platform_tag ))
931+ platform_tag )),
925932 ]
933+
926934 else :
927935 _LOGGER .info ('Downloading source distribution of the SDK from PyPi' )
928936 cmd_args .extend (['--no-binary' , ':all:' ])
0 commit comments