Skip to content
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

deps: update postgres docker tag to v16 #72

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,58 @@ to `latest`:
ORT_SERVER_IMAGE_PREFIX= ORT_SERVER_IMAGE_TAG=latest docker compose up
```

#### Handling major version upgrades of PostgreSQL

PostgreSQL does not support reading the data directory of a previous major version.
When upgrading the PostgreSQL version in the Docker Compose setup, the database data directory must be manually
migrated by following these steps:
Comment on lines +148 to +149
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a single line according to conventions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was not yet migrated to use one sentence per line so I wanted to keep it consistent.


1. Stop the Docker Compose setup:

```shell
docker compose stop
```

2. Start only the PostgreSQL service:

```shell
docker compose up -d postgres
```

3. Make backups of the ORT Server and Keycloak databases:

```shell
docker compose exec postgres pg_dump -Fc -U postgres -d ort_server -n public > keycloak.dump
docker compose exec postgres pg_dump -Fc -U postgres -d ort_server -n ort_server > ort-server.dump
```

4. Stop Docker Compose and delete the volumes:

```shell
docker compose down -v
```

5. Update the PostgreSQL version in `docker-compose.yml`.

6. Start the PostgreSQL service again:

```shell
docker compose up -d postgres
```

7. Import the database backups:

```shell
cat keycloak.dump | docker compose exec -T postgres pg_restore -U postgres -d ort_server -n public
cat ort-server.dump | docker compose exec -T postgres pg_restore -U postgres -d ort_server -n ort_server
```

8. Start all services:

```shell
docker compose up -d
```

### Accessing the services

| Service | URL | Credentials |
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

services:
postgres:
image: postgres:14
image: postgres:16
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres']
Expand Down
Loading