Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ jobs:
env:
BASE_SIGN: "${{ matrix.platform }}-${{ matrix.case_suffix }}"

DOCKER_HIGHLOAD_FLAGS: >-
--init

steps:
- name: Prepare variables
run: |
Expand Down Expand Up @@ -170,6 +173,7 @@ jobs:
# "- sleep infinity" is a right command. Docker ignores "-" and runs "sleep infinity".
#
docker run -d -t \
${{ env.DOCKER_HIGHLOAD_FLAGS }} \
--network ${{ env.RUN_CFG__NETWORK_NAME }} \
--name ${{ env.RUN_CFG__MACHINE2_NAME }} \
"${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \
Expand Down Expand Up @@ -217,6 +221,7 @@ jobs:
# Pass environment variables so Python tests know where to start.
# Added the --rm flag so that the container is automatically deleted after the tests are completed
docker run --rm -t \
${{ env.DOCKER_HIGHLOAD_FLAGS }} \
--network ${{ env.RUN_CFG__NETWORK_NAME }} \
--name ${{ env.RUN_CFG__MACHINE1_NAME }} \
-v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/testgres/logs \
Expand Down
20 changes: 14 additions & 6 deletions Dockerfile--alpine.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ RUN apk add --no-cache \
sudo \
git

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

ENV PYTHON_BINARY=python3

# --------------------------------------------- base2
Expand Down Expand Up @@ -43,7 +47,16 @@ RUN echo "test:*" | chpasswd -e

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

#
# \"$@\"
Expand All @@ -69,11 +82,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\"; \
Expand Down
29 changes: 15 additions & 14 deletions Dockerfile--altlinux_10.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ RUN apt-get update && apt-get install -y \
git \
&& apt-get clean

RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/openssh/sshd_config && \
sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/openssh/sshd_config && \
sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/openssh/sshd_config

# --------------------------------------------- base2_with_python-3
FROM base1 AS base2_with_python-3

Expand All @@ -36,21 +40,23 @@ RUN adduser test -G wheel
# It enables execution of "sudo service ssh start" without password
RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

#
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
#
# AI: SPEED UP SSH 6 TIMES (REMOVE REVERSE DNS LOOKUP TIMEOUTS)
#
RUN echo "UseDNS no" >> /etc/openssh/sshd_config

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

#
# \"$@\"
Expand All @@ -60,7 +66,7 @@ RUN chmod 700 /home/test/ && \
ENTRYPOINT ["sh", "-c", " \
set -eux; \
echo 'SYSTEM START: PREPARING SSH'; \
/usr/sbin/sshd; \
(ulimit -n 1024 && /usr/sbin/sshd); \
ls -la /home/test/.ssh/; \
\"$@\" \
", "DUMMY-DUMMY-DUMMY"]
Expand All @@ -76,11 +82,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \
chmod 600 /home/test/.ssh/authorized_keys; \
fi; \
ls -la /home/test/.ssh/; \
su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \
su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \
if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \
su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\" test; \
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\"; \
Expand Down
29 changes: 15 additions & 14 deletions Dockerfile--altlinux_11.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ RUN apt-get update && apt-get install -y \
procps \
&& apt-get clean

RUN sed -i 's/#MaxStartups 10:30:100/MaxStartups 2000:30:2000/' /etc/openssh/sshd_config && \
sed -i 's/#MaxSessions 10/MaxSessions 500/' /etc/openssh/sshd_config && \
sed -i 's/#MaxAuthTries 6/MaxAuthTries 20/' /etc/openssh/sshd_config

# --------------------------------------------- base2_with_python-3
FROM base1 AS base2_with_python-3

Expand All @@ -37,21 +41,23 @@ RUN adduser test -G wheel
# It enables execution of "sudo service ssh start" without password
RUN echo "test ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers

#
# Altlinux 10 and 11 too slowly create a new SSH connection (x6).
#
# AI: SPEED UP SSH 6 TIMES (REMOVE REVERSE DNS LOOKUP TIMEOUTS)
#
RUN echo "UseDNS no" >> /etc/openssh/sshd_config

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

#
# \"$@\"
Expand All @@ -61,7 +67,7 @@ RUN chmod 700 /home/test/ && \
ENTRYPOINT ["sh", "-c", " \
set -eux; \
echo 'SYSTEM START: PREPARING SSH'; \
/usr/sbin/sshd; \
(ulimit -n 1024 && /usr/sbin/sshd); \
ls -la /home/test/.ssh/; \
\"$@\" \
", "DUMMY-DUMMY-DUMMY"]
Expand All @@ -77,11 +83,6 @@ if [ ! -f /home/test/.ssh/id_rsa ]; then \
chmod 600 /home/test/.ssh/authorized_keys; \
fi; \
ls -la /home/test/.ssh/; \
su -c \"ssh-keyscan -H localhost >> /home/test/.ssh/known_hosts\" test; \
su -c \"ssh-keyscan -H 127.0.0.1 >> /home/test/.ssh/known_hosts\" test; \
if [ -n \"${TEST_CFG__REMOTE_HOST:-}\" ]; then \
su -c \"ssh-keyscan -H ${TEST_CFG__REMOTE_HOST} >> /home/test/.ssh/known_hosts\" test; \
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\"; \
Expand Down
20 changes: 14 additions & 6 deletions Dockerfile--astralinux_1_7.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& 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

# --------------------------------------------- base2_with_python-3
FROM base1 AS base2_with_python-3

Expand Down Expand Up @@ -51,7 +55,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

#
# \"$@\"
Expand All @@ -77,11 +90,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\"; \
Expand Down
24 changes: 16 additions & 8 deletions Dockerfile--rockylinux_10.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN dnf install -y 'dnf-command(config-manager)' && \

# Consolidating system utilities, including iproute (to prevent tests from failing)
# Added the --allowerasing flag so dnf can seamlessly replace curl-minimal with full-fledged curl
RUN dnf install -y --allowerasing \
RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \
sudo \
curl \
ca-certificates \
Expand All @@ -29,6 +29,10 @@ RUN dnf install -y --allowerasing \
git \
&& dnf clean all

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

# In RHEL 9/10, to generate host keys inside Docker, you need to call this binary
RUN /usr/libexec/openssh/sshd-keygen rsa && \
/usr/libexec/openssh/sshd-keygen ed25519
Expand All @@ -37,7 +41,7 @@ RUN /usr/libexec/openssh/sshd-keygen rsa && \
FROM base1 AS base2_with_python-3

# Rocky 9/10 installs python3.9 or higher (depending on the repository)
RUN dnf install -y \
RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \
python3 \
python3-devel \
&& dnf clean all
Expand Down Expand Up @@ -67,7 +71,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

# Our ENTRYPOINT with a stub
ENTRYPOINT ["sh", "-c", " \
Expand All @@ -90,11 +103,6 @@ if [ ! -f /home/test/.ssh/id_ed25519 ]; 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\"; \
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile--rockylinux_8.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN dnf install -y 'dnf-command(config-manager)' && \
dnf config-manager --set-enabled powertools

# Combine the installation of system utilities, SSH into one layer
RUN dnf install -y \
RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 \
sudo \
curl \
ca-certificates \
Expand All @@ -29,10 +29,14 @@ RUN dnf install -y \
iproute \
&& dnf clean all

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

# --------------------------------------------- base2_with_python-3
FROM base1 AS base2_with_python-3

RUN dnf install -y \
RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 \
python39 \
python39-devel \
&& dnf clean all
Expand Down
24 changes: 16 additions & 8 deletions Dockerfile--rockylinux_9.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN dnf install -y 'dnf-command(config-manager)' && \

# Consolidating system utilities, including iproute (to prevent tests from failing)
# Added the --allowerasing flag so dnf can seamlessly replace curl-minimal with full-fledged curl
RUN dnf install -y --allowerasing \
RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \
sudo \
curl \
ca-certificates \
Expand All @@ -29,6 +29,10 @@ RUN dnf install -y --allowerasing \
git \
&& dnf clean all

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

# In RHEL 9/10, to generate host keys inside Docker, you need to call this binary
RUN /usr/libexec/openssh/sshd-keygen rsa && \
/usr/libexec/openssh/sshd-keygen ed25519
Expand All @@ -37,7 +41,7 @@ RUN /usr/libexec/openssh/sshd-keygen rsa && \
FROM base1 AS base2_with_python-3

# Rocky 9/10 installs python3.9 or higher (depending on the repository)
RUN dnf install -y \
RUN dnf install -y --setopt=retries=10 --setopt=max_parallel_downloads=10 --allowerasing \
python3 \
python3-devel \
&& dnf clean all
Expand Down Expand Up @@ -67,7 +71,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

# Our ENTRYPOINT with a stub
ENTRYPOINT ["sh", "-c", " \
Expand All @@ -90,11 +103,6 @@ if [ ! -f /home/test/.ssh/id_ed25519 ]; 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\"; \
Expand Down
Loading