Skip to content

sagemaker.image_uris.retrieve for custom docker images in ecr (no framework) #1902

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

Closed
walter-hernandez opened this issue Sep 17, 2020 · 3 comments

Comments

@walter-hernandez
Copy link

What did you find confusing? Please describe.
The call sagemaker.amazon.amazon_estimator.get_image_uri was migrated to sagemaker.image_uris.retrieve . There is no information about how to make the calls to get the image url of a custom docker image in ecr that was created using Sagemaker .

Describe how documentation can be improved
How do you make the call to get the uri of custom docker image using the library sagemaker-training? This docker image is not using any of the prebuilt frameworks.

Additional context
Before you just did:
container_image_uri = get_image_uri(repo_name, repo_region, repo_version)

The above was specially useful when you were bringing your own custom docker images that were not using a framework in particular.

Kind regards,

Walter

@chuyang-deng
Copy link
Contributor

Hi @walter-hernandez, the image_uris.retrieve() does not support customized docker images. image_uris will only retrieve prebuilt images listed here: https://github.com/aws/sagemaker-python-sdk/tree/master/src/sagemaker/image_uri_config

If you wish to use customized images, please use image_uri parameter in your estimator or model constructors:
https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/estimator.py#L1483
https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/model.py#L36

@walter-hernandez
Copy link
Author

Thank you for your quick answer!

I was using get_image_uri as an automatic way to get the container url in ecr to pass to the estimator, but for what I see, it is not possible to do so anymore with the way that image_uris.retrieve() works

@walter-hernandez
Copy link
Author

I am closing this issue. I am leaving a solution here if someone comes in the future into this thread with the same issue, a solution to get the container ecr uri is to do:
'{0}.dkr.ecr.{1}.amazonaws.com/{2}:{3}'.format(account_id, region_name, ecr_repository_name, version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants