Skip to content

Commit 871bc4a

Browse files
ObadaSObada Haddad
andauthored
Postgres Upgrades and changes (#2091)
* update postgres to latest; add postgres configuration file; update documentation * tentative fix for postgres on circle-ci * add upgrade information in docker-compose.yml for Postgres --------- Co-authored-by: Obada Haddad <obada.haddad@lisn.fr>
1 parent 0157c88 commit 871bc4a

6 files changed

Lines changed: 915 additions & 21 deletions

File tree

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ jobs:
2424

2525
- run:
2626
name: "Setup: Copy environment variables"
27-
command: cp .env_circleci .env
27+
command: |
28+
cp .env_circleci .env
29+
cp my-postgres_sample.conf my-postgres.conf
2830
2931
- run:
3032
name: "Setup: Create directories for MinIO (cannot be made by docker for some reason)"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ caddy_config/
4141
caddy_data/
4242

4343
home_page_counters.json
44+
my-postgres.conf
45+
tests/config/state.json

docker-compose.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
2-
#-----------------------------------------------
2+
#----------------------------------------------------------------------------------------------------
33
# Web Services
4-
#-----------------------------------------------
4+
#----------------------------------------------------------------------------------------------------
55
caddy:
66
image: caddy:2.10.0
77
env_file: .env
@@ -50,9 +50,9 @@ services:
5050
max-file: "5"
5151

5252

53-
#-----------------------------------------------
53+
#----------------------------------------------------------------------------------------------------
5454
# Minio local storage helper
55-
#-----------------------------------------------
55+
#----------------------------------------------------------------------------------------------------
5656
minio:
5757
image: minio/minio:RELEASE.2025-04-22T22-12-26Z
5858
command: server /export
@@ -91,9 +91,9 @@ services:
9191
exit 0;
9292
"
9393
94-
#-----------------------------------------------
94+
#----------------------------------------------------------------------------------------------------
9595
# Local development helper, rebuilds RiotJS/Stylus on change
96-
#-----------------------------------------------
96+
#----------------------------------------------------------------------------------------------------
9797
builder:
9898
build:
9999
context: .
@@ -107,30 +107,34 @@ services:
107107
max-file: "5"
108108

109109

110-
#-----------------------------------------------
110+
#----------------------------------------------------------------------------------------------------
111111
# Database Service
112-
#-----------------------------------------------
112+
#
113+
# Since Postgres 18, PGDATA is supposed to point towards /var/lib/postgresql/*MAJORVERSION*/docker
114+
# Make sure to change the path when upgrading
115+
#----------------------------------------------------------------------------------------------------
113116
db:
114-
image: postgres:12-alpine
117+
image: postgres:18-alpine
115118
env_file: .env
116119
environment:
117-
- PGDATA=/var/lib/postgresql/data/pgdata
120+
- PGDATA=/var/lib/postgresql/18/docker
118121
- POSTGRES_PASSWORD=${DB_PASSWORD}
119-
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
122+
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr", "-c", "config_file=/etc/postgresql/postgresql.conf"]
120123
ports:
121124
- 5432:5432
122125
volumes:
123-
- ./var/postgres:/var/lib/postgresql/data:delegated
126+
- ./var/postgres:/var/lib/postgresql/18/:delegated
124127
- ./backups:/app/backups
128+
- ./my-postgres.conf:/etc/postgresql/postgresql.conf
125129
restart: unless-stopped
126130
logging:
127131
options:
128132
max-size: "20m"
129133
max-file: "5"
130134

131-
#-----------------------------------------------
135+
#----------------------------------------------------------------------------------------------------
132136
# Rabbitmq & Flower monitoring tool
133-
#-----------------------------------------------
137+
#----------------------------------------------------------------------------------------------------
134138
rabbit:
135139
build:
136140
context: .
@@ -171,9 +175,9 @@ services:
171175
max-size: "20m"
172176
max-file: "5"
173177

174-
#-----------------------------------------------
178+
#----------------------------------------------------------------------------------------------------
175179
# Redis
176-
#-----------------------------------------------
180+
#----------------------------------------------------------------------------------------------------
177181
redis:
178182
image: redis
179183
ports:
@@ -184,9 +188,9 @@ services:
184188
max-size: "20m"
185189
max-file: "5"
186190

187-
#-----------------------------------------------
191+
#----------------------------------------------------------------------------------------------------
188192
# Celery Service
189-
#-----------------------------------------------
193+
#----------------------------------------------------------------------------------------------------
190194
site_worker:
191195
# This auto-reloads
192196
command: ["watchmedo auto-restart -p '*.py' --recursive -- celery -A celery_config worker -B -Q site-worker -l info -n site-worker@%n --concurrency=2"]

documentation/docs/Developers_and_Administrators/Codabench-Installation.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ On a fresh installation, you will need to use the following command to get your
2121
```bash
2222
cd codabench
2323
cp .env_sample .env
24+
cp my-postgres_sample.conf my-postgres.conf
2425
```
2526

26-
Then edit the necessary settings inside. The most important are the database, storage, and Caddy/SSL settings. For a quick **local** setup, you should not need to edit this file. For a [public server deployment](How-to-deploy-Codabench-on-your-server.md), you will have to modify some settings.
27+
Then edit the necessary settings inside. The most important are the database, storage, and Caddy/SSL settings in the `.env`. For a quick **local** setup, you should not need to edit these files. For a [public server deployment](How-to-deploy-Codabench-on-your-server.md), you will have to modify some settings.
2728

2829
!!! warning "It is important to change the default passwords if you intend for the instance to be public"
2930

documentation/docs/Developers_and_Administrators/How-to-deploy-Codabench-on-your-server.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ Then you need to modify the `.env` file with the relevant settings. This step is
2121
- Go to the folder where codabench is located (`cd codabench`)
2222
```bash
2323
cp .env_sample .env
24+
cp my-postgres_sample.conf my-postgres.conf
2425
```
2526

2627

27-
Then edit the variables inside the `.env` file.
28+
Then edit the variables inside the `.env` and the `my-postgres.conf` files. You can keep the default values of `my-postgres.conf` if you don't want to change anything
2829

2930
### Submissions endpoint
3031
For an online deployment, you'll need to fill in the IP address or domain name in some environment variables.

0 commit comments

Comments
 (0)