Skip to content

Commit d57e1ae

Browse files
icywang86ruilaurenyu
authored andcommitted
fix: use tar file name as framework_support_installable in build_all.py (#192)
1 parent 4610af3 commit d57e1ae

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

scripts/build_all.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,27 @@ def _parse_args():
5959

6060
for arch in ['cpu', 'gpu']:
6161
for py_version in ['2', '3']:
62+
6263
binary_url = binaries['py{}-{}'.format(py_version, arch)]
6364
binary_file = os.path.basename(binary_url)
6465
cmd = 'wget -O {}/{} {}'.format(build_dir, binary_file, binary_url)
65-
print('Downloading binary file {}: '.format(cmd))
66+
print('Downloading binary file: {}'.format(cmd))
6667
subprocess.check_call(cmd.split())
68+
6769
tag = '{}-{}-py{}'.format(args.version, arch, py_version)
6870
prev_image_uri = '{}.dkr.ecr.{}.amazonaws.com/{}:{}'.format(args.account, args.region, args.repo, tag)
6971
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={} ' \
7178
'--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)
7381
print('Building docker image: {}'.format(build_cmd))
7482
subprocess.check_call(build_cmd.split())
83+
7584
print('Deleting binary file {}'.format(binary_file))
7685
subprocess.check_call('rm {}'.format(os.path.join(build_dir, binary_file)).split())

0 commit comments

Comments
 (0)