d-krupke / cpsat-primer

The CP-SAT Primer: Using and Understanding Google OR-Tools' CP-SAT Solver
https://d-krupke.github.io/cpsat-primer/
Creative Commons Attribution 4.0 International
367 stars 35 forks source link

Deployment to Cloud for the API #36

Open d-krupke opened 3 months ago

d-krupke commented 3 months ago

Instead of just using some worker containers, it may be cheaper to deploy the code to the cloud and use google cloud run to schedule and run the optimization on demand. Especially for low frequency APIs, this can be significantly cheaper as you only need to rent an expensive cloud machine for the time you are actually optimizing. Should not be too complicated, but I am not a cloud expert, so I am slow in getting all the details right and not just having a "worked for me".

d-krupke commented 3 months ago

This could be a subsection at the end of https://d-krupke.github.io/cpsat-primer/building_an_optimization_api.html

michip commented 3 months ago

For people with unlimited budgets, the AWS on-demand instances might also be an option. Also (in general) for optimization tasks where you don't need an immediate result, the "EC2 spot instances" could offer a nice discount in comparison with other servers types.

d-krupke commented 3 months ago

I don't know much about AWS. However, I know that one can do some heavy optimization in Google Cloud with only a few euros for the worker (on big machines). I would also know how to implement that part, though, I have never been responsible for the actual deployment. What I am not sure about, yet, is how to deploy the web and redis containers cheaply.

For people with unlimited budgets, the AWS on-demand instances might also be an option. Also (in general) for optimization tasks where you don't need an immediate result, the "EC2 spot instances" could offer a nice discount in comparison with other servers types.

d-krupke commented 3 months ago

Considering that OR-Tools is Google, I would like to have Google Cloud in there out of respect. They don't make money with OR-Tools but they make money with the cloud. Adding an additional AWS section would of course also be nice, but if we do that, I would like to publish it together with a Google Cloud section.