Skip to content

Commit d5ff3da

Browse files
author
Arpit Sharma
committed
Updated prow Dockerfile for newer versions and defined new variables
Updated prow Dockerfile for newer versions and defined new variables Updated prow Dockerfile for newer versions and defined new variables
1 parent 5765516 commit d5ff3da

File tree

2 files changed

+46
-59
lines changed

2 files changed

+46
-59
lines changed

Dockerfile

Lines changed: 30 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,45 @@
11
FROM quay.io/centos/centos:stream9
22

3-
# Update and use not only best candidate packages (avoiding failures)
4-
RUN dnf update -y --nobest
5-
6-
# Install development tools and necessary dependencies
7-
RUN dnf group install -y "Development Tools" \
8-
&& dnf install -y podman jq
3+
ARG python_version=3.14
4+
ARG python_patch_version=0
5+
ARG python_full_version=${python_version}.${python_patch_version}
6+
ARG OCP_CLIENT_VERSION
7+
ARG VIRTCTL_VERSION
8+
ARG BENCHMARK_OPERATOR_VERSION=v1.0.4
9+
ARG OPENSHIFT4_TOOLS_VERSION=v1.2.2-kata-ci
910

10-
# Prerequisite for Python installation
11-
ARG python_full_version=3.14.0
12-
RUN dnf install -y openssl-devel bzip2-devel wget libffi-devel
11+
ENV PYTHON_VERSION=${python_version}
1312

14-
# Install Python
15-
RUN wget https://www.python.org/ftp/python/${python_full_version}/Python-${python_full_version}.tgz \
13+
RUN dnf update -y --nobest \
14+
&& dnf group install -y "Development Tools" \
15+
&& dnf install -y podman jq openssl-devel bzip2-devel wget libffi-devel hostname bc procps-ng \
16+
&& wget https://www.python.org/ftp/python/${python_full_version}/Python-${python_full_version}.tgz \
1617
&& tar -xzf Python-${python_full_version}.tgz \
1718
&& cd Python-${python_full_version} \
1819
&& ./configure --enable-optimizations \
1920
&& make altinstall \
20-
&& echo alias python=python3.14 >> ~/.bashrc \
21-
&& rm -rf Python-${python_full_version}.tgz
22-
23-
# install & run benchmark-runner (--no-cache-dir for take always the latest)
24-
RUN python3.14 -m pip install --upgrade pip && python3.14 -m pip install --upgrade benchmark-runner
25-
26-
# Passed dynamically
27-
ARG OCP_CLIENT_VERSION
28-
RUN curl -L "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OCP_CLIENT_VERSION}/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz" -o "/tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz" \
29-
&& tar -xzvf /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz -C /tmp/ \
30-
&& mv /tmp/kubectl /usr/local/bin/kubectl \
31-
&& mv /tmp/oc /usr/local/bin/oc \
32-
&& rm -rf /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz /tmp/kubectl /tmp/oc
33-
34-
# Passed dynamically
35-
ARG VIRTCTL_VERSION
36-
RUN curl -L "https://github.com/kubevirt/kubevirt/releases/download/v${VIRTCTL_VERSION}/virtctl-v${VIRTCTL_VERSION}-linux-amd64" -o /usr/local/bin/virtctl \
37-
&& chmod +x /usr/local/bin/virtctl
38-
39-
# Activate root alias
40-
RUN source ~/.bashrc
41-
42-
# Create necessary directories with the correct permissions
43-
RUN mkdir -p ~/.kube ~/.ssh /tmp/run_artifacts
44-
45-
# download benchmark-operator to /tmp default path
46-
RUN git clone -b v1.0.4 https://github.com/cloud-bulldozer/benchmark-operator /tmp/benchmark-operator
47-
48-
# download clusterbuster to /tmp default path && install cluster-buster dependency
49-
RUN git clone -b v1.2.2-kata-ci https://github.com/RobertKrawitz/OpenShift4-tools /tmp/OpenShift4-tools \
50-
&& dnf install -y hostname bc procps-ng
51-
52-
# Cleanup to reduce image size
53-
RUN dnf clean all && rm -rf /var/cache/dnf
21+
&& echo alias python=python${python_version} >> ~/.bashrc \
22+
&& cd .. \
23+
&& rm -rf Python-${python_full_version} Python-${python_full_version}.tgz \
24+
&& python${python_version} -m pip install --upgrade pip \
25+
&& python${python_version} -m pip install --upgrade benchmark-runner \
26+
&& curl -L "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OCP_CLIENT_VERSION}/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz" -o "/tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz" \
27+
&& tar -xzf /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz -C /usr/local/bin kubectl oc \
28+
&& rm /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz \
29+
&& curl -L "https://github.com/kubevirt/kubevirt/releases/download/v${VIRTCTL_VERSION}/virtctl-v${VIRTCTL_VERSION}-linux-amd64" -o /usr/local/bin/virtctl \
30+
&& chmod +x /usr/local/bin/virtctl \
31+
&& mkdir -p ~/.kube ~/.ssh /tmp/run_artifacts \
32+
&& git clone -b ${BENCHMARK_OPERATOR_VERSION} https://github.com/cloud-bulldozer/benchmark-operator /tmp/benchmark-operator \
33+
&& git clone -b ${OPENSHIFT4_TOOLS_VERSION} https://github.com/RobertKrawitz/OpenShift4-tools /tmp/OpenShift4-tools \
34+
&& dnf clean all \
35+
&& rm -rf /var/cache/dnf
5436

5537
# Add main
5638
COPY benchmark_runner/main/main.py /benchmark_runner/main/main.py
5739

58-
CMD [ "python3.14", "/benchmark_runner/main/main.py"]
40+
# Shell form so PYTHON_VERSION is expanded; exec form would not expand ENV
41+
CMD ["/bin/sh", "-c", "exec python${PYTHON_VERSION} /benchmark_runner/main/main.py"]
5942

6043
# How to build the Dockerfile ?
61-
# sudo podman build --build-arg OCP_CLIENT_VERSION=$OCP_CLIENT_VERSION--build-arg VIRTCTL_VERSION=$VIRTCTL_VERSION -t quay.io/benchmark-runner/benchmark-runner:latest . --no-cache
44+
# sudo podman build --build-arg OCP_CLIENT_VERSION=$OCP_CLIENT_VERSION --build-arg VIRTCTL_VERSION=$VIRTCTL_VERSION -t quay.io/benchmark-runner/benchmark-runner:latest . --no-cache
6245
# sudo podman run --rm -it -v /root/.kube/:/root/.kube/ -v /etc/hosts:/etc/hosts --privileged quay.io/benchmark-runner/benchmark-runner:latest /bin/bash

prow/Dockerfile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
FROM quay.io/centos/centos:stream9
22

3-
ARG python_full_version=3.14.0
4-
ARG OCP_CLIENT_VERSION=4.19.1
5-
ARG VIRTCTL_VERSION=1.5.0
3+
ARG python_version=3.14
4+
ARG python_patch_version=0
5+
ARG python_full_version=${python_version}.${python_patch_version}
6+
ARG OCP_CLIENT_VERSION=4.21.2
7+
ARG VIRTCTL_VERSION=1.7.0
8+
ARG BENCHMARK_OPERATOR_VERSION=v1.0.4
9+
ARG OPENSHIFT4_TOOLS_VERSION=v1.2.2-kata-ci
10+
11+
ENV PYTHON_VERSION=${python_version}
612

713
RUN dnf update -y --nobest \
814
&& dnf group install -y "Development Tools" \
@@ -12,21 +18,19 @@ RUN dnf update -y --nobest \
1218
&& cd Python-${python_full_version} \
1319
&& ./configure --enable-optimizations \
1420
&& make altinstall \
15-
&& echo alias python=python3.14 >> ~/.bashrc \
21+
&& echo alias python=python${python_version} >> ~/.bashrc \
1622
&& cd .. \
1723
&& rm -rf Python-${python_full_version} Python-${python_full_version}.tgz \
18-
&& python3.14 -m pip install --upgrade pip \
19-
&& python3.14 -m pip install --upgrade benchmark-runner \
24+
&& python${python_version} -m pip install --upgrade pip \
25+
&& python${python_version} -m pip install --upgrade benchmark-runner \
2026
&& curl -L "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/${OCP_CLIENT_VERSION}/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz" -o "/tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz" \
21-
&& tar -xzvf /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz -C /tmp/ \
22-
&& mv /tmp/kubectl /usr/local/bin/kubectl \
23-
&& mv /tmp/oc /usr/local/bin/oc \
24-
&& rm -rf /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz /tmp/kubectl /tmp/oc \
27+
&& tar -xzf /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz -C /usr/local/bin kubectl oc \
28+
&& rm /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz \
2529
&& curl -L "https://github.com/kubevirt/kubevirt/releases/download/v${VIRTCTL_VERSION}/virtctl-v${VIRTCTL_VERSION}-linux-amd64" -o /usr/local/bin/virtctl \
2630
&& chmod +x /usr/local/bin/virtctl \
2731
&& mkdir -p ~/.kube ~/.ssh /tmp/run_artifacts \
28-
&& git clone -b v1.0.4 https://github.com/cloud-bulldozer/benchmark-operator /tmp/benchmark-operator \
29-
&& git clone -b v1.2.2-kata-ci https://github.com/RobertKrawitz/OpenShift4-tools /tmp/OpenShift4-tools \
32+
&& git clone -b ${BENCHMARK_OPERATOR_VERSION} https://github.com/cloud-bulldozer/benchmark-operator /tmp/benchmark-operator \
33+
&& git clone -b ${OPENSHIFT4_TOOLS_VERSION} https://github.com/RobertKrawitz/OpenShift4-tools /tmp/OpenShift4-tools \
3034
&& dnf clean all \
3135
&& rm -rf /var/cache/dnf
3236

0 commit comments

Comments
 (0)