Skip to content

Commit 46a62cc

Browse files
authored
Merge pull request #2252 from codalab/doc-1.24
Add upgrade instructions for 1.24 in documentation
2 parents 8ca3c78 + 3554b3b commit 46a62cc

3 files changed

Lines changed: 67 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
!!! note "After upgrading from Codabench <1.24.0, you will need to perform important manual interventions."
2+
3+
## Rabbit
4+
We also need to log into the RabbitMQ interface and enable the flags it wants us to enable after upgrading.
5+
6+
RabbitMQ port, username and password to access the interface are defined in the `.env` file.
7+
8+
![Rabbit-screenshot](../_attachments/554725936-6659efd8-e953-42dd-b885-629c41beb1c7.png)
9+
10+
More information about feature flags [here](https://www.rabbitmq.com/docs/feature-flags)
11+
12+
13+
## Database (Postgres 12 -> 18)
14+
### 1. Maintenance mode on to avoid update on the database during the upgrade:
15+
16+
```sh
17+
touch maintenance_mode/maintenance.on
18+
git pull
19+
```
20+
21+
### 2. Create the new `postgres.conf` file from the sample:
22+
23+
```sh
24+
cp my-postgres_sample.conf my-postgres.conf
25+
```
26+
27+
### 3. Rebuild docker containers to take into account the new images:
28+
29+
```sh
30+
docker compose build --no-cache
31+
```
32+
33+
### 4. Dump the database, remove it and reload it on the new configuration:
34+
35+
```sh
36+
# Dump database
37+
docker compose exec db bash -lc 'PGPASSWORD="$DB_PASSWORD" pg_dump -Fc -U "$DB_USERNAME" -d "$DB_NAME" -f /app/backups/upgrade-1.24.dump'
38+
```
39+
40+
```sh
41+
# Check that dump file is not empty
42+
docker compose exec db bash -lc 'ls -lh /app/backups/upgrade-1.24.dump && pg_restore -l /app/backups/upgrade-1.24.dump | head'
43+
```
44+
45+
**/!\ Dangerous operation here: confirm that your dump worked before removing the database!**
46+
47+
```sh
48+
# Remove database
49+
sudo rm -rf var/postgres
50+
```
51+
52+
```sh
53+
# Launch the new containers (containing the updated databse image and Restore from backup)
54+
docker compose up -d db
55+
docker compose exec db bash -lc 'PGPASSWORD="$DB_PASSWORD" pg_restore --verbose --clean --no-acl --no-owner -h $DB_HOST -U "$DB_USERNAME" -d "$DB_NAME" /app/backups/upgrade-1.24.dump'
56+
```
57+
58+
_See [this](https://www.postgresql.org/docs/18/upgrading.html) for more details._
59+
60+
### 5 Restart the rest of the services and disable maintenance mode:
61+
62+
```sh
63+
docker compose up -d
64+
rm maintenance_mode/maintenance.on
65+
```
66+
273 KB
Loading

documentation/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ nav:
166166
- Minio Image Upgrade (version < 1.21.0): Developers_and_Administrators/Upgrading_Codabench/Minio-image.md
167167
- Docker-Py (version < 1.22.0): Developers_and_Administrators/Upgrading_Codabench/Docker-py.md
168168
- Django 4 Upgrades (version < 1.23.0): Developers_and_Administrators/Upgrading_Codabench/Django-4.md
169+
- Postgres 18 upgrade (version < 1.24.0): Developers_and_Administrators/Upgrading_Codabench/Postgres-18.md
169170
- Newsletters Archive:
170171
- 2024: Newsletters_Archive/CodaLab-in-2024.md
171172
- 2025: Newsletters_Archive/CodaLab-in-2025.md

0 commit comments

Comments
 (0)