Skip to content

Commit 9b56a7a

Browse files
committed
fix(sdcm/cluster.py): Use microdnf on rhel-like docker backend
Since we are now using RHEL UBI9 image for our docker backend, add additional logic to support using `microdnf` inside BaseNode.install_package Fixes #10449
1 parent 7b84726 commit 9b56a7a

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

artifacts_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ def run_scylla_doctor(self):
488488
self.log.info("Scylla Doctor test is skipped for non-root test due to issue field-engineering#2254. ")
489489
return
490490

491-
if self.node.parent_cluster.cluster_backend == "docker":
492-
self.log.info("Scylla Doctor check in SCT isn't yet support for docker backend")
493-
return
491+
# if self.node.parent_cluster.cluster_backend == "docker":
492+
# self.log.info("Scylla Doctor check in SCT isn't yet support for docker backend")
493+
# return
494494

495495
for node in self.db_cluster.nodes:
496496
scylla_doctor = ScyllaDoctor(node, self.test_config, bool(self.params.get('unified_package')))

docker/scylla-sct/centos/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ USER root
1818

1919
RUN curl -L https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
2020

21-
RUN microdnf update && \
21+
RUN microdnf -y update && \
2222
microdnf -y install \
2323
iproute \
2424
sudo \

sdcm/cluster.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1871,7 +1871,10 @@ def install_package(self,
18711871
package_version: str = None,
18721872
ignore_status: bool = False) -> None:
18731873
if self.distro.is_rhel_like:
1874-
pkg_cmd = 'yum'
1874+
if not self.parent_cluster.cluster_backend == "docker":
1875+
pkg_cmd = 'yum'
1876+
else:
1877+
pkg_cmd = 'microdnf'
18751878
package_name = f"{package_name}-{package_version}*" if package_version else package_name
18761879
elif self.distro.is_sles:
18771880
pkg_cmd = 'zypper'

utils/scylla_doctor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def locate_newest_scylla_doctor_package(self):
6464
return latest
6565

6666
def download_scylla_doctor(self):
67-
if self.node.remoter.run("which curl", ignore_status=True).ok:
67+
if self.node.remoter.run("curl --version", ignore_status=True).ok:
6868
LOGGER.info("curl already installed, proceeding...")
6969
else:
7070
self.node.install_package('curl')
@@ -97,8 +97,9 @@ def update_scylla_doctor_config(self, prefix: str):
9797
def install_scylla_doctor(self):
9898
if self.node.parent_cluster.cluster_backend == "docker":
9999
self.node.install_package('ethtool')
100+
self.node.install_package('tar')
100101

101-
if self.offline_install:
102+
if self.offline_install or self.node.parent_cluster.cluster_backend == "docker":
102103
self.download_scylla_doctor()
103104
if self.node.is_nonroot_install:
104105
self.python3_path = self.find_local_python3_binary(self.current_dir)

0 commit comments

Comments
 (0)