optlang icon indicating copy to clipboard operation
optlang copied to clipboard

Enable Gurobi license parameters to be loaded through environment variables

Open jonrkarr opened this issue 3 years ago • 1 comments

The Gurobi API can be used to invoke Gurobi with license information passed through environment variables rather than license files. This would make it easier to deploy OptLang with Gurobi in containers (e.g., Docker, Singularity).

import gurobipy
params = {
    'LICENSEID': int(os.getenv('GRB_LICENSEID')),
    ...
}
env = gurobipy.Env(params=params)
model = gurobipy.Model(env=env)

jonrkarr avatar Sep 06 '21 17:09 jonrkarr