Gurobi highly recommends using an API key to authenticate with a Cluster Manager.
To create a new Cluster Manager API key, navigate to the Cluster Manager web interface (for example: http://mymanager:61080) and log in. See Verification for the default credentials for a new install and how to change them. In the top-right corner, click the username and open the API Keys menu:
In the API Keys menu, click the "Create API Key" button to create a new API key.
Using an API key
To use an API key in a client license file, create a file called gurobi.lic of the following form:
CSMANAGER=http://mymanager:61080
CSAPIACCESSID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CSAPISECRET=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
An API key can also be specified directly in an application with the CSManager, CSAPIAccessID, and CSAPISecret parameters. For example, in Python:
import gurobipy as gp
from gurobipy import GRB
params = {
'CSManager': 'http://mymanager:61080',
'CSAPIAccessID': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'CSAPISecret': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
}
with gp.Env(params=params) as env:
with gp.Model(env=env) as m:
# Write model here
Comments
0 comments
Article is closed for comments.