pnnl / ExaGO

High-performance power grid optimization for stochastic, security-constrained, and multi-period ACOPF problems.
Other
60 stars 9 forks source link

Containerized Visualization + ChatGrid #147

Open nedpfeiffer opened 1 week ago

nedpfeiffer commented 1 week ago

Merge request type

Relates to

This MR updates

Summary

I containerized the ExaGO visualization + ChatGrid with Docker Compose, simplifying set up. I also updated the documentation.

These proposed changes will break existing manual installations and will force users to switch to Docker Compose. I had to edit viz/backend/sqlchain.py and viz/backend/config.py to get the backend and database containers communicating. If there's an approach that won't break existing manual installs, I'm happy to try to tackle that.

abhyshr commented 1 week ago

Thanks, @nedpfeiffer. @sichenjin : Can you please take a look at this pull request. @cameronrutherford : Can you take a look at this and see if this can be added/merged to the ExaGO docker instance?

cameronrutherford commented 1 week ago

Thanks, @nedpfeiffer. @sichenjin : Can you please take a look at this pull request. @cameronrutherford : Can you take a look at this and see if this can be added/merged to the ExaGO docker instance?

The existing Docker configuration for ExaGO is a mix of our GitHub container registry (ghcr) deployment, as well as the .devcontainer folder in the repo. They are separate, and for the moment can't really be merged.

For the ExaGO deployment in the EIOC Virtual Machine, I modified the Dockerfile in .devcontainer/Dockerfile to remove the frontend viz component. @nedpfeiffer now has the viz as a standalone Dockerfile, so I could consider removing the viz from the devcontainer...

In future, once we have a ghcr version of ExaGO w/o the need for CoinHSL, both the Docker compose and devcontainer can be changes to just use that deployment.

sichenjin commented 1 week ago

This is awesome, @nedpfeiffer! The setup process has been greatly simplified, and I really appreciate it. I tested it locally, and the visualization works perfectly. However, could you provide more details on how the database is currently connected to the backend? I followed the instructions to edit the setup.env file, but it seems ChatGrid can't read the database information correctly. Additionally, I'm not very familiar with Docker. Is it possible to access the backend output for debugging when running the code in Docker? Thank you.

nedpfeiffer commented 1 week ago

However, could you provide more details on how the database is currently connected to the backend?

Docker configures a default virtual network and automatically resolves hostnames to the names of the containers. In sqlchain.py I replaced localhost with database, and Docker does the rest.

I followed the instructions to edit the setup.env file, but it seems ChatGrid can't read the database information correctly.

Please make sure you've run geninputfile.py and jsontocsv.py on your input file. If the csv files haven't been generated, the database won't get populated using the init.sql script.

Is it possible to access the backend output for debugging when running the code in Docker?

I took a cursory look at this and haven't found an easy solution such as adding --debug to the last line of the Dockerfile. I've been using the logs left by console.log and pgadmin to troubleshoot issues so far. I'll keep looking for a solution.