Skip to content

Conversation

@scanon
Copy link
Member

@scanon scanon commented Nov 15, 2018

Pulls from Nvidia's registry didn't work for a few reasons. This addresses those issues. One thing I had to do was remove the check for application/json because the Nvidia registry sets it to text.

@coveralls
Copy link

coveralls commented Nov 15, 2018

Coverage Status

Coverage decreased (-0.005%) to 64.645% when pulling fddfe34 on scanon:nvcrfix into eaf113c on NERSC:master.

if creds and self.username is not None and self.password is not None:
if self.username=='$oauthtoken':
self.private = True
headers['Authoriation'] = 'Bearer %s' % (self.password)
Copy link
Contributor

Choose a reason for hiding this comment

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

authoriation is probably a typo

Copy link
Contributor

Choose a reason for hiding this comment

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

the password is just sent plaintext? not even the base64 encoded to assure special characters don't derail the whole thing?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah it is just a bearer token of some sort. Good catch on the misspelling. I'm confused as to how this worked now. Let me test this again.

Copy link
Member Author

Choose a reason for hiding this comment

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

It winds up the typo was part of why it worked. I need to figure out what is going on here.

@uvNikita
Copy link
Contributor

@scanon any news on this PR? Pulling from nvcr doesn't work for us currently.

@scanon
Copy link
Member Author

scanon commented Jul 18, 2019

@uvNikita Sorry. This fell of my radar. Let me push on it again.

Copy link
Contributor

@uvNikita uvNikita left a comment

Choose a reason for hiding this comment

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

I've added changes suggestion that I think fixed the issue for us. If I recall it correctly, the problem was that the scope parameter was not parsed properly.

auth_data = {}
auth_data = {'service':'', 'scope':'pull'}
for item in filter(None, re.split(r'(\w+=".*?"),', auth_data_str)):
(key, val) = item.split('=', 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(key, val) = item.split('=', 2)
(key, val) = item.split('=', 1)

auth_data = {'service':'', 'scope':'pull'}
for item in filter(None, re.split(r'(\w+=".*?"),', auth_data_str)):
(key, val) = item.split('=', 2)
auth_data[key] = val.replace('"', '')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
auth_data[key] = val.replace('"', '')
auth_data[key] = val.replace('"', '')
if '?scope=' in auth_data['realm']:
auth_data['realm'], auth_data['scope'] = auth_data['realm'].split('?scope=', 1)

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.

4 participants