Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds bookworm into test images #339

Merged
merged 5 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/package-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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) }}
Expand All @@ -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 }} \
Expand Down
88 changes: 88 additions & 0 deletions test-images/debian-bookworm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
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
Comment on lines +17 to +39
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we not merge these RUN commands?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in sake of debugging purposes. If there is an error in a command, I have issues to find which statement causes this error.
Since this is not an image to publish, merging them will not give a benefit to us

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is actually a benefit: the resulting docker image will be smaller. Every apt command that does not include rm -rf /var/lib/apt/lists/* at the end will result in bigger docker images, and having to download bigger docker images result in longer CI run times.




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"]











Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Why so many empty lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there were empty spaces in other files and I formed this one from others. Removed empty spaces for all files now