Skip to content

Commit 5defe5c

Browse files
committed
Merge branch 'chore/update-all-component-versions-0.15' into 'main'
chore: bump component versions for 0.15 Closes #157 See merge request postgres-ai/postgresai!218
2 parents 05e083d + 0f6dbe1 commit 5defe5c

10 files changed

Lines changed: 159 additions & 52 deletions

File tree

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ integration:xmin-horizon:
810810
test -n "$NETWORK"
811811
target_ready=0
812812
for i in {1..60}; do
813-
if docker run --rm --network "$NETWORK" postgres:15 pg_isready -h target-db -U postgres; then
813+
if docker run --rm --network "$NETWORK" postgres:17 pg_isready -h target-db -U postgres; then
814814
target_ready=1
815815
break
816816
fi
@@ -819,7 +819,7 @@ integration:xmin-horizon:
819819
test "$target_ready" = "1"
820820
monitor_ready=0
821821
for i in {1..60}; do
822-
if docker run --rm --network "$NETWORK" postgres:15 \
822+
if docker run --rm --network "$NETWORK" postgres:17 \
823823
psql "postgresql://monitor:monitor_pass@target-db:5432/target_database" -c 'select 1'; then
824824
monitor_ready=1
825825
break
@@ -830,7 +830,7 @@ integration:xmin-horizon:
830830
docker compose up -d target-standby
831831
standby_ready=0
832832
for i in {1..60}; do
833-
if docker run --rm --network "$NETWORK" postgres:15 pg_isready -h target-standby -U postgres; then
833+
if docker run --rm --network "$NETWORK" postgres:17 pg_isready -h target-standby -U postgres; then
834834
standby_ready=1
835835
break
836836
fi
@@ -839,7 +839,7 @@ integration:xmin-horizon:
839839
test "$standby_ready" = "1"
840840
standby_recovery_ready=0
841841
for i in {1..60}; do
842-
if docker run --rm --network "$NETWORK" postgres:15 \
842+
if docker run --rm --network "$NETWORK" postgres:17 \
843843
psql "postgresql://postgres:postgres@target-standby:5432/target_database" -tAc 'select pg_is_in_recovery()' | grep -qx t; then
844844
standby_recovery_ready=1
845845
break

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ repos:
1515
# Ensure YAML files are valid
1616
- id: check-yaml
1717
args: ['--allow-multiple-documents']
18+
# Skip Helm chart templates: they contain Go templating ({{- ... }})
19+
# at the top of the file which is not valid YAML until rendered.
20+
exclude: '^postgres_ai_helm/templates/'
1821
# Prevent committing to main directly
1922
- id: no-commit-to-branch
2023
args: ['--branch', 'main']

TMP_MON_PREVIEWS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ echo "[$(date)] Workload generator stopped gracefully"
347347

348348
```yaml
349349
workload-generator:
350-
image: postgres:15
350+
image: postgres:17
351351
depends_on:
352352
target-db:
353353
condition: service_healthy
@@ -1172,7 +1172,7 @@ Using Compose v2 native limits (`mem_limit`, `cpus`), NOT `deploy.resources`.
11721172
# docker-compose.preview.template.yml (excerpt)
11731173
services:
11741174
grafana:
1175-
image: grafana/grafana:12.0.2
1175+
image: grafana/grafana:12.3.2
11761176
mem_limit: 256m
11771177
cpus: 0.25
11781178
healthcheck:
@@ -1185,7 +1185,7 @@ services:
11851185
- "pgai.preview=true"
11861186
11871187
victoria-metrics:
1188-
image: victoriametrics/victoria-metrics:v1.105.0
1188+
image: victoriametrics/victoria-metrics:v1.140.0
11891189
mem_limit: 768m
11901190
cpus: 0.4
11911191
command:
@@ -1199,7 +1199,7 @@ services:
11991199
- "pgai.preview=true"
12001200
12011201
target-db:
1202-
image: postgres:15
1202+
image: postgres:17
12031203
mem_limit: 512m
12041204
cpus: 0.3
12051205
healthcheck:
@@ -1348,7 +1348,7 @@ version: "3.8"
13481348
13491349
services:
13501350
node-exporter:
1351-
image: prom/node-exporter:v1.8.2
1351+
image: prom/node-exporter:v1.11.1
13521352
restart: unless-stopped
13531353
volumes:
13541354
- /proc:/host/proc:ro

config/grafana/provisioning/datasources/datasources.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ datasources:
1212
password: pgwatchadmin
1313
jsonData:
1414
sslmode: disable
15-
postgresVersion: 1500
15+
# Grafana encoding: PG major version * 100 (1700 = PG 17). PG 17 is
16+
# not in Grafana's official dropdown yet; this value overrides it.
17+
postgresVersion: 1700
1618
isDefault: false
1719

1820
- name: PGWatch-Prometheus
@@ -38,4 +40,4 @@ datasources:
3840
isDefault: false
3941
jsonData:
4042
auth_method: none
41-
allowed_hosts: []
43+
allowed_hosts: []

config/scripts/postgres-entrypoint.sh

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,50 @@ copy_init_files() {
3131
shopt -u nullglob
3232
}
3333

34+
# Fail fast with an actionable message if the on-disk PGDATA major version
35+
# does not match the container image. Without this, postgres crash-loops
36+
# with only "database files are incompatible with server" buried in the
37+
# logs, which hides the real upgrade-path instruction from operators
38+
# running `postgres-ai mon update` against an existing PG 15 volume.
39+
check_pgdata_version() {
40+
local data_dir="${PGDATA:-/var/lib/postgresql/data}"
41+
local version_file="${data_dir}/PG_VERSION"
42+
43+
if [[ ! -f "${version_file}" ]]; then
44+
return 0 # empty PGDATA: initdb will run on first start
45+
fi
46+
47+
local on_disk image
48+
on_disk="$(tr -d '[:space:]' < "${version_file}")"
49+
image="$(postgres --version | awk '{print $3}' | cut -d. -f1)"
50+
51+
if [[ -n "${on_disk}" && "${on_disk}" != "${image}" ]]; then
52+
cat >&2 <<EOF
53+
=======================================================================
54+
PostgreSQL version mismatch — refusing to start.
55+
56+
Data directory PG version: ${on_disk}
57+
Container image PG version: ${image}
58+
59+
PostgreSQL on-disk format is not compatible across major versions.
60+
Starting postgres now would crash-loop. The data is NOT lost; it is
61+
simply unreadable by this image version.
62+
63+
To upgrade an existing PG ${on_disk} data directory to PG ${image}:
64+
1. Stop this container.
65+
2. Run pg_upgrade per the PostgresAI runbook (tracked in MR !145),
66+
OR start the previous PG ${on_disk} image, take a logical dump,
67+
then restore into a fresh PG ${image} volume.
68+
69+
For standbys: do NOT pg_upgrade the replica. Instead, pg_upgrade the
70+
primary first, then re-clone the standby via pg_basebackup from the
71+
upgraded primary.
72+
=======================================================================
73+
EOF
74+
exit 3
75+
fi
76+
}
77+
3478
main() {
3579
if [[ $# -lt 1 ]]; then
3680
echo "postgres-entrypoint: missing <config_subdir>" >&2
@@ -40,11 +84,10 @@ main() {
4084
local config_subdir="$1"
4185
shift
4286

87+
check_pgdata_version
4388
copy_init_files "${CONFIGS_ROOT}/${config_subdir}"
4489

4590
exec docker-entrypoint.sh postgres "$@"
4691
}
4792

4893
main "$@"
49-
50-

docker-compose.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ services:
3131

3232
# Target Database - The PostgreSQL database being monitored (demo only)
3333
target-db:
34-
image: postgres:15
34+
image: postgres:17
3535
container_name: target-db
3636
cpus: 0.2
3737
mem_limit: 768m
@@ -69,7 +69,7 @@ services:
6969

7070
# Hot standby used by xmin-horizon integration coverage when explicitly started.
7171
target-standby:
72-
image: postgres:15
72+
image: postgres:17
7373
container_name: target-standby
7474
cpus: 0.2
7575
mem_limit: 768m
@@ -106,7 +106,7 @@ services:
106106
# and postgres-exporter connectivity without compromising security since
107107
# the database is not exposed externally.
108108
sink-postgres:
109-
image: postgres:15
109+
image: postgres:17
110110
container_name: sink-postgres
111111
cpus: 0.4
112112
mem_limit: 1024m
@@ -131,7 +131,7 @@ services:
131131

132132
# VictoriaMetrics Sink - Storage for metrics in Prometheus format
133133
sink-prometheus:
134-
image: victoriametrics/victoria-metrics:v1.105.0
134+
image: victoriametrics/victoria-metrics:v1.140.0
135135
container_name: sink-prometheus
136136
cpus: 0.75
137137
mem_limit: 1536m
@@ -158,7 +158,7 @@ services:
158158

159159
# PGWatch Instance 1 - Monitoring service (Postgres sink)
160160
pgwatch-postgres:
161-
image: cybertecpostgresql/pgwatch:3
161+
image: cybertecpostgresql/pgwatch:4.1.0
162162
container_name: pgwatch-postgres
163163
cpus: 0.35
164164
mem_limit: 512m
@@ -181,7 +181,7 @@ services:
181181

182182
# PGWatch Instance 2 - Monitoring service (Prometheus sink)
183183
pgwatch-prometheus:
184-
image: cybertecpostgresql/pgwatch:3
184+
image: cybertecpostgresql/pgwatch:4.1.0
185185
container_name: pgwatch-prometheus
186186
cpus: 1.5
187187
mem_limit: 1024m
@@ -204,7 +204,7 @@ services:
204204

205205
# Grafana with datasources - Visualization layer
206206
grafana:
207-
image: grafana/grafana:12.0.2
207+
image: grafana/grafana:12.3.2
208208
container_name: grafana-with-datasources
209209
cpus: 0.5
210210
mem_limit: 512m
@@ -297,8 +297,10 @@ services:
297297
# Self-monitoring components (may have reduced functionality on macOS)
298298

299299
# cAdvisor - Container metrics (self-monitoring)
300+
# Note: ghcr.io/google/cadvisor tags omit the 'v' prefix
301+
# (upstream registry convention; different from other images here).
300302
self-cadvisor:
301-
image: gcr.io/cadvisor/cadvisor:v0.51.0
303+
image: ghcr.io/google/cadvisor:0.56.2
302304
container_name: self-cadvisor
303305
cpus: 0.15
304306
mem_limit: 192m
@@ -317,7 +319,7 @@ services:
317319

318320
# Node Exporter - System metrics (self-monitoring)
319321
self-node-exporter:
320-
image: prom/node-exporter:v1.8.2
322+
image: prom/node-exporter:v1.11.1
321323
container_name: self-node-exporter
322324
cpus: 0.05
323325
mem_limit: 96m
@@ -330,7 +332,7 @@ services:
330332

331333
# Postgres Exporter - Metrics for sink-postgres (self-monitoring)
332334
self-postgres-exporter:
333-
image: prometheuscommunity/postgres-exporter:v0.16.0
335+
image: prometheuscommunity/postgres-exporter:v0.19.1
334336
container_name: self-postgres-exporter
335337
cpus: 0.1
336338
mem_limit: 128m

postgres_ai_helm/templates/grafana-datasources.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ data:
3535
jsonData:
3636
database: {{ .Values.sinkPostgres.database }}
3737
sslmode: disable
38-
postgresVersion: 1500
38+
# Grafana encoding: PG major version * 100 (1700 = PG 17). PG 17
39+
# is not in Grafana's official dropdown yet; this value overrides it.
40+
postgresVersion: 1700
3941
secureJsonData:
4042
password: {{ .Values.secrets.postgres.password }}
4143
{{- if .Values.flask.enabled }}
@@ -50,5 +52,3 @@ data:
5052
tlsSkipVerify: true
5153
{{- end }}
5254
{{- end }}
53-
54-

postgres_ai_helm/templates/sink-postgres-statefulset.yaml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,52 @@ spec:
2323
imagePullSecrets:
2424
{{- toYaml . | nindent 8 }}
2525
{{- end }}
26+
initContainers:
27+
# Fail fast with an actionable message if the on-disk PGDATA major
28+
# version does not match the image. Without this, postgres crash-
29+
# loops with only "database files are incompatible with server"
30+
# buried in the logs, and `helm upgrade` against an existing PG 15
31+
# PVC surfaces as a generic pod CrashLoopBackOff.
32+
- name: pg-version-guard
33+
image: {{ .Values.sinkPostgres.image }}
34+
imagePullPolicy: IfNotPresent
35+
env:
36+
- name: PGDATA
37+
value: /var/lib/postgresql/data/pgdata
38+
command: ["bash", "-c"]
39+
args:
40+
- |
41+
set -Eeuo pipefail
42+
version_file="${PGDATA}/PG_VERSION"
43+
if [[ ! -f "${version_file}" ]]; then
44+
exit 0 # empty PGDATA: initdb will run on first start
45+
fi
46+
on_disk="$(tr -d '[:space:]' < "${version_file}")"
47+
image="$(postgres --version | awk '{print $3}' | cut -d. -f1)"
48+
if [[ -n "${on_disk}" && "${on_disk}" != "${image}" ]]; then
49+
cat >&2 <<EOF
50+
=======================================================================
51+
PostgreSQL version mismatch — refusing to start.
52+
53+
PVC PG version: ${on_disk}
54+
Image PG version: ${image}
55+
56+
On-disk format is not compatible across majors. Starting postgres
57+
now would crash-loop. Data is NOT lost; it is simply unreadable
58+
by this image version.
59+
60+
Upgrade path (see PostgresAI MR !145 runbook):
61+
1. Scale this StatefulSet to 0.
62+
2. Run pg_upgrade against the PVC from PG ${on_disk} to PG ${image},
63+
OR dump-and-restore into a fresh PVC.
64+
3. Scale back to 1.
65+
=======================================================================
66+
EOF
67+
exit 3
68+
fi
69+
volumeMounts:
70+
- name: data
71+
mountPath: /var/lib/postgresql/data
2672
containers:
2773
- name: postgres
2874
image: {{ .Values.sinkPostgres.image }}
@@ -70,5 +116,3 @@ spec:
70116
resources:
71117
requests:
72118
storage: {{ .Values.storage.postgresSize }}
73-
74-

0 commit comments

Comments
 (0)