Skip to content

Commit f8d324f

Browse files
committed
Upgrade to Citus 13.2
1 parent ffd14a4 commit f8d324f

File tree

7 files changed

+59
-53
lines changed

7 files changed

+59
-53
lines changed

.github/workflows/package-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jobs:
3737
export PROJECT_VERSION="${{ github.event.inputs.project_version }}"
3838
echo "project_version: ${{ github.event.inputs.project_version }}"
3939
# To be able to test pipeline without triggering with project_version parameter using workflow_dispatch parameter,
40-
# if workflow_dispatch parameter is empty, 12.0.0 parameter is set to execute pipeline.
41-
[ -z ${PROJECT_VERSION} ] && export PROJECT_VERSION=12.0.0
40+
# if workflow_dispatch parameter is empty, 13.2.0 parameter is set to execute pipeline.
41+
[ -z ${PROJECT_VERSION} ] && export PROJECT_VERSION=13.2.0
4242
POSTGRES_VERSIONS=$(python -m packaging_automation.get_postgres_versions --project_version ${PROJECT_VERSION})
4343
echo "Postgres Version: ${POSTGRES_VERSIONS}"
4444
echo "::set-output name=pg_versions::${POSTGRES_VERSIONS}"
@@ -74,7 +74,7 @@ jobs:
7474
run: |
7575
export PROJECT_VERSION="${{ github.event.inputs.project_version }}"
7676
echo "Citus Version: ${PROJECT_VERSION} "
77-
[ -z ${PROJECT_VERSION} ] && export PROJECT_VERSION=12.0.0
77+
[ -z ${PROJECT_VERSION} ] && export PROJECT_VERSION=13.2.0
7878
python -m packaging_automation.test_citus_package \
7979
--project_version "${PROJECT_VERSION}" \
8080
--os_release ${{ matrix.platform }} \

packaging_automation/publish_docker.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class DockerImageType(Enum):
2828
latest = 1
2929
alpine = 2
3030
nightly = 3
31-
postgres_14 = 4
32-
postgres_15 = 5
31+
postgres_15 = 4
32+
postgres_16 = 5
3333

3434

3535
class ManualTriggerType(Enum):
@@ -55,16 +55,16 @@ class ScheduleType(Enum):
5555
"docker-tag": "alpine",
5656
"schedule-type": ScheduleType.regular,
5757
},
58-
DockerImageType.postgres_14: {
59-
"file-name": "postgres-14/Dockerfile",
60-
"docker-tag": "pg14",
61-
"schedule-type": ScheduleType.regular,
62-
},
6358
DockerImageType.postgres_15: {
6459
"file-name": "postgres-15/Dockerfile",
6560
"docker-tag": "pg15",
6661
"schedule-type": ScheduleType.regular,
6762
},
63+
DockerImageType.postgres_16: {
64+
"file-name": "postgres-16/Dockerfile",
65+
"docker-tag": "pg16",
66+
"schedule-type": ScheduleType.regular,
67+
},
6868
DockerImageType.nightly: {
6969
"file-name": "nightly/Dockerfile",
7070
"docker-tag": "nightly",

packaging_automation/tests/files/get_postgres_versions_tests/postgres-matrix.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@ version_matrix:
2020
postgres_versions: [ 13, 14, 15 ]
2121
- 12.0:
2222
postgres_versions: [ 14, 15 ]
23+
- 12.1:
24+
postgres_versions: [ 14, 15, 16 ]
25+
- 13.0:
26+
postgres_versions: [ 15, 16 ]
27+
- 13.1:
28+
postgres_versions: [ 15, 16 ]
29+
- 13.2:
30+
postgres_versions: [ 15, 16 ]

packaging_automation/tests/test_publish_docker.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
publish_nightly_docker_image,
1717
)
1818

19-
NON_DEFAULT_BRANCH_NAME = "12.0.0_test"
19+
NON_DEFAULT_BRANCH_NAME = "13.2.0_test"
2020
DEFAULT_BRANCH_NAME = "master"
21-
TAG_NAME = "v12.0.0"
21+
TAG_NAME = "v13.2.0"
2222
INVALID_TAG_NAME = "v12.x"
2323
DOCKER_IMAGE_NAME = "citusdata/citus"
2424
docker_client = docker.from_env()
@@ -60,12 +60,12 @@ def test_decode_tag_parts():
6060

6161
def test_get_image_tag():
6262
image_name = get_image_tag(remove_prefix(TAG_NAME, "v"), DockerImageType.latest)
63-
assert image_name == "12.0.0"
63+
assert image_name == "13.2.0"
6464

6565
image_name = get_image_tag(
66-
remove_prefix(TAG_NAME, "v"), DockerImageType.postgres_15
66+
remove_prefix(TAG_NAME, "v"), DockerImageType.postgres_16
6767
)
68-
assert image_name == "12.0.0-pg15"
68+
assert image_name == "13.2.0-pg16"
6969

7070

7171
def test_publish_main_docker_images():
@@ -86,10 +86,10 @@ def test_publish_tagged_docker_images_latest():
8686
os.chdir("docker")
8787
try:
8888
run_with_output("git checkout -b docker-unit-test")
89-
publish_tagged_docker_images(DockerImageType.latest, "v12.0.0", False)
90-
docker_client.images.get("citusdata/citus:12")
91-
docker_client.images.get("citusdata/citus:12.0")
92-
docker_client.images.get("citusdata/citus:12.0.0")
89+
publish_tagged_docker_images(DockerImageType.latest, "v13.2.0", False)
90+
docker_client.images.get("citusdata/citus:13")
91+
docker_client.images.get("citusdata/citus:13.2")
92+
docker_client.images.get("citusdata/citus:13.2.0")
9393
finally:
9494
run_with_output("git checkout master")
9595
run_with_output("git branch -D docker-unit-test")
@@ -101,9 +101,9 @@ def test_publish_tagged_docker_images_alpine():
101101
try:
102102
run_with_output("git checkout -b docker-unit-test")
103103
publish_tagged_docker_images(DockerImageType.alpine, TAG_NAME, False)
104-
docker_client.images.get("citusdata/citus:12-alpine")
105-
docker_client.images.get("citusdata/citus:12.0-alpine")
106-
docker_client.images.get("citusdata/citus:12.0.0-alpine")
104+
docker_client.images.get("citusdata/citus:13-alpine")
105+
docker_client.images.get("citusdata/citus:13.2-alpine")
106+
docker_client.images.get("citusdata/citus:13.2.0-alpine")
107107
finally:
108108
run_with_output("git checkout master")
109109
run_with_output("git branch -D docker-unit-test")

packaging_automation/tests/test_update_docker.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
BASE_PATH = os.getenv("BASE_PATH", default=pathlib2.Path(__file__).parents[2])
2323
TEST_BASE_PATH = f"{BASE_PATH}/docker"
24-
PROJECT_VERSION = "12.0.0"
24+
PROJECT_VERSION = "13.2.0"
2525

26-
POSTGRES_15_VERSION = "15.4"
27-
POSTGRES_14_VERSION = "14.9"
26+
POSTGRES_16_VERSION = "16.10"
27+
POSTGRES_15_VERSION = "15.14"
2828

2929
PROJECT_NAME = "citus"
3030
version_details = get_version_details(PROJECT_VERSION)
@@ -45,7 +45,7 @@ def teardown_module():
4545

4646
def test_update_docker_file_for_latest_postgres():
4747
update_docker_file_for_latest_postgres(
48-
PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_14_VERSION
48+
PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_15_VERSION
4949
)
5050
with open(
5151
f"{TEST_BASE_PATH}/Dockerfile",
@@ -55,7 +55,7 @@ def test_update_docker_file_for_latest_postgres():
5555
) as reader:
5656
content = reader.read()
5757
lines = content.splitlines()
58-
assert lines[2].strip() == f"FROM postgres:{POSTGRES_14_VERSION}"
58+
assert lines[2].strip() == f"FROM postgres:{POSTGRES_15_VERSION}"
5959
assert lines[3].strip() == f"ARG VERSION={PROJECT_VERSION}"
6060
assert (
6161
f"postgresql-$PG_MAJOR-{PROJECT_NAME}-"
@@ -83,7 +83,7 @@ def test_update_regular_docker_compose_file():
8383

8484
def test_update_docker_file_alpine():
8585
update_docker_file_alpine(
86-
PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_14_VERSION
86+
PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_15_VERSION
8787
)
8888
with open(
8989
f"{TEST_BASE_PATH}/alpine/Dockerfile",
@@ -93,24 +93,24 @@ def test_update_docker_file_alpine():
9393
) as reader:
9494
content = reader.read()
9595
lines = content.splitlines()
96-
assert lines[2].strip() == f"FROM postgres:{POSTGRES_14_VERSION}-alpine"
96+
assert lines[2].strip() == f"FROM postgres:{POSTGRES_15_VERSION}-alpine"
9797
assert lines[3].strip() == f"ARG VERSION={PROJECT_VERSION}"
9898
assert len(lines) == 58
9999

100100

101-
def test_update_docker_file_for_postgres14():
102-
update_docker_file_for_postgres14(
103-
PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_14_VERSION
101+
def test_update_docker_file_for_postgres15():
102+
update_docker_file_for_postgres15(
103+
PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_15_VERSION
104104
)
105105
with open(
106-
f"{TEST_BASE_PATH}/postgres-14/Dockerfile",
106+
f"{TEST_BASE_PATH}/postgres-15/Dockerfile",
107107
"r",
108108
encoding=DEFAULT_ENCODING_FOR_FILE_HANDLING,
109109
errors=DEFAULT_UNICODE_ERROR_HANDLER,
110110
) as reader:
111111
content = reader.read()
112112
lines = content.splitlines()
113-
assert lines[2].strip() == f"FROM postgres:{POSTGRES_14_VERSION}"
113+
assert lines[2].strip() == f"FROM postgres:{POSTGRES_15_VERSION}"
114114
assert lines[3].strip() == f"ARG VERSION={PROJECT_VERSION}"
115115
assert (
116116
f"postgresql-$PG_MAJOR-{PROJECT_NAME}-"
@@ -120,19 +120,19 @@ def test_update_docker_file_for_postgres14():
120120
assert len(lines) == 42
121121

122122

123-
def test_update_docker_file_for_postgres15():
124-
update_docker_file_for_postgres15(
125-
PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_15_VERSION
123+
def test_update_docker_file_for_postgres16():
124+
update_docker_file_for_postgres16(
125+
PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_16_VERSION
126126
)
127127
with open(
128-
f"{TEST_BASE_PATH}/postgres-15/Dockerfile",
128+
f"{TEST_BASE_PATH}/postgres-16/Dockerfile",
129129
"r",
130130
encoding=DEFAULT_ENCODING_FOR_FILE_HANDLING,
131131
errors=DEFAULT_UNICODE_ERROR_HANDLER,
132132
) as reader:
133133
content = reader.read()
134134
lines = content.splitlines()
135-
assert lines[2].strip() == f"FROM postgres:{POSTGRES_15_VERSION}"
135+
assert lines[2].strip() == f"FROM postgres:{POSTGRES_16_VERSION}"
136136
assert lines[3].strip() == f"ARG VERSION={PROJECT_VERSION}"
137137
assert (
138138
f"postgresql-$PG_MAJOR-{PROJECT_NAME}-"
@@ -177,5 +177,5 @@ def test_update_changelog_without_postgres():
177177

178178
def test_pkgvar_postgres_version_existence():
179179
config = dotenv_values(PKGVARS_FILE)
180+
assert config["postgres_16_version"]
180181
assert config["postgres_15_version"]
181-
assert config["postgres_14_version"]

packaging_automation/update_docker.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@ class SupportedDockerImages(Enum):
2929
latest = 1
3030
docker_compose = 2
3131
alpine = 3
32-
postgres14 = 4
33-
postgres15 = 5
32+
postgres15 = 4
33+
postgres16 = 5
3434

3535

3636
docker_templates = {
3737
SupportedDockerImages.latest: "latest/latest.tmpl.dockerfile",
3838
SupportedDockerImages.docker_compose: "latest/docker-compose.tmpl.yml",
3939
SupportedDockerImages.alpine: "alpine/alpine.tmpl.dockerfile",
40-
SupportedDockerImages.postgres14: "postgres-14/postgres-14.tmpl.dockerfile",
4140
SupportedDockerImages.postgres15: "postgres-15/postgres-15.tmpl.dockerfile",
41+
SupportedDockerImages.postgres16: "postgres-16/postgres-16.tmpl.dockerfile",
4242
}
4343

4444
docker_outputs = {
4545
SupportedDockerImages.latest: "Dockerfile",
4646
SupportedDockerImages.docker_compose: "docker-compose.yml",
4747
SupportedDockerImages.alpine: "alpine/Dockerfile",
48-
SupportedDockerImages.postgres14: "postgres-14/Dockerfile",
4948
SupportedDockerImages.postgres15: "postgres-15/Dockerfile",
49+
SupportedDockerImages.postgres16: "postgres-16/Dockerfile",
5050
}
5151

5252
BASE_PATH = pathlib2.Path(__file__).parent.absolute()
@@ -116,19 +116,19 @@ def update_docker_file_for_postgres15(
116116
write_to_file(content, dest_file_name)
117117

118118

119-
def update_docker_file_for_postgres14(
119+
def update_docker_file_for_postgres15(
120120
project_version: str, template_path: str, exec_path: str, postgres_version: str
121121
):
122122
minor_version = get_minor_project_version_for_docker(project_version)
123123
debian_project_version = project_version.replace("_", "-")
124124
content = process_template_file_with_minor(
125125
debian_project_version,
126126
template_path,
127-
docker_templates[SupportedDockerImages.postgres14],
127+
docker_templates[SupportedDockerImages.postgres15],
128128
minor_version,
129129
postgres_version,
130130
)
131-
dest_file_name = f"{exec_path}/{docker_outputs[SupportedDockerImages.postgres14]}"
131+
dest_file_name = f"{exec_path}/{docker_outputs[SupportedDockerImages.postgres15]}"
132132
create_directory_if_not_exists(dest_file_name)
133133
write_to_file(content, dest_file_name)
134134

@@ -176,7 +176,6 @@ def update_all_docker_files(project_version: str, exec_path: str):
176176
(
177177
postgres_16_version,
178178
postgres_15_version,
179-
postgres_14_version,
180179
) = read_postgres_versions(pkgvars_file)
181180

182181
latest_postgres_version = postgres_16_version
@@ -188,12 +187,12 @@ def update_all_docker_files(project_version: str, exec_path: str):
188187
update_docker_file_alpine(
189188
project_version, template_path, exec_path, latest_postgres_version
190189
)
191-
update_docker_file_for_postgres14(
192-
project_version, template_path, exec_path, postgres_14_version
193-
)
194190
update_docker_file_for_postgres15(
195191
project_version, template_path, exec_path, postgres_15_version
196192
)
193+
update_docker_file_for_postgres16(
194+
project_version, template_path, exec_path, postgres_16_version
195+
)
197196
update_changelog(project_version, exec_path)
198197

199198

@@ -202,7 +201,6 @@ def read_postgres_versions(pkgvars_file: str) -> Tuple[str, str, str]:
202201
return (
203202
config["postgres_16_version"],
204203
config["postgres_15_version"],
205-
config["postgres_14_version"],
206204
)
207205

208206

toolsvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
LATEST_STABLE_PG_VERSION="14"
1+
LATEST_STABLE_PG_VERSION="16"

0 commit comments

Comments
 (0)