optlang
optlang copied to clipboard
Enable Gurobi license parameters to be loaded through environment variables
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)