flower icon indicating copy to clipboard operation
flower copied to clipboard

No Prometheus nor Grafana Plots - /examples/flower-via-docker-compose

Open WilliamLindskog opened this issue 1 year ago • 3 comments

Describe the bug

Hi there,

I'm cloning the /examples/flower-via-docker-compose, following the installation steps for Docker on Ubuntu 22.04 and there after running the required commands:

cd flower-via-docker-compose/

python helpers/generate_docker_compose.py

sudo docker-compose build

sudo docker-compose up

and everything seems to start, I can tell by the results in the CLI and by monitoring docker using docker stats.

However, when opening up Grafana on http://localhost:3000, I see following error while hovering above a warning sign: Post "http://host.docker.internal:9090/api/v1/query_range" dial tcp: lookup host.docker.internal on 127.0.0.11:53: no such host Screenshot from 2024-04-04 13-59-04

According to the documentation, I should not configure anything but it seems that the configuration is somehow wrong. Does anyone know how I can fix this? Maybe someone else has the same problem.

Best regards, William

Steps/Code to Reproduce

Running on Ubuntu 22.04:

# uninstall all conflicting packages
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# go to work environment 
cd <WORK ENVIRONMENT> # fill in 

# clone repository
git clone --depth=1 https://github.com/adap/flower.git && mv flower/examples/flower-via-docker-compose . && rm -rf flower && cd flower-via-docker-compose


# Generate docker compose file
python helpers/generate_docker_compose.py # by default will configure to use 2 clients for 100 rounds

# Build docker images
docker-compose build

# Launch everything
docker-compose up

# then open up http://localhost:3000

Expected Results

There should be results as the ones shown in /examples/flower-via-docker-compose:

image

Actual Results

Screenshot from 2024-04-04 13-59-04

WilliamLindskog avatar Apr 04 '24 12:04 WilliamLindskog

Just got a response in Slack: "Try changing url: http://host.docker.internal:9090 in prometheus-datasource.yml to url: http://prometheus:9090

That did the trick! Hope this helps someone.

WilliamLindskog avatar Apr 04 '24 15:04 WilliamLindskog

Just got a response in Slack: "Try changing url: http://host.docker.internal:9090 in prometheus-datasource.yml to url: http://prometheus:9090

That did the trick! Hope this helps someone.

Do you want to open a small PR and edit the README.md to indicate this ?

jafermarq avatar Apr 04 '24 15:04 jafermarq

Hi @jafermarq,

Can do that!

WilliamLindskog avatar Apr 04 '24 15:04 WilliamLindskog