Skip to content

Commit

Permalink
fix(monitorstack): make it work when running hydara via podman
Browse files Browse the repository at this point in the history
* 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: scylladb/scylla-monitoring#2149
Fixes: scylladb#7080
  • Loading branch information
fruch committed Jan 11, 2024
1 parent ecbabd9 commit c012d63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions sdcm/monitorstack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,19 +416,24 @@ 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} \
-s {monitoring_dockers_dir}/config/scylla_servers.yml \
-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}
Expand Down

0 comments on commit c012d63

Please sign in to comment.