Skip to content

Fix ovn-tester python version and issues uncovered in CI.#206

Merged
dceara merged 7 commits intoovn-org:mainfrom
dceara:fix-container-image-python-version
Jan 13, 2026
Merged

Fix ovn-tester python version and issues uncovered in CI.#206
dceara merged 7 commits intoovn-org:mainfrom
dceara:fix-container-image-python-version

Conversation

@dceara
Copy link
Collaborator

@dceara dceara commented Jan 8, 2026

If we don't use the latest available Python version other packages we need might fail to install. E.g., ovsdbapp requires Python >= 3.10:

ERROR: Package 'ovsdbapp' requires a different Python: 3.9.25 not in '>=3.10'
Error: building at STEP "RUN pip3 install -r /ovn-tester/requirements.txt":
while running runtime: exit status 1

While testing this change a bunch of other issues were uncovered, mostly due to our CI failing to run after recent changes to various components. This PR also fixes those issues:

  • skip installation redhat-lsb-core (not needed)
  • try setting RAFT election timeout on all DB cluster members (the first one is not always the elected leader)
  • support optional internal-iface configuration (for single node deployments)
  • moved to Fedora:43 in CI as Fedora:38 is EOL for a long time
  • fix incorrect handling of vt100 String Terminator control characters
  • increase the VM memory size for CirrusCI runs (we're running out of memory on Ubuntu VMs due to non-OVN processes being pulled in by default in the Ubuntu container image)

@dceara
Copy link
Collaborator Author

dceara commented Jan 8, 2026

CC: @igsilya

@dceara dceara marked this pull request as draft January 8, 2026 12:59
@dceara dceara force-pushed the fix-container-image-python-version branch 5 times, most recently from f5d09da to d3caac7 Compare January 8, 2026 17:18
The command only works through the leader and the first node might not
be the elected leader.  In such cases we get:

  ovs-appctl: /run/ovn/ovnsb_db.ctl: server returned an error
  ovn_workload |INFO| Setting RAFT election timeout to 11000ms
  ovn_sandbox  |INFO| Logging command: ssh ovn-central-az0-1
    "ovs-appctl -t /run/ovn/ovnnb_db.ctl cluster/change-election-timer OVN_Northbound 11000"
  ovn_sandbox  |INFO| Result:
    ['election timer must be changed through leader.', 'ovs-appctl: /run/ovn/ovnnb_db.ctl: server returned an error'], Exit status: 2
  ovn_sandbox  |INFO| ---
  election timer must be changed through leader.

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
It's not really needed (and not available on newer Fedora).

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Otherwise other packages we need might fail to install.  E.g., ovsdbapp
requires Python >= 3.10:

  ERROR: Package 'ovsdbapp' requires a different Python: 3.9.25 not in '>=3.10'
  Error: building at STEP "RUN pip3 install -r /ovn-tester/requirements.txt":
  while running runtime: exit status 1

For RHEL we query the available packages and choose the most recent
python3 version and the corresponding python3.x-pip package.  For Fedora
and Deb-based distros we use the python3 version pulled in by the
python3-pip package.

Suggested-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
On single node deployments, e.g., in CI, we don't need an
internal-iface.

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
@dceara dceara force-pushed the fix-container-image-python-version branch from d3caac7 to f58f3a2 Compare January 12, 2026 14:49
@dceara dceara changed the title Dockerfile: Use the latest available python version. Fix ovn-tester python version and issues uncovered in CI. Jan 12, 2026
@dceara dceara force-pushed the fix-container-image-python-version branch from f58f3a2 to 6d529b6 Compare January 12, 2026 15:23
@dceara dceara marked this pull request as ready for review January 12, 2026 15:24
@dceara dceara force-pushed the fix-container-image-python-version branch 2 times, most recently from 0f29c2d to e037da5 Compare January 13, 2026 10:41
The Sandbox class uses an interactive shell to maintain a channel to
each of the containers (fake nodes) it needs to runs commands in.  As
this is a real shell emulator the Sandbox implementation must also
handle (ignore mostly) the vt100 control/escape symbols.

The implementation uses special markers to determine where the beginning
of the command output starts and where it ends.  However, the
implementation assumed that the first line of the output was always
separated from the previous (command) line by an universal newline
character (e.g., '\n').  Which meant it was enough to call splitlines()
on the output we got from the channel and then search for the start
marker as one of the split lines.

Some shell implementations however may occasionally use the String
Terminator character 'ESC \', i.e. '\x1b\\',  to end the command
part of the output, _without_ adding an explicit newline.

This caused issues as ovn-heater failed to determine where the actual
output started in those cases and was failing with:

  File "/ovn-tester/ovn_sandbox.py", line 92, in run
    self.ensure_channel()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/ovn-tester/ovn_sandbox.py", line 80, in ensure_channel
    self.run(cmd="echo Hello", stdout=stdout, raise_on_error=True)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/ovn-tester/ovn_sandbox.py", line 128, in run
    start = out.index('++++start') + 1
            ~~~~~~~~~^^^^^^^^^^^^^

While the output itself did actually include the '++++start' marker,
e.g.:
  '\x1b]3008;start=...user=;hostname=..;pid=...;cwd=/\x1b\\++++start'

In the output above '\x1b]' ('ESC ]') is the Operating System Command
control character and is terminated by '\x1b\\' ('ESC \') the String
Terminator control character.

In order to handle such cases we now explicitly handle String Terminator
as an additional delimiter on top of the universal newline characters
considered by Python's splitlines().

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
The Ubuntu runs were running out of memory (due to non-OVN components).
We should probably investigate why those components are installed and
remove them if possible.  However, using 16GB of RAM for VMs in CI
sounds like a good idea nevertheless.

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
@dceara dceara force-pushed the fix-container-image-python-version branch from e037da5 to 1abecd8 Compare January 13, 2026 10:44
@dceara
Copy link
Collaborator Author

dceara commented Jan 13, 2026

Thanks, @almusil and @igsilya for the reviews and discussions! Merging this now to unblock our CI.

@dceara dceara merged commit 53250d7 into ovn-org:main Jan 13, 2026
9 checks passed
@dceara dceara deleted the fix-container-image-python-version branch January 13, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants