openflighthpc / flight-control

0 stars 0 forks source link

Record instance details in database instead of text files #56

Closed timalces closed 1 year ago

timalces commented 2 years ago

Currently instance prices and sizes (mem, CPU and GPU) are queried from AWS and Azure each each night and recorded in text files (lib/platform_files), as the queries are very slow to complete. These files are read once and stored in memory (see Instance class method set_instance_details) when the application first starts. This means changes are not applied until the application restarts.

This logic is carried over from the original cloud cost visualiser, which recorded hundreds of different instance types (so the text files were very large), was only used to show forecasted costs, and had no issue being regularly restarted.

Flight Control now has much more sophisticated logic, so only instance prices and sizes we are currently using are recorded, and restarting regularly is not appropriate. We should therefore move to storing these instance details in the database.

This will involve: