From ec9590fbf9877f5183588d05b5209c67767984f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrkan=20=C4=B0ndibay?= Date: Fri, 22 Sep 2023 09:45:11 +0300 Subject: [PATCH] Adds bookworm into test images (#339) * Adds debian-bookworm and removes ubuntu-focal --- .github/workflows/package-tests.yml | 8 +-- test-images/centos-7/Dockerfile | 1 - test-images/centos-8/Dockerfile | 1 - test-images/debian-bookworm/Dockerfile | 77 ++++++++++++++++++++++++++ test-images/debian-bullseye/Dockerfile | 11 ---- test-images/debian-buster/Dockerfile | 11 ---- test-images/debian-stretch/Dockerfile | 11 ---- test-images/el-7/Dockerfile | 1 - test-images/el-8/Dockerfile | 1 - test-images/ol-7/Dockerfile | 1 - test-images/ubuntu-bionic/Dockerfile | 11 ---- test-images/ubuntu-focal/Dockerfile | 11 ---- test-images/ubuntu-jammy/Dockerfile | 11 ---- 13 files changed, 81 insertions(+), 75 deletions(-) create mode 100644 test-images/debian-bookworm/Dockerfile diff --git a/.github/workflows/package-tests.yml b/.github/workflows/package-tests.yml index 87db5273..c7b07026 100644 --- a/.github/workflows/package-tests.yml +++ b/.github/workflows/package-tests.yml @@ -37,8 +37,8 @@ jobs: export PROJECT_VERSION="${{ github.event.inputs.project_version }}" echo "project_version: ${{ github.event.inputs.project_version }}" # To be able to test pipeline without triggering with project_version parameter using workflow_dispatch parameter, - # if workflow_dispatch parameter is empty, 11.1.4 parameter is set to execute pipeline. - [ -z ${PROJECT_VERSION} ] && export PROJECT_VERSION=11.1.4 + # if workflow_dispatch parameter is empty, 12.0.0 parameter is set to execute pipeline. + [ -z ${PROJECT_VERSION} ] && export PROJECT_VERSION=12.0.0 POSTGRES_VERSIONS=$(python -m packaging_automation.get_postgres_versions --project_version ${PROJECT_VERSION}) echo "Postgres Version: ${POSTGRES_VERSIONS}" echo "::set-output name=pg_versions::${POSTGRES_VERSIONS}" @@ -54,7 +54,7 @@ jobs: - ol/7 - debian/buster - debian/bullseye - - ubuntu/bionic + - debian/bookworm - ubuntu/focal - ubuntu/jammy pg: ${{ fromJson(needs.metadata.outputs.pg_versions) }} @@ -75,7 +75,7 @@ jobs: run: | export PROJECT_VERSION="${{ github.event.inputs.project_version }}" echo "Citus Version: ${PROJECT_VERSION} " - [ -z ${PROJECT_VERSION} ] && export PROJECT_VERSION=11.1.4 + [ -z ${PROJECT_VERSION} ] && export PROJECT_VERSION=12.0.0 python -m packaging_automation.test_citus_package \ --project_version "${PROJECT_VERSION}" \ --os_release ${{ matrix.platform }} \ diff --git a/test-images/centos-7/Dockerfile b/test-images/centos-7/Dockerfile index e2330046..c5cd69ca 100644 --- a/test-images/centos-7/Dockerfile +++ b/test-images/centos-7/Dockerfile @@ -68,4 +68,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - diff --git a/test-images/centos-8/Dockerfile b/test-images/centos-8/Dockerfile index 47bd2879..c2a3c058 100644 --- a/test-images/centos-8/Dockerfile +++ b/test-images/centos-8/Dockerfile @@ -70,4 +70,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - diff --git a/test-images/debian-bookworm/Dockerfile b/test-images/debian-bookworm/Dockerfile new file mode 100644 index 00000000..5a802b9c --- /dev/null +++ b/test-images/debian-bookworm/Dockerfile @@ -0,0 +1,77 @@ +FROM debian:bookworm +ARG CITUS_VERSION +# FOrmat should be XY and should not include dots e.g for 10.2.1=>102 +ARG CITUS_MAJOR_VERSION +ARG PG_MAJOR +ARG FANCY=1 +ARG HLL_VERSION=2.18.citus-1 +ARG TOPN_VERSION=2.6.0.citus-1 + +ENV CITUS_VERSION ${CITUS_VERSION} + +ENV PG_MAJOR ${PG_MAJOR} + +ENV TZ=Europe/Istanbul +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# install prequisities +RUN apt-get update \ + && apt-get install -y lsb-release \ + apt-utils \ + vim \ + wget \ + curl \ + gnupg2 \ + software-properties-common \ + libcurl4-openssl-dev \ + libssl-dev + + +# install Citus +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + && curl -s https://install.citusdata.com/community/deb.sh | bash +RUN apt-get install -y postgresql-${PG_MAJOR}-citus-${CITUS_MAJOR_VERSION}=${CITUS_VERSION}.citus-${FANCY} \ + postgresql-$PG_MAJOR-hll=${HLL_VERSION} \ + postgresql-$PG_MAJOR-topn=${TOPN_VERSION} \ + && rm -rf /var/lib/apt/lists/*12 + + + +ARG POSTGRES_HOME=/var/lib/postgresql/ +ENV PATH=${PATH}:/usr/lib/postgresql/${PG_MAJOR}/bin:${POSTGRES_HOME} + +WORKDIR ${POSTGRES_HOME} + +RUN mkdir citus && chown postgres citus + +USER postgres +RUN cd ~ && initdb -D citus && echo "shared_preload_libraries = 'citus'" >> citus/postgresql.conf + +USER root +# Install python 3.8 and its dependencies +RUN apt-get install -y build-essential \ + libcurl4-openssl-dev \ + libssl-dev \ + zlib1g-dev \ + curl \ + libffi-dev \ + gnupg2 && \ + curl https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz --output Python-3.8.12.tgz &&\ + tar xvf Python-3.8.12.tgz &&\ + cd Python-3.8.*/ && \ + ./configure --enable-optimizations && \ + make altinstall && \ + python3.8 -m pip install pip-tools + +COPY scripts/* ./ + +RUN pip-compile && python3.8 -m pip install -r requirements.txt + +USER postgres + +WORKDIR ${POSTGRES_HOME} + +CMD ["test_internal.sh"] diff --git a/test-images/debian-bullseye/Dockerfile b/test-images/debian-bullseye/Dockerfile index 15d1763f..8ad82e50 100644 --- a/test-images/debian-bullseye/Dockerfile +++ b/test-images/debian-bullseye/Dockerfile @@ -75,14 +75,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - - - - - - - - - - - diff --git a/test-images/debian-buster/Dockerfile b/test-images/debian-buster/Dockerfile index f24df3c9..efa25676 100644 --- a/test-images/debian-buster/Dockerfile +++ b/test-images/debian-buster/Dockerfile @@ -76,14 +76,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - - - - - - - - - - - diff --git a/test-images/debian-stretch/Dockerfile b/test-images/debian-stretch/Dockerfile index 37a5785d..b5dd77b0 100644 --- a/test-images/debian-stretch/Dockerfile +++ b/test-images/debian-stretch/Dockerfile @@ -76,14 +76,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - - - - - - - - - - - diff --git a/test-images/el-7/Dockerfile b/test-images/el-7/Dockerfile index ca1bca1c..ff42ec93 100644 --- a/test-images/el-7/Dockerfile +++ b/test-images/el-7/Dockerfile @@ -69,4 +69,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - diff --git a/test-images/el-8/Dockerfile b/test-images/el-8/Dockerfile index 8190fd62..4a62ddf4 100644 --- a/test-images/el-8/Dockerfile +++ b/test-images/el-8/Dockerfile @@ -68,4 +68,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - diff --git a/test-images/ol-7/Dockerfile b/test-images/ol-7/Dockerfile index 2dd0b5a2..4c6ed510 100644 --- a/test-images/ol-7/Dockerfile +++ b/test-images/ol-7/Dockerfile @@ -62,4 +62,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - diff --git a/test-images/ubuntu-bionic/Dockerfile b/test-images/ubuntu-bionic/Dockerfile index 53d7de99..418e40ca 100644 --- a/test-images/ubuntu-bionic/Dockerfile +++ b/test-images/ubuntu-bionic/Dockerfile @@ -76,14 +76,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - - - - - - - - - - - diff --git a/test-images/ubuntu-focal/Dockerfile b/test-images/ubuntu-focal/Dockerfile index 5666f124..de65a8a3 100644 --- a/test-images/ubuntu-focal/Dockerfile +++ b/test-images/ubuntu-focal/Dockerfile @@ -76,14 +76,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - - - - - - - - - - - diff --git a/test-images/ubuntu-jammy/Dockerfile b/test-images/ubuntu-jammy/Dockerfile index acd468ff..6894a2b4 100644 --- a/test-images/ubuntu-jammy/Dockerfile +++ b/test-images/ubuntu-jammy/Dockerfile @@ -76,14 +76,3 @@ USER postgres WORKDIR ${POSTGRES_HOME} CMD ["test_internal.sh"] - - - - - - - - - - -