Skip to content

Login to ECR if needed for Local Mode#121

Merged
iquintero merged 4 commits into
aws:masterfrom
iquintero:ecr_login
Apr 3, 2018
Merged

Login to ECR if needed for Local Mode#121
iquintero merged 4 commits into
aws:masterfrom
iquintero:ecr_login

Conversation

@iquintero
Copy link
Copy Markdown
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
def _cleanup(self):
_check_output('docker network prune -f')
# we don't need to cleanup anything at the moment
pass
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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