aiidalab / aiidalab/aiidalab-docker-stack

Enable automated migration of the PostgreSQL database.

Đang mở
#25 6 bình luận 0 reaction 1 người được giao Được @yakutovicha nhận Xem trên GitHub
Ngôn ngữ chính
Python
Star
10
Fork
15
Merge trung bình
1 ngày 18 giờ
Pull request đã merge (30 ngày)
3

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.