Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to build grafana container #7061

Open
nahuel242 opened this issue Aug 29, 2024 · 9 comments
Open

Error trying to build grafana container #7061

nahuel242 opened this issue Aug 29, 2024 · 9 comments
Assignees

Comments

@nahuel242
Copy link

While trying to build the grafana container using the provided files in the lodestar repository, I get the following error:

~/lodestar$ sudo docker compose up -d grafana
WARN[0000] /home/ubuntu/lodestar/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Building 1.5s (6/6) FINISHED                                                                                                                              docker:default
 => [grafana internal] load build definition from Dockerfile                                                                                                            0.0s
 => => transferring dockerfile: 897B                                                                                                                                    0.0s
 => [grafana] resolve image config for docker-image://docker.io/docker/dockerfile:1.4                                                                                   0.7s
 => CACHED [grafana] docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbfd19b17e94c4e84ced81e24ef1a0dbc                             0.0s
 => [grafana internal] load .dockerignore                                                                                                                               0.0s
 => => transferring context: 2B                                                                                                                                         0.0s
 => ERROR [grafana internal] load metadata for docker.io/library/dashboards:latest                                                                                      0.5s
 => CANCELED [grafana internal] load metadata for docker.io/grafana/grafana:latest                                                                                      0.5s
------
 > [grafana internal] load metadata for docker.io/library/dashboards:latest:
------
failed to solve: failed to resolve source metadata for docker.io/library/dashboards:latest: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I believe the issue is in the following line of the docker/grafana/Dockerfile file.

The COPY --from=dashboards syntax is mainly used during a multi-stage build, that's why it fails with the message of " docker.io/library/dashboards:latest: pull access denied, repository does not exist or may require authorization"

Steps to reproduce

1- Delete any previous lodestar-grafana images
sudo docker rmi lodestar-grafana Untagged: lodestar-grafana:latest Deleted: sha256:0ddee6fbd6a27951a9c9c2b00313e600d733b76d9ee60181a613f712c1074edf
2- Start the grafana service
~/lodestar$ sudo docker compose up -d grafana

@nahuel242
Copy link
Author

I can put a PR to fix this, just need to properly setup my env to run the E2E tests

@nflaig
Copy link
Member

nflaig commented Aug 29, 2024

We might need to clarify this in our docs, the grafana container you tried to build is meant for publishing to dockerhub during release, not for local development.

We set the build context in CI, you could run the same command locally though using buildx

- name: Build and push custom Grafana
run: >
docker buildx build ./docker/grafana/ --push
--file ./docker/grafana/Dockerfile
--build-context dashboards=./dashboards
--tag chainsafe/lodestar-grafana:${{ needs.tag.outputs.tag }}
--platform linux/amd64,linux/arm64

For local development, I would recommend to use docker-compose.local_dev.sh

@nahuel242
Copy link
Author

Oh I see, thanks for clarifying that. I was following this guide so I'm not sure if that can be considered "official" documentation.

@nflaig
Copy link
Member

nflaig commented Aug 30, 2024

It's not part of Lodestar docs but we should probably update the metrics part cc @philknows

@philknows
Copy link
Member

Oof, this is a severely outdated guide that I no longer maintain. Just out of curiousity, where did you find the link to this guide? I want to make sure it's not linked in many places anymore. If you did find it useful though, perhaps it makes sense to do an updated version but within our official documentation so it's updated for today's use.

@nahuel242
Copy link
Author

nahuel242 commented Sep 3, 2024

@philknows I got the link from ethereum.org 🤦 see here on the lodestar section, second link: Install Lodestar software by compiling it or downloading the Docker image. Learn more in docs(opens in a new tab) and more comprehensive setup guide(opens in a new tab).
This is even pointing to the old version of the guide I used.
RE: If I find it useful? the answer is very much, it allowed me to run both execution & consensus clients with almost no issues other than doing some hacks to solve the grafana part

@philknows
Copy link
Member

Oh wow, thanks for pointing this out. Maybe the best interim solution is to update the V3 guide to fix up the metrics and then migrate this to our official docs and PR the change to ethereum.org then. Thanks for notifying!

@nahuel242
Copy link
Author

Glad it was useful @philknows!

@philknows philknows self-assigned this Sep 3, 2024
@philknows
Copy link
Member

philknows commented Sep 11, 2024

I've updated this setup, but likely won't publicize it too far if we just include it as a section in our docs as a guide.

Haven't tested all combinations yet, so use at your own risk!

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

No branches or pull requests

3 participants