-
Notifications
You must be signed in to change notification settings - Fork 167
Document how to setup a local Postgres DB #981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #981 +/- ##
=======================================
- Coverage 96.5% 96.5% -0.1%
=======================================
Files 60 60
Lines 5155 5155
=======================================
- Hits 4976 4975 -1
- Misses 179 180 +1 |
doc/install-adv.rst
Outdated
| --------------------- | ||
|
|
||
| The new ixmp4 package is `only feature-complete <https://github.com/iiasa/ixmp4/pull/190>`__ when using `PostgreSQL <https://www.postgresql.org/>`__. | ||
| If you want to work on such a database locally, you need to get an instance running locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use SemBr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I hope :)
doc/install-adv.rst
Outdated
|
|
||
| .. note:: | ||
| The values for `POSTGRES_PASSWORD` and `POSTGRES_DB` are chosen to set up a database instance that is found by :mod:`ixmp`'s default configuration. | ||
| You are free to choose different values here, but will have to adapt the configuration, too, in that case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I would wonder is: at what point, and how, should one enter these values into the ixmp configuration, such that ixmp4 will connect to this database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, to be honest. In the test suite, platforms are added to ixmp4 using a --dsn that includes these values, but then the migrations are run using IXMP4_MANAGED=False because locally on my system, running them without this produces an error.
The ixmp platforms are then created dynamically as the tests need them, hardcoding the values.
For "real world users", I think the values should be provided much like they are now: one needs to enter a platform name and credentials to the ixmp config (e.g. using the CLI or by manually editing the config file) before one can connect to the underlying DB.
It seems to me that we mainly need a test to ensure that ixmp reads these values correctly and passes them on to ixmp4.
What keeps me from doing that is my lack of understanding/familiarity with the authentication system in ixmp4. I'm not quite sure how it works and if it works at all when not using the RestAPI layer (but the DB layer directly, either directly directly or via the core layer). Maybe @meksor knows what's missing to test this/get it to work.
955b722 to
dfe3525
Compare
- Add ixmp4 to intersphinx configuration.
khaeru
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this addition!
I made some edits to clarify a few points, including:
- The section is only relevant when using IXMP4Backend.
- The relationship between the DSN configuration and the arguments to the
docker runcommand. - Data persistence across container restarts.
Working on the ixmp shim, I realized that we will need a guide on how to setup a local postgres DB. It seems we store theses guides in the advanced install instructions here, so I'm opening this PR to accompany iiasa/ixmp#601.
How to review
PR checklist
Add or expand tests;coverage checks both ✅