| Ievgeniia Zadorozhna | bed5b40 | 2025-09-04 13:36:16 +0200 | [diff] [blame] | 1 | FROM ubuntu:18.04 AS download-packages-1804 |
| 2 | RUN mkdir /opt/packages-1804 && cd /opt/packages-1804 && \ |
| 3 | apt-get update && \ |
| 4 | apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances iperf3 iperf fio nfs-utils | grep "^\w" | sort -u) || true && \ |
| 5 | rm -rf /var/lib/apt/lists/* |
| 6 | |
| 7 | FROM ubuntu:20.04 AS download-packages-2004 |
| 8 | RUN mkdir /opt/packages && cd /opt/packages && \ |
| 9 | apt-get update && \ |
| 10 | apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances iperf3 iperf fio nfs-utils | grep "^\w" | sort -u) || true && \ |
| 11 | rm -rf /var/lib/apt/lists/* |
| 12 | |
| 13 | FROM ubuntu:22.04 |
| 14 | |
| 15 | LABEL maintainer="qa-ps@mirantis.com" |
| 16 | |
| 17 | ADD k8s/src/ksi.tgz /opt/ksi/ |
| 18 | ADD k8s/src/mos-checker.tgz /opt/cfg-checker/ |
| 19 | WORKDIR /opt |
| 20 | |
| 21 | COPY --from=download-packages-2004 /opt/packages /opt/packages |
| 22 | COPY --from=download-packages-1804 /opt/packages-1804 /opt/packages-1804 |
| 23 | |
| 24 | RUN apt-get clean && apt-get update && \ |
| 25 | apt-get install -y make gcc g++ git libaio-dev libaio1 zlib1g-dev software-properties-common fio && \ |
| 26 | rm -rf /var/lib/apt/lists/* |
| 27 | |
| 28 | RUN export TZ="America/Chicago" && \ |
| 29 | ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ |
| Ievgeniia Zadorozhna | 86ab37a | 2025-09-11 12:58:49 +0200 | [diff] [blame] | 30 | add-apt-repository ppa:deadsnakes/ppa && \ |
| Ievgeniia Zadorozhna | bed5b40 | 2025-09-04 13:36:16 +0200 | [diff] [blame] | 31 | apt-get clean && apt-get update && \ |
| Ievgeniia Zadorozhna | 45cf52f | 2025-10-24 18:32:56 +0200 | [diff] [blame] | 32 | apt-get install -y python3-pip python3-venv vim git iperf3 iperf mtr htop iputils-ping traceroute tcpdump wget iproute2 curl screen qemu-utils jq && \ |
| Ievgeniia Zadorozhna | 86ab37a | 2025-09-11 12:58:49 +0200 | [diff] [blame] | 33 | apt-get install -y python3.12 python3.12-venv python3.12-dev && \ |
| Ievgeniia Zadorozhna | 45cf52f | 2025-10-24 18:32:56 +0200 | [diff] [blame] | 34 | wget -qO /usr/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 && \ |
| 35 | chmod a+x /usr/bin/yq && \ |
| Ievgeniia Zadorozhna | 9e533e9 | 2025-11-26 20:35:26 +0100 | [diff] [blame^] | 36 | curl -LsSf https://astral.sh/uv/install.sh | sh && \ |
| Ievgeniia Zadorozhna | bed5b40 | 2025-09-04 13:36:16 +0200 | [diff] [blame] | 37 | rm -rf /var/lib/apt/lists/* |
| 38 | |
| Ievgeniia Zadorozhna | 9e533e9 | 2025-11-26 20:35:26 +0100 | [diff] [blame^] | 39 | ENV PATH="/root/.local/bin/:$PATH" |
| 40 | |
| Ievgeniia Zadorozhna | bed5b40 | 2025-09-04 13:36:16 +0200 | [diff] [blame] | 41 | RUN apt-get update && \ |
| 42 | apt-get install curl gpg apt-transport-https --yes && \ |
| 43 | curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null && \ |
| 44 | echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | tee /etc/apt/sources.list.d/helm-stable-debian.list && \ |
| 45 | apt-get update && \ |
| 46 | apt-get install -y helm && \ |
| 47 | rm -rf /var/lib/apt/lists/* |
| 48 | |
| 49 | RUN pip3 install --no-cache-dir pyghmi tempestparser |
| 50 | |
| 51 | RUN git clone --single-branch https://gerrit.mcp.mirantis.com/mcp/cvp-configuration -b k0rdent /opt/res-files && \ |
| 52 | cd /opt/cfg-checker && \ |
| 53 | python3 -m venv .checkervenv && \ |
| 54 | . .checkervenv/bin/activate && \ |
| 55 | pip3 install --no-cache-dir -r requirements.txt && \ |
| 56 | python3 setup.py develop && \ |
| 57 | deactivate && \ |
| 58 | mkdir /opt/cmp-check && cd /opt/cmp-check && \ |
| 59 | cp /opt/res-files/scripts/prepare.sh ./ && \ |
| 60 | cp /opt/res-files/scripts/cmp_check.sh ./ && \ |
| 61 | cp /opt/res-files/cleanup.sh ./ && \ |
| 62 | rm -rf /opt/res-files/.git && \ |
| 63 | rm -rf /opt/cfg-checker/.git |
| 64 | |
| Ievgeniia Zadorozhna | 86ab37a | 2025-09-11 12:58:49 +0200 | [diff] [blame] | 65 | RUN cp /opt/res-files/k8s/sanity-checks/test_sanity_checks.py /opt/ksi/ && \ |
| 66 | cd /opt/ksi/ && \ |
| Ievgeniia Zadorozhna | 9e533e9 | 2025-11-26 20:35:26 +0100 | [diff] [blame^] | 67 | uv sync --frozen --no-dev && \ |
| 68 | . .venv/bin/activate && \ |
| 69 | uv add pytest-subtests pytest-html && \ |
| Ievgeniia Zadorozhna | bed5b40 | 2025-09-04 13:36:16 +0200 | [diff] [blame] | 70 | deactivate |
| 71 | |
| 72 | RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ |
| 73 | install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \ |
| 74 | rm kubectl |
| 75 | |
| 76 | RUN git clone "https://gerrit.mcp.mirantis.com/mcp/mos-spt" /opt/mos-spt && \ |
| 77 | cd /opt/mos-spt && \ |
| 78 | python3 -m venv .venv && \ |
| 79 | . .venv/bin/activate && \ |
| 80 | pip3 install --no-cache-dir -r requirements.txt && \ |
| 81 | deactivate |
| 82 | |
| Ievgeniia Zadorozhna | 86ab37a | 2025-09-11 12:58:49 +0200 | [diff] [blame] | 83 | RUN mkdir /opt/conformance && \ |
| 84 | cd /opt/conformance && \ |
| 85 | wget https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.57.3/sonobuoy_0.57.3_linux_amd64.tar.gz && \ |
| 86 | tar -xf sonobuoy_0.57.3_linux_amd64.tar.gz && \ |
| 87 | mv sonobuoy /usr/local/bin/ |
| 88 | |
| Ievgeniia Zadorozhna | bed5b40 | 2025-09-04 13:36:16 +0200 | [diff] [blame] | 89 | RUN printf "LABELS:\n IMAGE_TAG: k0rdent" > /dockerimage_metadata |
| 90 | |
| 91 | WORKDIR /artifacts |
| 92 | |
| Ievgeniia Zadorozhna | d813db5 | 2025-11-26 18:41:49 +0100 | [diff] [blame] | 93 | RUN echo '[ -f /artifacts/env.sh ] && . /artifacts/env.sh' >> /root/.bashrc && \ |
| 94 | echo '[ -f /artifacts/envs/mgmtrc ] && . /artifacts/envs/mgmtrc' >> /root/.bashrc |
| 95 | |
| Ievgeniia Zadorozhna | bed5b40 | 2025-09-04 13:36:16 +0200 | [diff] [blame] | 96 | ENTRYPOINT ["sleep infinite"] |
| 97 | |