aiidalab / aiidalab/aiidalab-docker-stack

Enable automated migration of the PostgreSQL database.

Open
#25 6 comments 0 reactions 1 assignee Claimed by @yakutovicha View on GitHub
Dominant language
Python
Stars
10
Forks
15
Avg merge
1d 18h
Merged PRs (30d)
3

Description

This issue has the following dependencies:

- [ ] https://github.com/aiidateam/aiida-prerequisites/issues/41
- [ ] https://github.com/aiidalab/aiidalab-home/issues/94

---
The migration scripts down below are based on the official [migration recipes](https://www.postgresql.org/docs/10/upgrading.html) as suggested by @ltalirz.

**To clarify**:

- [x] Identify at which point of the container's life the migration should happen: at startup or at runtime?
[Answer]: It should be run at runtime as we cannot guarantee that there is enough time during the startup.
- [x] Decide whether we want to enable the migration inside the aiidalab (or aiida) container, or maybe we want to provide a separate dedicated container for this?
[Answer]: It will be installed in the same container.
- [x] Should we install both: the old and new versions of Postgres in the same container. [Answer: YES]
- [x] Depending on the previous answer: how would we interface migration to the user? Should we run it in the background, or should we put a big message on the startup screen saying that "Image is updated, migration is required"?
[Answer]: In AiiDAlab, it would be a part of the Home app. The user will be notified about the possible migration and provided with an option to run it. The migration will block all the AiiDA operations.
- [x] Agree whether we want to use the recommended PostgreSQL way of migration (e.g. via pg_dump) or should we use less tested `pg_upgrade` instead?
[Answer: pg_dump]

**Possible upgrade path:**

1. Have both (previous and current) versions of PostgreSQL in the same container
2. In case the default version is not the newest one - signal to the user about this: "New version of PostgreSQL is available, please upgrade".
3. Block the interface for the whole upgrade process.
4. Perform the dump of the database from the old PostgreSQL.
5. Switch to the newer PostgreSQL and import the dump.
6. Switch the default PostgreSQL
7. Restart the container.
8. Signal to the user that the old database and database dump are still in the filesystem. Propose them to delete those.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.