Skip to content

Add gov cloud account number for framework #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/sagemaker/fw_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def create_image_uri(region, framework, instance_type, framework_version, py_ver
str: The appropriate image URI based on the given parameters.
"""

# Handle Account Number for Gov Cloud
if region == 'us-gov-west-1':
account = '246785580436'

# Handle Local Mode
if instance_type.startswith('local'):
device_type = 'cpu' if instance_type == 'local' else 'gpu'
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/test_fw_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def test_create_image_uri_default_account():
assert image_uri == '520713654638.dkr.ecr.mars-south-3.amazonaws.com/sagemaker-mlfw:1.0rc-gpu-py3'


def test_create_image_uri_gov_cloud():
image_uri = create_image_uri('us-gov-west-1', 'mlfw', 'ml.p3.2xlarge', '1.0rc', 'py3')
assert image_uri == '246785580436.dkr.ecr.us-gov-west-1.amazonaws.com/sagemaker-mlfw:1.0rc-gpu-py3'


def test_invalid_instance_type():
# instance type is missing 'ml.' prefix
with pytest.raises(ValueError):
Expand Down