Skip to content

Commit f7d3a3a

Browse files
CI: Ubuntu 26.04 with Python 3.12 is added to test
1 parent cf92cc5 commit f7d3a3a

2 files changed

Lines changed: 131 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ jobs:
146146
python: "3"
147147
postgres: "17"
148148
case_suffix: "py3_xx_xx-pg17_xx"
149+
- platform: "ubuntu_26_04"
150+
python: "3.12"
151+
postgres: "17"
152+
case_suffix: "py3_12_xx-pg17_xx"
149153
- platform: "altlinux_10"
150154
python: "3"
151155
postgres: "17"

Dockerfile--ubuntu_26_04.tmpl

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
ARG PG_VERSION=17
2+
ARG PYTHON_VERSION=3.12
3+
4+
# --------------------------------------------- base1
5+
FROM ubuntu:26.04 AS base1
6+
ARG PG_VERSION
7+
8+
# Disable interactive apt questions so that the build doesn't hang when setting time zones
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
RUN apt-get update && apt-get install -y --no-install-recommends \
12+
sudo \
13+
curl \
14+
ca-certificates \
15+
openssh-server \
16+
sshpass \
17+
time \
18+
netcat-traditional \
19+
iproute2 \
20+
git \
21+
postgresql-common \
22+
libpq-dev \
23+
build-essential \
24+
# FIX FOR TestOsOpsCommon::test_mkdir__mt[remote_ops] \
25+
# INFO [2026-07-14 11:12:31] [Worker #3] Number 0 is reserved! \
26+
# INFO [2026-07-14 11:12:31] [Worker #0] Number 0 is reserved! \
27+
# Returning classic GNU coreutils instead of the default Rust/uutils \
28+
&& apt-get install -y --allow-remove-essential coreutils-from-gnu coreutils-from-uutils- \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \
32+
sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \
33+
sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config
34+
35+
RUN bash /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
36+
37+
RUN install -d /usr/share/postgresql-common/pgdg
38+
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
39+
40+
RUN apt-get update && apt-get install -y --no-install-recommends \
41+
postgresql-${PG_VERSION}
42+
43+
# --------------------------------------------- base2_with_python-3
44+
FROM base1 AS base2_with_python-3
45+
46+
RUN apt-get update && apt-get install -y --no-install-recommends \
47+
python3 \
48+
python3-dev \
49+
python3-venv \
50+
&& rm -rf /var/lib/apt/lists/*
51+
52+
ENV PYTHON_BINARY=python3
53+
54+
# --------------------------------------------- base2_with_python-3.12
55+
FROM base1 AS base2_with_python-3.12
56+
57+
RUN apt-get update && apt-get install -y --no-install-recommends \
58+
software-properties-common \
59+
gnupg \
60+
&& add-apt-repository -y ppa:deadsnakes/ppa \
61+
&& apt-get update && apt-get install -y --no-install-recommends \
62+
python3.12 \
63+
python3.12-venv \
64+
python3.12-dev \
65+
&& rm -rf /var/lib/apt/lists/*
66+
67+
ENV PYTHON_BINARY=/usr/bin/python3.12
68+
69+
# --------------------------------------------- final
70+
FROM base2_with_python-${PYTHON_VERSION} AS final
71+
72+
EXPOSE 22
73+
RUN ssh-keygen -A
74+
75+
RUN useradd -m test && usermod -aG postgres test
76+
77+
# It enables execution of "sudo service ssh start" without password
78+
RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
79+
80+
COPY --chown=test:test . /home/test/testgres
81+
WORKDIR /home/test/testgres
82+
83+
ENV LANG=C.UTF-8
84+
85+
RUN chmod 700 /home/test/ && \
86+
mkdir -p /home/test/.ssh && \
87+
chown -R test:test /home/test/.ssh
88+
89+
#
90+
# \"$@\"
91+
# - quote is important!
92+
# - "DUMMY-DUMMY-DUMMY" will be ignored. Do not ask me "why?". AXEZ.
93+
#
94+
ENTRYPOINT ["sh", "-c", " \
95+
set -eux; \
96+
echo 'SYSTEM START: PREPARING SSH'; \
97+
service ssh start; \
98+
ls -la /home/test/.ssh/; \
99+
\"$@\" \
100+
", "DUMMY-DUMMY-DUMMY"]
101+
102+
# Run tests by default (master machine role)
103+
CMD ["bash", "-c", " \
104+
set -eux; \
105+
echo \"HOME DIR IS [`realpath ~/`]\"; \
106+
echo \"WORK DIR IS [$(pwd)]\"; \
107+
if [ ! -f /home/test/.ssh/id_rsa ]; then \
108+
su test -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\"; \
109+
su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys\"; \
110+
chmod 600 /home/test/.ssh/authorized_keys; \
111+
fi; \
112+
ls -la /home/test/.ssh/; \
113+
su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \
114+
su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \
115+
if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \
116+
su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \
117+
fi; \
118+
if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \
119+
cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \
120+
export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \
121+
chown test:test \"${TEST_CFG__REMOTE_SSH_KEY}\"; \
122+
chmod 600 \"${TEST_CFG__REMOTE_SSH_KEY}\"; \
123+
ls -la /home/test/.ssh/; \
124+
fi; \
125+
ls -la ./; \
126+
su test -c \"TEST_FILTER='' bash ./run_tests.sh\"; \
127+
"]

0 commit comments

Comments
 (0)