diff --git a/packaging_automation/publish_docker.py b/packaging_automation/publish_docker.py index cdc211bc..9711844f 100644 --- a/packaging_automation/publish_docker.py +++ b/packaging_automation/publish_docker.py @@ -28,8 +28,8 @@ class DockerImageType(Enum): latest = 1 alpine = 2 nightly = 3 - postgres_12 = 4 - postgres_13 = 5 + postgres_13 = 4 + postgres_14 = 5 class ManualTriggerType(Enum): @@ -48,10 +48,10 @@ class ScheduleType(Enum): DockerImageType.latest: {"file-name": "Dockerfile", "docker-tag": "latest", "schedule-type": ScheduleType.regular}, DockerImageType.alpine: {"file-name": "alpine/Dockerfile", "docker-tag": "alpine", "schedule-type": ScheduleType.regular}, - DockerImageType.postgres_12: {"file-name": "postgres-12/Dockerfile", "docker-tag": "pg12", - "schedule-type": ScheduleType.regular}, DockerImageType.postgres_13: {"file-name": "postgres-13/Dockerfile", "docker-tag": "pg13", "schedule-type": ScheduleType.regular}, + DockerImageType.postgres_14: {"file-name": "postgres-14/Dockerfile", "docker-tag": "pg14", + "schedule-type": ScheduleType.regular}, DockerImageType.nightly: {"file-name": "nightly/Dockerfile", "docker-tag": "nightly", "schedule-type": ScheduleType.nightly}} DOCKER_IMAGE_NAME = "citusdata/citus" diff --git a/packaging_automation/templates/docker/alpine/alpine.tmpl.dockerfile b/packaging_automation/templates/docker/alpine/alpine.tmpl.dockerfile index dc305db3..f1d89cf8 100644 --- a/packaging_automation/templates/docker/alpine/alpine.tmpl.dockerfile +++ b/packaging_automation/templates/docker/alpine/alpine.tmpl.dockerfile @@ -24,6 +24,8 @@ RUN apk add --no-cache \ llvm \ lz4-dev \ zstd-dev \ + libxslt-dev \ + libxml2-dev \ icu-dev && \ apk add --no-cache libcurl && \ curl -sfLO "https://github.com/citusdata/citus/archive/v${VERSION}.tar.gz" && \ diff --git a/packaging_automation/templates/docker/docker-pkgvars.tmpl b/packaging_automation/templates/docker/docker-pkgvars.tmpl deleted file mode 100644 index f88b7747..00000000 --- a/packaging_automation/templates/docker/docker-pkgvars.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -# This file is auto generated from it's template, -# see citusdata/tools/packaging_automation/templates/docker/docker-pkgvars.tmpl. -latest_postgres_version={{postgres_version}} \ No newline at end of file diff --git a/packaging_automation/templates/docker/latest/latest.tmpl.dockerfile b/packaging_automation/templates/docker/latest/latest.tmpl.dockerfile index 7ff41965..0e70b981 100644 --- a/packaging_automation/templates/docker/latest/latest.tmpl.dockerfile +++ b/packaging_automation/templates/docker/latest/latest.tmpl.dockerfile @@ -20,8 +20,8 @@ RUN apt-get update \ curl \ && curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install -y postgresql-$PG_MAJOR-citus-{{project_minor_version}}=$CITUS_VERSION \ - postgresql-$PG_MAJOR-hll=2.16.citus-1 \ - postgresql-$PG_MAJOR-topn=2.4.0 \ + postgresql-$PG_MAJOR-hll=2.17.citus-1 \ + postgresql-$PG_MAJOR-topn=2.5.0.citus-1 \ && apt-get purge -y --auto-remove curl \ && rm -rf /var/lib/apt/lists/* diff --git a/packaging_automation/templates/docker/postgres-13/postgres-13.tmpl.dockerfile b/packaging_automation/templates/docker/postgres-13/postgres-13.tmpl.dockerfile index 02111fcb..d5b985fb 100644 --- a/packaging_automation/templates/docker/postgres-13/postgres-13.tmpl.dockerfile +++ b/packaging_automation/templates/docker/postgres-13/postgres-13.tmpl.dockerfile @@ -20,8 +20,8 @@ RUN apt-get update \ curl \ && curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install -y postgresql-$PG_MAJOR-citus-{{project_minor_version}}=$CITUS_VERSION \ - postgresql-$PG_MAJOR-hll=2.16.citus-1 \ - postgresql-$PG_MAJOR-topn=2.4.0 \ + postgresql-$PG_MAJOR-hll=2.17.citus-1 \ + postgresql-$PG_MAJOR-topn=2.5.0.citus-1 \ && apt-get purge -y --auto-remove curl \ && rm -rf /var/lib/apt/lists/* diff --git a/packaging_automation/templates/docker/postgres-12/postgres-12.tmpl.dockerfile b/packaging_automation/templates/docker/postgres-14/postgres-14.tmpl.dockerfile similarity index 91% rename from packaging_automation/templates/docker/postgres-12/postgres-12.tmpl.dockerfile rename to packaging_automation/templates/docker/postgres-14/postgres-14.tmpl.dockerfile index 027620f1..bb7cb609 100644 --- a/packaging_automation/templates/docker/postgres-12/postgres-12.tmpl.dockerfile +++ b/packaging_automation/templates/docker/postgres-14/postgres-14.tmpl.dockerfile @@ -1,5 +1,5 @@ # This file is auto generated from it's template, -# see citusdata/tools/packaging_automation/templates/docker/postgres-12/postgres-12.tmpl.dockerfile. +# see citusdata/tools/packaging_automation/templates/docker/postgres-14/postgres-14.tmpl.dockerfile. FROM postgres:{{postgres_version}} ARG VERSION={{project_version}} LABEL maintainer="Citus Data https://citusdata.com" \ @@ -20,8 +20,8 @@ RUN apt-get update \ curl \ && curl -s https://install.citusdata.com/community/deb.sh | bash \ && apt-get install -y postgresql-$PG_MAJOR-citus-{{project_minor_version}}=$CITUS_VERSION \ - postgresql-$PG_MAJOR-hll=2.16.citus-1 \ - postgresql-$PG_MAJOR-topn=2.4.0 \ + postgresql-$PG_MAJOR-hll=2.17.citus-1 \ + postgresql-$PG_MAJOR-topn=2.5.0.citus-1 \ && apt-get purge -y --auto-remove curl \ && rm -rf /var/lib/apt/lists/* diff --git a/packaging_automation/tests/files/verify/expected_alpine_10.0.3.txt b/packaging_automation/tests/files/verify/expected_alpine_10.0.3.txt index 5c9829ce..a518032c 100644 --- a/packaging_automation/tests/files/verify/expected_alpine_10.0.3.txt +++ b/packaging_automation/tests/files/verify/expected_alpine_10.0.3.txt @@ -24,6 +24,8 @@ RUN apk add --no-cache \ llvm \ lz4-dev \ zstd-dev \ + libxslt-dev \ + libxml2-dev \ icu-dev && \ apk add --no-cache libcurl && \ curl -sfLO "https://github.com/citusdata/citus/archive/v${VERSION}.tar.gz" && \ diff --git a/packaging_automation/tests/test_citus_package.py b/packaging_automation/tests/test_citus_package.py index 5ca82fde..4baf174a 100644 --- a/packaging_automation/tests/test_citus_package.py +++ b/packaging_automation/tests/test_citus_package.py @@ -48,7 +48,7 @@ def get_required_package_count(input_files_dir: str, platform: str): release_versions, _ = get_postgres_versions(platform=platform, input_files_dir=input_files_dir) - print(f"get_required_package_count: Relase versions:{release_versions}:{single_postgres_package_counts[platform]}") + print(f"get_required_package_count: Release versions:{release_versions}:{single_postgres_package_counts[platform]}") return len(release_versions) * single_postgres_package_counts[platform] diff --git a/packaging_automation/tests/test_publish_docker.py b/packaging_automation/tests/test_publish_docker.py index 820b8bcf..757f36f1 100644 --- a/packaging_automation/tests/test_publish_docker.py +++ b/packaging_automation/tests/test_publish_docker.py @@ -45,8 +45,8 @@ def test_get_image_tag(): image_name = get_image_tag(remove_prefix(TAG_NAME, "v"), DockerImageType.latest) assert image_name == "10.0.3" - image_name = get_image_tag(remove_prefix(TAG_NAME, "v"), DockerImageType.postgres_12) - assert image_name == "10.0.3-pg12" + image_name = get_image_tag(remove_prefix(TAG_NAME, "v"), DockerImageType.postgres_13) + assert image_name == "10.0.3-pg13" def test_publish_main_docker_images(): diff --git a/packaging_automation/tests/test_update_docker.py b/packaging_automation/tests/test_update_docker.py index 319f2f25..3c0db52c 100644 --- a/packaging_automation/tests/test_update_docker.py +++ b/packaging_automation/tests/test_update_docker.py @@ -7,15 +7,16 @@ DEFAULT_UNICODE_ERROR_HANDLER) from dotenv import dotenv_values from ..update_docker import (update_docker_file_for_latest_postgres, update_regular_docker_compose_file, - update_docker_file_alpine, update_docker_file_for_postgres12, + update_docker_file_alpine, update_docker_file_for_postgres14, update_docker_file_for_postgres13, update_changelog) BASE_PATH = os.getenv("BASE_PATH", default=pathlib2.Path(__file__).parents[2]) TEST_BASE_PATH = f"{BASE_PATH}/docker" PROJECT_VERSION = "10.0.3" -POSTGRES_14_VERSION = "14.1" -POSTGRES_13_VERSION = "13.5" -POSTGRES_12_VERSION = "12.9" + +POSTGRES_14_VERSION = "14.5" +POSTGRES_13_VERSION = "13.8" + PROJECT_NAME = "citus" version_details = get_version_details(PROJECT_VERSION) TEMPLATE_PATH = f"{BASE_PATH}/packaging_automation/templates/docker" @@ -66,16 +67,16 @@ def test_update_docker_file_alpine(): lines = content.splitlines() assert lines[2].strip() == f"FROM postgres:{POSTGRES_14_VERSION}-alpine" assert lines[3].strip() == f"ARG VERSION={PROJECT_VERSION}" - assert len(lines) == 56 + assert len(lines) == 58 -def test_update_docker_file_for_postgres12(): - update_docker_file_for_postgres12(PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_12_VERSION) - with open(f"{TEST_BASE_PATH}/postgres-12/Dockerfile", "r", encoding=DEFAULT_ENCODING_FOR_FILE_HANDLING, +def test_update_docker_file_for_postgres14(): + update_docker_file_for_postgres14(PROJECT_VERSION, TEMPLATE_PATH, TEST_BASE_PATH, POSTGRES_14_VERSION) + with open(f"{TEST_BASE_PATH}/postgres-14/Dockerfile", "r", encoding=DEFAULT_ENCODING_FOR_FILE_HANDLING, errors=DEFAULT_UNICODE_ERROR_HANDLER) as reader: content = reader.read() lines = content.splitlines() - assert lines[2].strip() == f"FROM postgres:{POSTGRES_12_VERSION}" + assert lines[2].strip() == f"FROM postgres:{POSTGRES_14_VERSION}" assert lines[3].strip() == f"ARG VERSION={PROJECT_VERSION}" assert f"postgresql-$PG_MAJOR-{PROJECT_NAME}-" \ f"{version_details['major']}.{version_details['minor']}=$CITUS_VERSION" in lines[21] diff --git a/packaging_automation/update_docker.py b/packaging_automation/update_docker.py index ef7e2c3d..385f36c5 100644 --- a/packaging_automation/update_docker.py +++ b/packaging_automation/update_docker.py @@ -21,21 +21,21 @@ class SupportedDockerImages(Enum): latest = 1 docker_compose = 2 alpine = 3 - postgres12 = 4 - postgres13 = 5 + postgres13 = 4 + postgres14 = 5 docker_templates = {SupportedDockerImages.latest: "latest/latest.tmpl.dockerfile", SupportedDockerImages.docker_compose: "latest/docker-compose.tmpl.yml", SupportedDockerImages.alpine: "alpine/alpine.tmpl.dockerfile", - SupportedDockerImages.postgres12: "postgres-12/postgres-12.tmpl.dockerfile", - SupportedDockerImages.postgres13: "postgres-13/postgres-13.tmpl.dockerfile"} + SupportedDockerImages.postgres13: "postgres-13/postgres-13.tmpl.dockerfile", + SupportedDockerImages.postgres14: "postgres-14/postgres-14.tmpl.dockerfile"} docker_outputs = {SupportedDockerImages.latest: "Dockerfile", SupportedDockerImages.docker_compose: "docker-compose.yml", SupportedDockerImages.alpine: "alpine/Dockerfile", - SupportedDockerImages.postgres12: "postgres-12/Dockerfile", - SupportedDockerImages.postgres13: "postgres-13/Dockerfile"} + SupportedDockerImages.postgres13: "postgres-13/Dockerfile", + SupportedDockerImages.postgres14: "postgres-14/Dockerfile"} BASE_PATH = pathlib2.Path(__file__).parent.absolute() @@ -68,24 +68,24 @@ def update_docker_file_alpine(project_version: str, template_path: str, exec_pat write_to_file(content, dest_file_name) -def update_docker_file_for_postgres12(project_version: str, template_path: str, exec_path: str, postgres_version: str): +def update_docker_file_for_postgres13(project_version: str, template_path: str, exec_path: str, postgres_version: str): minor_version = get_minor_project_version_for_docker(project_version) debian_project_version = project_version.replace("_", "-") content = process_template_file_with_minor(debian_project_version, template_path, - docker_templates[SupportedDockerImages.postgres12], minor_version, + docker_templates[SupportedDockerImages.postgres13], minor_version, postgres_version) - dest_file_name = f"{exec_path}/{docker_outputs[SupportedDockerImages.postgres12]}" + dest_file_name = f"{exec_path}/{docker_outputs[SupportedDockerImages.postgres13]}" create_directory_if_not_exists(dest_file_name) write_to_file(content, dest_file_name) -def update_docker_file_for_postgres13(project_version: str, template_path: str, exec_path: str, postgres_version: str): +def update_docker_file_for_postgres14(project_version: str, template_path: str, exec_path: str, postgres_version: str): minor_version = get_minor_project_version_for_docker(project_version) debian_project_version = project_version.replace("_", "-") content = process_template_file_with_minor(debian_project_version, template_path, - docker_templates[SupportedDockerImages.postgres13], minor_version, + docker_templates[SupportedDockerImages.postgres14], minor_version, postgres_version) - dest_file_name = f"{exec_path}/{docker_outputs[SupportedDockerImages.postgres13]}" + dest_file_name = f"{exec_path}/{docker_outputs[SupportedDockerImages.postgres14]}" create_directory_if_not_exists(dest_file_name) write_to_file(content, dest_file_name) @@ -127,22 +127,22 @@ def update_all_docker_files(project_version: str, exec_path: str): template_path = f"{BASE_PATH}/templates/docker" pkgvars_file = f"{exec_path}/pkgvars" - postgres_14_version, postgres_13_version, postgres_12_version = read_postgres_versions(pkgvars_file) + postgres_15_version, postgres_14_version, postgres_13_version = read_postgres_versions(pkgvars_file) - latest_postgres_version = postgres_14_version + latest_postgres_version = postgres_15_version update_docker_file_for_latest_postgres(project_version, template_path, exec_path, latest_postgres_version) update_regular_docker_compose_file(project_version, template_path, exec_path) update_docker_file_alpine(project_version, template_path, exec_path, latest_postgres_version) - update_docker_file_for_postgres12(project_version, template_path, exec_path, postgres_12_version) update_docker_file_for_postgres13(project_version, template_path, exec_path, postgres_13_version) + update_docker_file_for_postgres14(project_version, template_path, exec_path, postgres_14_version) update_changelog(project_version, exec_path, latest_postgres_version) def read_postgres_versions(pkgvars_file: str) -> Tuple[str, str, str]: if os.path.exists(pkgvars_file): config = dotenv_values(pkgvars_file) - return config["postgres_14_version"], config["postgres_13_version"], config["postgres_12_version"] + return config["postgres_15_version"], config["postgres_14_version"], config["postgres_13_version"] return "14.1", "13.5", "12.9"