Skip to content

Commit

Permalink
resurrect project and add pg16
Browse files Browse the repository at this point in the history
  • Loading branch information
esgn committed Dec 21, 2023
1 parent 7df3524 commit 47d10c6
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 12 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/docker-image-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ jobs:
strategy:
matrix:
include:
- postgres_version: 16
tags: esgn/pgtuned-testing:16, esgn/pgtuned-testing:latest
- postgres_version: 16
postgis_version: 3
tags: esgn/pgtuned-testing:16-3, esgn/pgtuned-testing:postgis-latest
- postgres_version: 15
tags: esgn/pgtuned-testing:15, esgn/pgtuned-testing:latest
tags: esgn/pgtuned-testing:15
- postgres_version: 15
postgis_version: 3
tags: esgn/pgtuned-testing:15-3, esgn/pgtuned-testing:postgis-latest
tags: esgn/pgtuned-testing:15-3
- postgres_version: 14
tags: esgn/pgtuned-testing:14
- postgres_version: 14
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ jobs:
strategy:
matrix:
include:
- postgres_version: 16
tags: esgn/pgtuned:16, esgn/pgtuned:latest
- postgres_version: 16
postgis_version: 3
tags: esgn/pgtuned:16-3, esgn/pgtuned:postgis-latest
- postgres_version: 15
tags: esgn/pgtuned:15, esgn/pgtuned:latest
tags: esgn/pgtuned:15
- postgres_version: 15
postgis_version: 3
tags: esgn/pgtuned:15-3, esgn/pgtuned:postgis-latest
tags: esgn/pgtuned:15-3
- postgres_version: 14
tags: esgn/pgtuned:14
- postgres_version: 14
Expand Down
3 changes: 3 additions & 0 deletions apt_archive_patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ codename=$(source /etc/os-release && echo -n $VERSION_CODENAME)

if [ "$codename" = "stretch" ]
then
sed -i 's/deb\.debian\.org/archive\.debian\.org/' /etc/apt/sources.list
sed -i 's/security\.debian\.org/archive\.debian\.org/' /etc/apt/sources.list
sed -i '/stretch-updates/d' /etc/apt/sources.list
cd /etc/apt/sources.list.d/
mv pgdg.list pgdg.list.backup
apt-get -qq update
Expand Down
11 changes: 6 additions & 5 deletions pgtune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ It produces a postgresql.conf file based on supplied parameters.
-h display this help and exit
-v PG_VERSION (optional) PostgreSQL version
accepted values: 9.5, 9.6, 10, 11, 12, 13, 14, 15
default value: 15
accepted values: 9.5, 9.6, 10, 11, 12, 13, 14, 15, 16
default value: 16
-t DB_TYPE (optional) For what type of application is PostgreSQL used
accepted values: web, oltp, dw, desktop, mixed
default value: web
Expand Down Expand Up @@ -96,7 +96,7 @@ set_db_default_values() {
max_worker_processes=8
max_parallel_workers_per_gather=0
;;
"10" | "11" | "12" | "13" | "14" | "15")
"10" | "11" | "12" | "13" | "14" | "15" | "16")
max_worker_processes=8
max_parallel_workers_per_gather=2
max_parallel_workers=8
Expand Down Expand Up @@ -416,7 +416,7 @@ cpu_num=$(get_cpu_count) || exit $?
storage_type=$(get_disk_type)
conn_nb=0
db_type="web"
db_version=15
db_version=16

while getopts "hv:t:m:u:c:s:" opt; do
case $opt in
Expand All @@ -433,7 +433,8 @@ while getopts "hv:t:m:u:c:s:" opt; do
[ $v != "12" ] && \
[ $v != "13" ] && \
[ $v != "14" ] && \
[ $v != "15" ]
[ $v != "15" ] && \
[ $v != "16" ]
then
_input_error "$v is not a valid PostgreSQL version number"
fi
Expand Down
3 changes: 2 additions & 1 deletion test/scripts/build_run_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# of PostgreSQL + PostGIS and outputs PostgreSQL
# configuration file for checking

declare -a arr=("15|3"
declare -a arr=("16|3"
"15|3"
"14|3"
"13|3"
"12|3"
Expand Down
8 changes: 7 additions & 1 deletion test/scripts/check_compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and gets the available PostGIS version for each of them.
# Also ouputs the distribution used for each image.

pg_versions="15 14 13 12 11 11-bullseye 10 10-bullseye 9.6 9.6-bullseye 9.5"
pg_versions="16 15 14 13 12 11 11-bullseye 10 10-bullseye 9.6 9.6-bullseye 9.5"

for v in $pg_versions
do
Expand All @@ -18,6 +18,12 @@ do
if [ "$codename" = "stretch" ]
then
echo "applying apt-archive.postgres.org patch"
c="sed -i 's/deb\.debian\.org/archive\.debian\.org/' /etc/apt/sources.list"
docker exec -ti pg$v bash -c "$c"
c="sed -i 's/security\.debian\.org/archive\.debian\.org/' /etc/apt/sources.list"
docker exec -ti pg$v bash -c "$c"
c="sed -i '/stretch-updates/d' /etc/apt/sources.list"
docker exec -ti pg$v bash -c "$c"
c="cd /etc/apt/sources.list.d/ && mv pgdg.list pgdg.list.backup"
docker exec -ti pg$v bash -c "$c"
c="apt-get -qq update && DEBCONF_NOWARNINGS='yes' apt-get install apt-transport-https -y > /dev/null"
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/test_pgtune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

test_files_dir="../expected_results/"
pgtuned_script="../../pgtune.sh"
pg_versions="15 14 13 12 11 10 9.6 9.5"
pg_versions="16 15 14 13 12 11 10 9.6 9.5"
db_types="web oltp dw desktop mixed"
total_mem=8GB
cpu_count=8
Expand Down

0 comments on commit 47d10c6

Please sign in to comment.