From 95336e4f69fe7743cd3c720b4e749e9a100469e8 Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Tue, 14 Jul 2026 22:02:32 +0300 Subject: [PATCH 1/2] CI: Ubuntu 26.04 with Python 3.12 is added to test --- .github/workflows/ci.yml | 4 ++ Dockerfile--ubuntu_26_04.tmpl | 127 ++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 Dockerfile--ubuntu_26_04.tmpl diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d11e1fc4..4da3df10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,6 +146,10 @@ jobs: python: "3" postgres: "17" case_suffix: "py3_xx_xx-pg17_xx" + - platform: "ubuntu_26_04" + python: "3.12" + postgres: "17" + case_suffix: "py3_12_xx-pg17_xx" - platform: "altlinux_10" python: "3" postgres: "17" diff --git a/Dockerfile--ubuntu_26_04.tmpl b/Dockerfile--ubuntu_26_04.tmpl new file mode 100644 index 00000000..cf709f5b --- /dev/null +++ b/Dockerfile--ubuntu_26_04.tmpl @@ -0,0 +1,127 @@ +ARG PG_VERSION=17 +ARG PYTHON_VERSION=3.12 + +# --------------------------------------------- base1 +FROM ubuntu:26.04 AS base1 +ARG PG_VERSION + +# Disable interactive apt questions so that the build doesn't hang when setting time zones +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y --no-install-recommends \ + sudo \ + curl \ + ca-certificates \ + openssh-server \ + sshpass \ + time \ + netcat-traditional \ + iproute2 \ + git \ + postgresql-common \ + libpq-dev \ + build-essential \ + # FIX FOR TestOsOpsCommon::test_mkdir__mt[remote_ops] \ + # INFO [2026-07-14 11:12:31] [Worker #3] Number 0 is reserved! \ + # INFO [2026-07-14 11:12:31] [Worker #0] Number 0 is reserved! \ + # Returning classic GNU coreutils instead of the default Rust/uutils \ + && apt-get install -y --allow-remove-essential coreutils-from-gnu coreutils-from-uutils- \ + && rm -rf /var/lib/apt/lists/* + +RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/ssh/sshd_config && \ + sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/ssh/sshd_config + +RUN bash /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y + +RUN install -d /usr/share/postgresql-common/pgdg +RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc + +RUN apt-get update && apt-get install -y --no-install-recommends \ + postgresql-${PG_VERSION} + +# --------------------------------------------- base2_with_python-3 +FROM base1 AS base2_with_python-3 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 \ + python3-dev \ + python3-venv \ + && rm -rf /var/lib/apt/lists/* + +ENV PYTHON_BINARY=python3 + +# --------------------------------------------- base2_with_python-3.12 +FROM base1 AS base2_with_python-3.12 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + software-properties-common \ + gnupg \ + && add-apt-repository -y ppa:deadsnakes/ppa \ + && apt-get update && apt-get install -y --no-install-recommends \ + python3.12 \ + python3.12-venv \ + python3.12-dev \ + && rm -rf /var/lib/apt/lists/* + +ENV PYTHON_BINARY=/usr/bin/python3.12 + +# --------------------------------------------- final +FROM base2_with_python-${PYTHON_VERSION} AS final + +EXPOSE 22 +RUN ssh-keygen -A + +RUN useradd -m test && usermod -aG postgres test + +# It enables execution of "sudo service ssh start" without password +RUN echo "test ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers + +COPY --chown=test:test . /home/test/testgres +WORKDIR /home/test/testgres + +ENV LANG=C.UTF-8 + +RUN chmod 700 /home/test/ && \ + mkdir -p /home/test/.ssh && \ + chown -R test:test /home/test/.ssh + +# +# \"$@\" +# - quote is important! +# - "DUMMY-DUMMY-DUMMY" will be ignored. Do not ask me "why?". AXEZ. +# +ENTRYPOINT ["sh", "-c", " \ + set -eux; \ + echo 'SYSTEM START: PREPARING SSH'; \ + service ssh start; \ + ls -la /home/test/.ssh/; \ + \"$@\" \ +", "DUMMY-DUMMY-DUMMY"] + +# Run tests by default (master machine role) +CMD ["bash", "-c", " \ +set -eux; \ +echo \"HOME DIR IS [`realpath ~/`]\"; \ +echo \"WORK DIR IS [$(pwd)]\"; \ +if [ ! -f /home/test/.ssh/id_rsa ]; then \ + su test -c \"ssh-keygen -t rsa -f /home/test/.ssh/id_rsa -q -N ''\"; \ + su test -c \"cat /home/test/.ssh/id_rsa.pub >> /home/test/.ssh/authorized_keys\"; \ + chmod 600 /home/test/.ssh/authorized_keys; \ +fi; \ +ls -la /home/test/.ssh/; \ +su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ +su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ +if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ + su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ +fi; \ +if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ + cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ + chown test:test \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ + chmod 600 \"${TEST_CFG__REMOTE_SSH_KEY}\"; \ + ls -la /home/test/.ssh/; \ +fi; \ +ls -la ./; \ +su test -c \"TEST_FILTER='' bash ./run_tests.sh\"; \ +"] From b93fc9eef187ad3cc7159e1ebfdf0707a11741cd Mon Sep 17 00:00:00 2001 From: "d.kovalenko" Date: Wed, 15 Jul 2026 01:26:48 +0300 Subject: [PATCH 2/2] CI: Ubuntu 26.04 is optimized --- Dockerfile--ubuntu_26_04.tmpl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Dockerfile--ubuntu_26_04.tmpl b/Dockerfile--ubuntu_26_04.tmpl index cf709f5b..3b30cc12 100644 --- a/Dockerfile--ubuntu_26_04.tmpl +++ b/Dockerfile--ubuntu_26_04.tmpl @@ -84,7 +84,16 @@ ENV LANG=C.UTF-8 RUN chmod 700 /home/test/ && \ mkdir -p /home/test/.ssh && \ - chown -R test:test /home/test/.ssh + echo 'Host *' > /home/test/.ssh/config && \ + echo ' ControlMaster auto' >> /home/test/.ssh/config && \ + echo ' ControlPath /home/test/.ssh/master-%r@%h:%p' >> /home/test/.ssh/config && \ + echo ' ControlPersist 30m' >> /home/test/.ssh/config && \ + echo ' StrictHostKeyChecking no' >> /home/test/.ssh/config && \ + echo ' UserKnownHostsFile /dev/null' >> /home/test/.ssh/config && \ + echo ' GSSAPIAuthentication no' >> /home/test/.ssh/config && \ + chown -R test:test /home/test/.ssh && \ + chmod 700 /home/test/.ssh && \ + chmod 600 /home/test/.ssh/config # # \"$@\" @@ -110,11 +119,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \ chmod 600 /home/test/.ssh/authorized_keys; \ fi; \ ls -la /home/test/.ssh/; \ -su test -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\"; \ -su test -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\"; \ -if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \ - su test -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\"; \ -fi; \ if [ -n \"${TEST_CFG__REMOTE_SSH_KEY:-}\" ]; then \ cp \"${TEST_CFG__REMOTE_SSH_KEY}\" \"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \ export TEST_CFG__REMOTE_SSH_KEY=\"${TEST_CFG__REMOTE_SSH_KEY}_ci\"; \