Skip to content
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

Split the CUDADriver recipe into a download and a munki part. #1

Merged
merged 6 commits into from
Jun 15, 2015
Merged

Split the CUDADriver recipe into a download and a munki part. #1

merged 6 commits into from
Jun 15, 2015

Conversation

mkuron
Copy link
Contributor

@mkuron mkuron commented Apr 2, 2014

Split the CUDADriver recipe into a download and a Munki part. That way, I can use it with the Importer I wrote for MunkiServer.

@jessepeterson
Copy link
Member

Sorry I didn't see this before now (wasn't watching the repo). It appears you've got non-download things in the download recipe. I think only the three processors (CUDADriverURLProvider, URLDownloader, and EndOfCheckPhase) ought to be in the download.

@mkuron
Copy link
Contributor Author

mkuron commented Apr 29, 2014

I wasn't sure about whether determining the version should be part of the download or part of the import. The way it is in my pull request made more sense to me as determining the version is generic to all importers.
I've looked at some of the sample recipes and you're right, this is commonly done in the import/package build recipe and not in the download recipe.

I've noticed that https://partners.download.nvidia.com/activation/cuda_update_macos.xml contains the exact version number in the kServerVersion key, so how about simply exporting that as the version variable straight from the Python script and dropping all the pkg extraction stuff to find the version number?

@jessepeterson
Copy link
Member

The way it is in my pull request made more sense to me as determining the version is generic to all importers.

This makes sense — I hadn't considered that. I was focused on the way it's usually done.

so how about simply exporting that as the version variable straight from the Python script and dropping all the pkg extraction stuff to find the version number?

This introduces an element of trust that Nvidia know what they're doing. I would think to the spirit of autopkg it would want to get what the package itself thinks it's version is (since that's whats going to be installed). However I'd be willing to give it a try. Perhaps @timsutton might have a perspective (I think he uses this package, too). All that being said it'd be nice to skip all the pkg extraction crap.

@mkuron
Copy link
Contributor Author

mkuron commented Apr 29, 2014

I'm guessing Nvidia's auto-updater checks that exact same key against the installed version. So as long as that XML file stays there and keeps its current format (both of which we already depend on), it should be safe to depend on the kServerVersion being sensible.

@jessepeterson
Copy link
Member

Okay, you've convinced me. :) Can you update the pull to reflect all that?

Force SSLv3 because the server does not seem to like urllib2's default of SSLv2+SSLv3 anymore.
@mkuron
Copy link
Contributor Author

mkuron commented May 4, 2014

Here's the commit for using kServerVersion.

On a different note, the urllib2.urlopen() call appears to have stopped working recently because Nvidia's server no longer accepts mixed SSLv2 and SSLv3 negotiation. curl is also affected by this if you don't force SSLv3:

$ curl 'https://partners.download.nvidia.com/activation/cuda_update_macos.xml'
curl: (35) Unknown SSL protocol error in connection to partners.download.nvidia.com:443 
$ curl -2 'https://partners.download.nvidia.com/activation/cuda_update_macos.xml'
curl: (35) Unknown SSL protocol error in connection to partners.download.nvidia.com:443 
$ curl -3 'https://partners.download.nvidia.com/activation/cuda_update_macos.xml'
<?xml version="1.0" encoding="UTF-8"?>
[...]

As urllib before Python 3 does not support customized openers, I figured using curl through subprocess would be easiest. Alternatives like using NSURL* via the PyObjC bindings or using the socket and ssl modules directly would have required dozens more code lines.

@jessepeterson
Copy link
Member

Yikes, sorry for not seeing updates on this! What's the current status? The CUDADriver package appears to be downloading fine now — perhaps they relaxed the requirement?

@mkuron
Copy link
Contributor Author

mkuron commented Jun 11, 2015

This probably depends on the system Python version. Most web servers now disable SSLv3 for security reasons, and probably only newer Python versions (OS X 10.10 and higher maybe?) default to TLS. So I'd suggest keeping the curl for better compatibility and in case Nvidia ever decides to make another change to their HTTPS configuration.

@timsutton
Copy link
Member

For me the recipe currently works without curl. A couple comments to follow in @mkuron's most recent commit..

@mkuron
Copy link
Contributor Author

mkuron commented Jun 15, 2015

Here's the commit that merges the latest changes from master. I think the pull request is ready to merge now.

jessepeterson added a commit that referenced this pull request Jun 15, 2015
Split the CUDADriver recipe into a download and a munki part; OS version matching changes.
@jessepeterson jessepeterson merged commit ecb2cb6 into autopkg:master Jun 15, 2015
jessepeterson added a commit that referenced this pull request Aug 11, 2015
…eator from PR #1. Only noticed issue when trying on a fresh autopkg Cache.
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