Skip to content

Commit 57da3c2

Browse files
Add PG13 to our test images (#38)
* Add PG13 to out test images * Remove unnecessary packages, update readme
1 parent 517a103 commit 57da3c2

8 files changed

Lines changed: 34 additions & 17 deletions

File tree

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,24 @@ And for all images follow the instructions on [how to publish a change](#4-How-t
8787

8888
If you want to add support for a major postgres major, like `pg-13` you will need to do the steps that are not limited to:
8989

90-
* Generate `postgresql-server-dev-{pg-major}` package with `debbuilder` image. Make sure to add the package index for `pg-major` in `/etc/apt/sources.list.d/pgdg.list`. You can see find the related part [here](https://github.com/citusdata/the-process/blob/master/circleci/images/debbuilder/files/install-builddeps).
90+
* Generate `postgresql-server-dev-{pg-major}` package with `debbuilder` image. Make sure to add the package index for `pg-major` in `/etc/apt/sources.list.d/pgdg.list`(See the [pgdg apt repository](https://apt.postgresql.org/pub/repos/apt/dists/)). You can update `pg_latest` variable in [install-builddebs](https://github.com/citusdata/the-process/blob/master/circleci/images/debbuilder/files/install-builddeps).
91+
92+
```bash
93+
cd debbuilder
94+
docker build --tag=citus/debbuilder13 . --build-arg PG_MAJORS=13
95+
```
96+
9197
* The generated package will be in `{container-name}/home/circleci/debs`. One way of getting the package from the docker image is:
9298
* Run the container with `docker run -it {tag-name} bash`
9399
* Find the name of your container with `docker ps`
94100
* Copy the `debs` folder from docker container to your local `docker cp {container-name}:/home/circleci/debs .`
95-
* Upload the package to [the-process](https://packagecloud.io/citus-bot/the-process). Make sure that you choose `debian stretch` while uploading. In order to upload you can:
101+
* Upload the package to [the-process](https://packagecloud.io/citus-bot/the-process). Make sure that you choose `debian stretch` while uploading. Use `citus-bot` account there(credentials are in the 1password vault). In order to upload you can:
96102
* Upload the package file from the UI by clicking to `Upload image`
97103
* Or you can use the [package cloud cli](https://packagecloud.io/l/cli).
98104

99105
* Add `pg-major` to `extbuilder` in its script so that citus artifacts are generated for that `pg_major` too.
100-
* Add new `pg-major` package index to `sources.list`:
106+
* Update `pg_latest`.
107+
* (This step should already be done if you update `pg_latest`). Add new `pg-major` package index to `sources.list`:
101108

102109
```bash
103110
# add pgdg repo to sources
@@ -106,6 +113,11 @@ echo "deb http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg main ${PG-MA
106113
/etc/apt/sources.list.d/postgresql.list
107114
```
108115

116+
```bash
117+
cd extbuilder
118+
docker build --tag=citus/extbuilder-{pg-major} .
119+
```
120+
109121
* Build `exttester` with `pg-major`:
110122

111123
```bash

circleci/images/debbuilder/files/build-pgdebs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ build_deb() {
8282
r /tmp/install-isolation.mk
8383
d
8484
}' src/test/isolation/Makefile
85+
echo 'usr/lib/postgresql/*/lib/pgxs/src/test/isolation/*' >> \
86+
"debian/postgresql-server-dev-${pg_major}.install"
8587
tweak+=("Add PostgreSQL's isolation tester to installed files")
8688

8789
sed -i '/^Package: postgresql-server-dev-/,/^Breaks:$/ {/\(clang\|llvm\)/d}' debian/control

circleci/images/debbuilder/files/install-builddeps

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ IFS=$'\n\t'
77
codename=stretch
88
pg_majors=( "${@}" )
99

10+
pg_latest=13
11+
1012
# explicitly set user/group IDs
1113
groupadd -r circleci --gid=1729
1214
useradd -mg circleci --uid=1729 --shell=/bin/bash circleci
@@ -23,17 +25,21 @@ echo "Writing /etc/apt/sources.list.d/pgdg.list..." >&2
2325
cat > /etc/apt/sources.list.d/pgdg.list <<EOF
2426
deb http://deb.debian.org/debian ${codename}-backports main
2527
deb-src http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg main
26-
deb-src http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg-testing 12
28+
deb-src http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg-testing ${pg_latest}
2729
EOF
2830

2931
echo "Running apt-get update..." >&2
3032
apt-get update
3133

34+
# this line is to bypass password prompts
35+
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
3236
echo "Installing tools for building Debian packages..." >&2
3337
apt-get install -y --no-install-recommends \
38+
apt-utils \
3439
devscripts \
3540
fakeroot \
36-
lintian
41+
lintian
42+
3743

3844
pg_pkgs=( "${pg_majors[@]/#/postgresql-}" )
3945
apt-get build-dep -y "${pg_pkgs[@]}"

circleci/images/extbuilder/files/bin/build-ext

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euxo pipefail
55
IFS=$'\n\t'
66

77
# supported PostgreSQL releases
8-
pg_majors=( 11 12 )
8+
pg_majors=( 11 12 13)
99

1010
# get codename from release file
1111
. /etc/os-release

circleci/images/extbuilder/files/sbin/install-extdeps

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ if [[ $EUID -ne 0 ]]; then
1111
fi
1212

1313
# supported PostgreSQL releases
14-
pg_majors=( 11 12 )
14+
pg_majors=( 11 12 13 )
1515

16-
pg_latest=12
16+
pg_latest=13
1717

1818
# get codename from release file
1919
. /etc/os-release

circleci/images/exttester/files/sbin/install-testdeps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fi
1515
codename=${VERSION#*(}
1616
codename=${codename%)*}
1717

18-
pg_latest=12
18+
pg_latest=13
1919

2020
# explicitly set user/group IDs
2121
groupadd -r circleci --gid=1729

circleci/images/failtester/files/sbin/install-testdeps

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ fi
1515
codename=${VERSION#*(}
1616
codename=${codename%)*}
1717

18+
pg_latest=13
19+
1820
# explicitly set user/group IDs
1921
groupadd -r circleci --gid=1729
2022
useradd -mg circleci --uid=1729 --shell=/bin/bash circleci
@@ -35,7 +37,7 @@ APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add -
3537

3638
# add pgdg repo to sources
3739
echo "Writing /etc/apt/sources.list.d/pgdg.list..." >&2
38-
echo "deb http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg main 12" > \
40+
echo "deb http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg main ${pg_latest}" > \
3941
/etc/apt/sources.list.d/pgdg.list
4042

4143
pkg_cloud_url="https://packagecloud.io/install/repositories/citus-bot/the-process/script.deb.sh"

circleci/images/pgupgradetester/files/sbin/install-testdeps

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ codename=${VERSION#*(}
1616
codename=${codename%)*}
1717

1818
# supported PostgreSQL releases
19-
pg_majors=( 10 11 12 )
19+
pg_majors=( 11 12 13 )
2020

21-
pg_latest=12
21+
pg_latest=13
2222

2323
# explicitly set user/group IDs
2424
groupadd -r circleci --gid=1729
@@ -47,11 +47,6 @@ echo "deb http://apt.postgresql.org/pub/repos/apt/ ${codename}-pgdg main ${pg_la
4747
pkg_cloud_url="https://packagecloud.io/install/repositories/citus-bot/the-process/script.deb.sh"
4848
curl -sf "${pkg_cloud_url}" | unique_id=exttester bash
4949

50-
cat > /etc/apt/preferences.d/citusdata_the-process.pref <<EOF
51-
Package: postgresql-server-dev-*
52-
Pin: release o=packagecloud.io/citus-bot/the-process
53-
Pin-Priority: 700
54-
EOF
5550

5651
echo "Installing tools for testing PostgreSQL extensions..." >&2
5752
sd_pkgs=( "${pg_majors[@]/#/postgresql-server-dev-}" )

0 commit comments

Comments
 (0)