Web License Service (WLS) licenses allow you to run Gurobi from any internet-connected Windows, Linux, or macOS device. They may be configured to work in containers, outside of containers (in a physical or virtual machine running Windows, Linux, or macOS), or in both types of environments.
To use a WLS license, your application will need to provide valid credentials, which can be done in several ways as described below. When your application starts a Gurobi environment, it will communicate with the Gurobi WLS server over the internet to retrieve a token allowing it to proceed.
Using a license file
The simplest way to use a WLS license is with an API key stored in a gurobi.lic license file. To retrieve an API key for your license, visit the Web License Manager site, log in to your account, click on the API Keys tab, and finally click CREATE API KEY to create and download an API key for that license. Alternatively, click on the Licenses tab, and click Download on the license that you want to use. This will create an API key.
If you are setting up a WLS Compute Server license, move the license file to the machine, VM, or container that will act as a Compute Server, if necessary.
We recommend that you store the resulting gurobi.lic file in a default location. If you do need to store the license file somewhere other than the default location, please see Where do I place the Gurobi license file (gurobi.lic)? for important details.
The gurobi.lic file should contain three lines like this:
WLSACCESSID=203dec48-e3f8-46ac-0184-92d7d6ded944 WLSSECRET=a080cce8-4e01-4e36-955e-61592c5630db LICENSEID=12127
These provide the license ID, an access ID for that license, and the corresponding secret key. These credentials are private and should not be shared with anyone who is not entitled to use your license.
Using Gurobi parameters
If you are writing an application that calls Gurobi from a programming language API, you can provide your credentials through that API. You do this by retrieving an API key, as above, and setting the LICENSEID, WLSACCESSID, and WLSSECRET parameters to the values associated with that key.
For Python, this may look as follows:
import gurobipy as gp options = { "WLSACCESSID": "203dec48-e3f8-46ac-0184-92d7d6ded944", "WLSSECRET": "a080cce8-4e01-4e36-955e-61592c5630db", "LICENSEID": 12127, } with gp.Env(params=options) as env, gp.Model(env=env) as model: # Formulate problem model.optimize()
Please note that LicenseID is a numeric parameter, while the two WLS parameters require a string input value.
Comments
0 comments
Article is closed for comments.