Skip to content

Commit d0b7384

Browse files
authored
Fix Local Mode for non Framework containers. (aws#213)
Don't assume that sagemaker_submit_directory is present in the hyperparameters.
1 parent ab57f2d commit d0b7384

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
CHANGELOG
33
=========
44

5+
1.4.1
6+
=====
7+
8+
* bug-fix: Local Mode: Fix for non Framework containers
9+
510
1.4.0
611
=====
712

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You can install from source by cloning this repository and issuing a pip install
4848

4949
git clone https://github.com/aws/sagemaker-python-sdk.git
5050
python setup.py sdist
51-
pip install dist/sagemaker-1.4.0.tar.gz
51+
pip install dist/sagemaker-1.4.1.tar.gz
5252

5353
Supported Python versions
5454
~~~~~~~~~~~~~~~~~~~~~~~~~

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def read(fname):
2323

2424

2525
setup(name="sagemaker",
26-
version="1.4.0",
26+
version="1.4.1",
2727
description="Open source library for training and deploying models on Amazon SageMaker.",
2828
packages=find_packages('src'),
2929
package_dir={'': 'src'},

src/sagemaker/local/image.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,15 @@ def _prepare_training_volumes(self, data_dir, input_data_config, hyperparameters
309309
else:
310310
raise ValueError('Unknown URI scheme {}'.format(parsed_uri.scheme))
311311

312-
# If the training script directory is a local directory, mount it to the container.
313-
training_dir = json.loads(hyperparameters[sagemaker.estimator.DIR_PARAM_NAME])
314-
parsed_uri = urlparse(training_dir)
315-
if parsed_uri.scheme == 'file':
316-
volumes.append(_Volume(parsed_uri.path, '/opt/ml/code'))
317-
# Also mount a directory that all the containers can access.
318-
volumes.append(_Volume(shared_dir, '/opt/ml/shared'))
312+
# If there is a training script directory and it is a local directory,
313+
# mount it to the container.
314+
if sagemaker.estimator.DIR_PARAM_NAME in hyperparameters:
315+
training_dir = json.loads(hyperparameters[sagemaker.estimator.DIR_PARAM_NAME])
316+
parsed_uri = urlparse(training_dir)
317+
if parsed_uri.scheme == 'file':
318+
volumes.append(_Volume(parsed_uri.path, '/opt/ml/code'))
319+
# Also mount a directory that all the containers can access.
320+
volumes.append(_Volume(shared_dir, '/opt/ml/shared'))
319321

320322
return volumes
321323

0 commit comments

Comments
 (0)