From c012d6301d9828b65a8ec880bfe7ea4ad35d1349 Mon Sep 17 00:00:00 2001 From: Israel Fruchter Date: Wed, 10 Jan 2024 21:59:42 +0200 Subject: [PATCH] fix(monitorstack): make it work when running hydara via podman * podman now defaults to short-name-mode="enforcing", and the monitor stack doesn't able to pull images when working via socket, it doesn't have tty to offer which repository to alias it, setting short-name-mode="permissive" on ~/.config/containers/registries.conf alleviate this issue * scylla-monitoring was using DOCKER_HOST inside it's start scripts, hence breaking our ability to use it to point to podman socket, a fix was subbmitted but until then we patch those out of the scripts so older collected monitoring data can be used Ref: https://github.com/scylladb/scylla-monitoring/pull/2149 Fixes: #7080 --- README.md | 5 +++++ sdcm/monitorstack/__init__.py | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5363e80e44..4dc0b800d1 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,11 @@ export AWS_PROFILE=DeveloperAccessRole # Install hydra (docker holding all requirements for running SCT) sudo ./install-hydra.sh + +# if using podman, we need to disable enforcing of short name usage, without it monitoring stack won't run from withing hydra +echo 'unqualified-search-registries = ["registry.fedoraproject.org", "registry.access.redhat.com", "docker.io", "quay.io"] +short-name-mode="permissive" +' > ~/.config/containers/registries.conf ``` ### Run a test diff --git a/sdcm/monitorstack/__init__.py b/sdcm/monitorstack/__init__.py index 115d495185..4de6fcaf1f 100644 --- a/sdcm/monitorstack/__init__.py +++ b/sdcm/monitorstack/__init__.py @@ -416,8 +416,11 @@ def remove_sct_metrics(metric): prom_tmpl_file.write_text(yaml.safe_dump(templ_yaml)) cmd = dedent("""cd {monitoring_dockers_dir}; + # patch to make podman work for result that don't have https://github.com/scylladb/scylla-monitoring/pull/2149 + sed -i 's/DOCKER_HOST/HOST_ADDRESS/' *.sh + echo "" > UA.sh - ./start-all.sh \ + bash -x ./start-all.sh \ $(grep -q -- --no-renderer ./start-all.sh && echo "--no-renderer") \ $(grep -q -- --no-loki ./start-all.sh && echo "--no-loki") \ -g {graf_port} -m {alert_port} -p {prom_port} \ @@ -425,10 +428,12 @@ def remove_sct_metrics(metric): -d {monitoring_stack_data_dir} -v {scylla_version} \ -b '-storage.tsdb.retention.time=100y' \ -c 'GF_USERS_DEFAULT_THEME=dark'""".format(**locals())) - res = lr.run(cmd) + res = lr.run(cmd, ignore_status=True) if res.ok: LOGGER.info("Docker containers for monitoring stack are started") - + else: + LOGGER.error("Failure to start monitoring stack: %s", res.stderr) + raise Exception("fail to start monitoring stack") return {"grafana_docker_port": graf_port, "alert_docker_port": alert_port, "prometheus_docker_port": prom_port}