Skip to content

Login to ECR if needed for Local Mode #121

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 4 commits into from
Apr 3, 2018
Merged

Conversation

iquintero
Copy link
Contributor

This also includes:

Use 'sagemaker-local' docker network for LocalMode

Instead of having docker-compose generate a random network each time,
use a constant network.

Ignacio Quintero added 4 commits April 2, 2018 09:34
This makes life easier in our Notebook instances.
Instead of having docker-compose generate a random network each time,
use a constant network.
When running local mode the SDK will perform an ECR login if required.
@iquintero iquintero merged commit 17d24a1 into aws:master Apr 3, 2018
@@ -390,7 +409,8 @@ def _build_optml_volumes(self, host, subdirs):
return volumes

def _cleanup(self):
_check_output('docker network prune -f')
# we don't need to cleanup anything at the moment
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a TODO (rignacio) here to remove this function later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will not remove this function, I will add to it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Them add a TODO (rignacio) here to write this function later :)

ecr_url = auth['authorizationData'][0]['proxyEndpoint']

cmd = "docker login -u AWS -p %s %s" % (token, ecr_url)
subprocess.check_output(cmd, shell=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes we are using _check_output and sometimes we are using subprocess.checkoutput. Can we just use one of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a good reason for this. I will probably refactor this anyways.

@iquintero iquintero deleted the ecr_login branch May 9, 2018 23:19
apacker pushed a commit to apacker/sagemaker-python-sdk that referenced this pull request Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants