#NEWLINE# def _upload_job_files( self , where , job_dir , job , job_configs ) : #NEWLINE# #INDENT# def upload( r , dir , job_file , proxy_configs ) : #NEWLINE# #INDENT# dst = os . path . join ( dir , job_file . name ) #NEWLINE# raw_data = dispatch . get_raw_binary ( job_file , proxy_configs = proxy_configs , remote = r ) #NEWLINE# if ( isinstance ( raw_data , dict ) and ( raw_data [ 'type' ] == 'path' ) ) : #NEWLINE# #INDENT# dst = raw_data [ 'path' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# r . write_file_to ( dst , raw_data ) #NEWLINE# #UNINDENT# return dst #NEWLINE# #UNINDENT# def upload_builtin( r , dir , builtin ) : #NEWLINE# #INDENT# dst = os . path . join ( dir , builtin [ 'name' ] ) #NEWLINE# r . write_file_to ( dst , builtin [ 'raw' ] ) #NEWLINE# return dst #NEWLINE# #UNINDENT# builtin_libs = [ ] #NEWLINE# if edp . is_adapt_spark_for_swift_enabled ( job_configs . get ( 'configs' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) ) : #NEWLINE# #INDENT# path = 'service/edp/resources/edp-spark-wrapper.jar' #NEWLINE# name = ( 'builtin-%s.jar' % six . text_type ( uuid . uuid4 ( ) ) ) #NEWLINE# builtin_libs = [ { #NEWLINE# #INDENT# 'raw' : files . get_file_text ( path ) , #NEWLINE# 'name' : name , #NEWLINE# #UNINDENT# } ] #NEWLINE# #UNINDENT# uploaded_paths = [ ] #NEWLINE# builtin_paths = [ ] #NEWLINE# with remote . get_remote ( where ) as r : #NEWLINE# #INDENT# mains = ( list ( job . mains ) if job . mains else [ ] ) #NEWLINE# libs = ( list ( job . libs ) if job . libs else [ ] ) #NEWLINE# for job_file in ( mains + libs ) : #NEWLINE# #INDENT# uploaded_paths . append ( upload ( r , job_dir , job_file , job_configs . get ( 'proxy_configs' ) ) ) #NEWLINE# #UNINDENT# for builtin in builtin_libs : #NEWLINE# #INDENT# builtin_paths . append ( upload_builtin ( r , job_dir , builtin ) ) #NEWLINE# #UNINDENT# #UNINDENT# return ( uploaded_paths , builtin_paths )