Skip to content

Commit a5deab6

Browse files
[CI] AstraLinux 1.7 is tested (#334)
It has python 3.7.3. run_tests.sh upgrades pip, setuptools and wheel before his work.
1 parent 8246973 commit a5deab6

File tree

4 files changed

+117
-1
lines changed

4 files changed

+117
-1
lines changed

.github/workflows/package-verification.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ jobs:
102102
- platform: "altlinux_11"
103103
python: "3"
104104
postgres: "17"
105+
- platform: "astralinux_1_7"
106+
python: "3"
107+
postgres: "17"
105108

106109
steps:
107110
- name: Prepare variables

Dockerfile--astralinux_1_7.tmpl

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
ARG PG_VERSION
2+
ARG PYTHON_VERSION
3+
4+
# --------------------------------------------- base1
5+
FROM packpack/packpack:astra-1.7 AS base1
6+
7+
RUN apt update
8+
RUN apt install -y sudo curl ca-certificates
9+
RUN apt update
10+
RUN apt install -y openssh-server
11+
RUN apt install -y time
12+
# RUN apt install -y netcat-traditional
13+
14+
RUN apt install -y git
15+
16+
# --------------------------------------------- postgres
17+
FROM base1 AS base1_with_dev_tools
18+
19+
RUN apt-get update
20+
21+
RUN apt-get install -y git
22+
RUN apt-get install -y gcc
23+
RUN apt-get install -y make
24+
25+
RUN apt-get install -y meson
26+
RUN apt-get install -y flex
27+
RUN apt-get install -y bison
28+
29+
RUN apt-get install -y pkg-config
30+
RUN apt-get install -y libssl-dev
31+
RUN apt-get install -y libicu-dev
32+
RUN apt-get install -y libzstd-dev
33+
RUN apt-get install -y zlib1g-dev
34+
RUN apt-get install -y liblz4-dev
35+
RUN apt-get install -y libzstd-dev
36+
RUN apt-get install -y libxml2-dev
37+
38+
# --------------------------------------------- postgres
39+
FROM base1_with_dev_tools AS base1_with_pg-17
40+
41+
RUN curl -fsSL https://ftp.postgresql.org/pub/source/v17.7/postgresql-17.7.tar.bz2 -o postgresql.tar.bz2 \
42+
&& mkdir -p /pg/postgres/source \
43+
&& tar -xjf postgresql.tar.bz2 -C /pg/postgres/source --strip-components=1 \
44+
&& rm postgresql.tar.bz2
45+
46+
WORKDIR /pg/postgres/source
47+
48+
RUN ./configure --prefix=/pg/postgres/install --with-zlib --with-openssl --without-readline --with-lz4 --with-zstd --with-libxml
49+
RUN make -j 4 install
50+
RUN make -j 4 -C contrib install
51+
52+
# SETUP PG_CONFIG
53+
# When pg_config symlink in /usr/local/bin it returns a real (right) result of --bindir
54+
RUN ln -s /pg/postgres/install/bin/pg_config -t /usr/local/bin
55+
56+
# SETUP PG CLIENT LIBRARY
57+
# libpq.so.5 is enough
58+
RUN ln -s /pg/postgres/install/lib/libpq.so.5.17 /usr/lib/libpq.so.5
59+
60+
# --------------------------------------------- base2_with_python-3
61+
FROM base1_with_pg-${PG_VERSION} AS base2_with_python-3
62+
RUN apt install -y python3 python3-dev python3-venv
63+
64+
ENV PYTHON_BINARY=python3
65+
66+
# --------------------------------------------- final
67+
FROM base2_with_python-${PYTHON_VERSION} AS final
68+
69+
EXPOSE 22
70+
71+
RUN ssh-keygen -A
72+
73+
RUN useradd -m test
74+
75+
# It enables execution of "sudo service ssh start" without password
76+
# MY OLD:
77+
# RUN sh -c "echo test ALL=NOPASSWD:ALL" >> /etc/sudoers
78+
# AI:
79+
RUN echo "test ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
80+
81+
# THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD
82+
RUN sh -c "echo "test:*" | chpasswd -e"
83+
RUN sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
84+
85+
ADD --chown=test:test . /home/test/testgres
86+
WORKDIR /home/test/testgres
87+
RUN mkdir /home/test/testgres/logs
88+
RUN chown -R test:test /home/test/testgres/logs
89+
90+
ENV LANG=C.UTF-8
91+
92+
USER test
93+
94+
RUN chmod 700 ~/
95+
RUN mkdir -p ~/.ssh
96+
RUN chmod 700 ~/.ssh
97+
98+
ENTRYPOINT sh -c " \
99+
set -eux; \
100+
echo HELLO FROM ENTRYPOINT; \
101+
echo HOME DIR IS [`realpath ~/`]; \
102+
ls -la .; \
103+
sudo service ssh start; \
104+
sudo chmod 777 /home/test/testgres/logs; \
105+
ls -la . | grep logs; \
106+
ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \
107+
ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \
108+
ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \
109+
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \
110+
chmod 600 ~/.ssh/authorized_keys; \
111+
ls -la ~/.ssh/; \
112+
TEST_FILTER=\"\" bash ./run_tests.sh;"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# testgres
1010

11-
Utility for orchestrating temporary PostgreSQL clusters in Python tests. Supports Python 3.7.17 and newer.
11+
Utility for orchestrating temporary PostgreSQL clusters in Python tests. Supports Python 3.7.3 and newer.
1212

1313
## Installation
1414

run_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ rm -rf $VENV_PATH
1616
${PYTHON_BINARY} -m venv "${VENV_PATH}"
1717
export VIRTUAL_ENV_DISABLE_PROMPT=1
1818
source "${VENV_PATH}/bin/activate"
19+
pip install --upgrade pip setuptools wheel
1920
pip install -r tests/requirements.txt
2021

2122
# remove existing coverage file

0 commit comments

Comments
 (0)