mandag den 12. oktober 2015

Authenticating Gurobi Academic Licenses on an external server

I've been using Gurobi to program optimization problems directly in Python, as they provide an excellent pythonic API, as well as free academic licenses with very little fuss.

In running a tutorial to teach my colleagues how to use Python and Gurobi, I wanted to write my tutorials in an iPython notebook and serve this up on a web server. This would skip all the mess that can occur with installation of Python + packages on Windows/Mac, waiting for the entire room to install everything, and getting Gurobi installed and running for everyone.

However, the server I'm running the iPython notebook server on is in the cloud, and thus not located at an academic IP. This causes Gurobi's validation program to fail.

The solution below solves this issue, and the equivalent problem of authenticating on a server without direct internet access.



To solve this issue, I have the following tools:

  • A laptop connected at an academic institution
  • A server with a functioning ssh server
  • A free academic license key from Gurobi's website
On the client side, issue the command

$ ssh -R 8008:apps.gurobi.com:80 remote.server.com

Then on the server connection that opens, navigate to the Gurobi installation directory (e.g. $ cd /opt/gurobi604/linux64/bin) and execute the command

$ ./grbgetkey --verbose --port=8008 --server=localhost LICENSE-KEY-HERE

NOTE: Gurobi Free Academic Licenses are provided for research and educational purposes only. This guide is not intended to promote usage outside this limited scope. If you can't authenticate your local machine, you won't be able to authenticate your server. Sorry.

Ingen kommentarer:

Send en kommentar