Skip to content

Update for dockerfiles - #1182

Merged
ebattat merged 1 commit into
mainfrom
update-dockerfile
Feb 26, 2026
Merged

Update for dockerfiles#1182
ebattat merged 1 commit into
mainfrom
update-dockerfile

Conversation

@arpsharm

@arpsharm arpsharm commented Feb 19, 2026

Copy link
Copy Markdown
Member

Type of change

Note: Fill x in []

  • bug
  • enhancement
  • documentation
  • dependencies

Changes

  • Both Dockerfiles: CentOS Stream 10, single RUN, ARGs for Python/OCP/virtctl/benchmark-operator/OpenShift4-tools.

  • Added hack/get_latest_python_patch.py to use latest Python point release at build time; made executable.

  • prow Dockerfile: OCP 4.21.2, virtctl 1.7.0; main Dockerfile gets these from CI secrets.

  • Fixed executable bit for ci_pod/jetlag/run_jetlag.sh (pre-commit).

@openshift-ci
openshift-ci Bot requested review from gqlo and jeniferh February 19, 2026 09:50
Comment thread prow/Dockerfile Outdated
@ebattat

ebattat commented Feb 19, 2026

Copy link
Copy Markdown
Member

@arpsharm,
Next time pls verify you Squash the commit to 1. (https://github.com/redhat-performance/benchmark-runner/pull/1182/commits)

# Squash
git commit -a --amend --no-edit

Comment thread Dockerfile Outdated
@arpsharm arpsharm changed the title Update for prow dockerfile Update for dockerfiles Feb 23, 2026
@openshift-ci openshift-ci Bot added the lgtm label Feb 23, 2026
Comment thread Dockerfile Outdated
RUN dnf group install -y "Development Tools" \
&& dnf install -y podman jq
ARG python_version=3.14
ARG python_full_version=${python_version}.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you always want it to be the .0 version?

Comment thread Dockerfile Outdated
Comment on lines +26 to +28
&& tar -xzvf /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz -C /tmp/ \
&& mv /tmp/kubectl /usr/local/bin/kubectl \
&& mv /tmp/oc /usr/local/bin/oc \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think kubectl and oc are hard linked; since /tmp and /usr/local/bin are on different filesystems, mv will break the link. You might want to extract them in place, something like:

&& tar xzf /tmp/openshift-client-linux-${OCP_CLIENT_VERSION}.tar.gz -C /tmp kubectl oc

Comment thread Dockerfile Outdated
COPY benchmark_runner/main/main.py /benchmark_runner/main/main.py

CMD [ "python3.14", "/benchmark_runner/main/main.py"]
CMD python${PYTHON_VERSION} /benchmark_runner/main/main.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want

CMD [ "python${PYTHON_VERSION}", "/benchmark_runner/main/main.py"]

or some such.

@arpsharm

arpsharm commented Feb 23, 2026

Copy link
Copy Markdown
Member Author

Hi @RobertKrawitz Thank you for your review. I've addressed all the changes. Can you please review them now?

@RobertKrawitz RobertKrawitz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's necessary to use the most recent point release; I've provided sample code to do it.

Comment thread prow/Dockerfile Outdated
ARG OCP_CLIENT_VERSION=4.19.1
ARG VIRTCTL_VERSION=1.5.0
ARG python_version=3.14
ARG python_patch_version=0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should always use the latest patch version, not the .0 version, which doesn't have any later bugfixes. That, unfortunately, looks like it's going to require parsing https://www.python.org/ftp/python to determine the latest point release for a given version. Furtunately, the contents of that URL are pretty straightforward to parse.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's some code to find the version:

#!/usr/bin/python3

from html.parser import HTMLParser
import sys
import urllib.request
import urllib.error

url = 'https://www.python.org/ftp/python/'

def FindBestPythonVersion(version):
    class FindPythonVersion(HTMLParser):
        def __init__(self, release):
            super().__init__()
            self.release = release
            self.start = f'{release}.'
            self.best_found_version = None

        def handle_starttag(self, tag, attrs):
            if tag == 'a':
                try:
                    for name, value in attrs:
                        if name == 'href':
                            if value.startswith(self.start):
                                point = int(value.removeprefix(self.start).rstrip('/'))
                                if self.best_found_version is None or point > self.best_found_version:
                                    self.best_found_version = point
                                    return
                except Exception:
                    pass

        def get_best_version(self):
            return self.best_found_version

    try:
        with urllib.request.urlopen(url) as response:
            # Read the content and decode it to UTF-8
            data = response.read().decode('utf-8')
    except urllib.error.HTTPError as e:
        print(f'HTTP error: {e.code} {e.reason}')
        sys.exit(1)
    except urllib.error.URLError as e:
        print(f'URL error: {e.reason}')
        sys.exit(1)
    
    parser = FindPythonVersion(version)
    try:
        parser.feed(data)
        if parser.get_best_version() is not None:
            print(int(parser.get_best_version()))
    except Exception:
        print(f"Cannot find python version for {version}",
              file=sys.stderr)

FindBestPythonVersion('3.14')

@ebattat ebattat Feb 24, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @RobertKrawitz / @arpsharm ,
I don’t think we should fetch the latest patch version automatically.
Doing so could cause a failure without a clear understanding of the root cause.
We update the version only once it reaches a mature state.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch releases are considered mature (the .0 is probably the least stable). They can contain both security and functionality fixes. See e. g. the 3.14.3 release notes (https://docs.python.org/3/whatsnew/changelog.html#python-3-14-3-final) and similar for 3.14.2 and 3.14.1.

Comment thread prow/Dockerfile
@arpsharm

Copy link
Copy Markdown
Member Author

Hey @RobertKrawitz! I've added the script for fetching the latest python patch into hack folder. I've tested it out and it seems to work by getting the latest patch which seems to be Python 3.14.3 as of today. Can you please review all the changes now?

Comment thread Dockerfile
@openshift-ci openshift-ci Bot added the lgtm label Feb 24, 2026
@RobertKrawitz

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test PR ok to test label Feb 24, 2026
Comment thread prow/Dockerfile
RUN dnf update -y --nobest \
ENV PYTHON_VERSION=${python_version}

COPY hack/get_latest_python_patch.py /tmp/get_latest_python_patch.py

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arpsharm,
We need to put all hard coded including the patch version because the whole dockerfile is not running here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the specific issue here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I see it is working.

@openshift-ci openshift-ci Bot removed the lgtm label Feb 26, 2026

@ebattat ebattat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobertKrawitz, any more comments ?

@openshift-ci openshift-ci Bot added the lgtm label Feb 26, 2026
Updated prow Dockerfile for newer versions and defined new variables

Updated prow Dockerfile for newer versions and defined new variables
@openshift-ci openshift-ci Bot removed the lgtm label Feb 26, 2026
@openshift-ci openshift-ci Bot added the lgtm label Feb 26, 2026
@openshift-ci

openshift-ci Bot commented Feb 26, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arpsharm, ebattat, RobertKrawitz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [RobertKrawitz,ebattat]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ebattat
ebattat merged commit 6938be7 into main Feb 26, 2026
9 of 10 checks passed
@ebattat
ebattat deleted the update-dockerfile branch February 26, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants