@@ -59,18 +59,27 @@ def _parse_args():
59
59
60
60
for arch in ['cpu' , 'gpu' ]:
61
61
for py_version in ['2' , '3' ]:
62
+
62
63
binary_url = binaries ['py{}-{}' .format (py_version , arch )]
63
64
binary_file = os .path .basename (binary_url )
64
65
cmd = 'wget -O {}/{} {}' .format (build_dir , binary_file , binary_url )
65
- print ('Downloading binary file {}: ' .format (cmd ))
66
+ print ('Downloading binary file: {}' .format (cmd ))
66
67
subprocess .check_call (cmd .split ())
68
+
67
69
tag = '{}-{}-py{}' .format (args .version , arch , py_version )
68
70
prev_image_uri = '{}.dkr.ecr.{}.amazonaws.com/{}:{}' .format (args .account , args .region , args .repo , tag )
69
71
dockerfile = os .path .join (build_dir , 'Dockerfile.{}' .format (arch ))
70
- build_cmd = 'docker build -f {} --cache-from {} ' \
72
+
73
+ tar_file_name = subprocess .check_output ('ls {}/sagemaker_tensorflow_container*' .format (build_dir ),
74
+ shell = True ).strip ().decode ('ascii' )
75
+ print ('framework_support_installable is {}' .format (os .path .basename (tar_file_name )))
76
+
77
+ build_cmd = 'docker build -f {} --cache-from {} --build-arg framework_support_installable={} ' \
71
78
'--build-arg py_version={} --build-arg framework_installable={} ' \
72
- '-t {}:{} {}' .format (dockerfile , prev_image_uri , py_version , binary_file , args .repo , tag , build_dir )
79
+ '-t {}:{} {}' .format (dockerfile , prev_image_uri , os .path .basename (tar_file_name ), py_version ,
80
+ binary_file , args .repo , tag , build_dir )
73
81
print ('Building docker image: {}' .format (build_cmd ))
74
82
subprocess .check_call (build_cmd .split ())
83
+
75
84
print ('Deleting binary file {}' .format (binary_file ))
76
85
subprocess .check_call ('rm {}' .format (os .path .join (build_dir , binary_file )).split ())
0 commit comments