Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Grafana config can't generate at ./graphs #907

Open
takahyon opened this issue Nov 20, 2022 · 0 comments · May be fixed by #908
Open

Grafana config can't generate at ./graphs #907

takahyon opened this issue Nov 20, 2022 · 0 comments · May be fixed by #908

Comments

@takahyon
Copy link

  • When I create grafana configuration json with microservices-demo/graphs/Dockerfile,
    I couldn't build and run cause of several reasons like:
  • pip are not support python:3.4 anymore
taka@taka-master:~/swimmy-project/microservices-demo/graphs$ sudo docker build -t takahyon/grafanalib .
Sending build context to Docker daemon  34.82kB
Step 1/8 : FROM python:3.4-alpine
3.4-alpine: Pulling from library/python

~~~ ~~~ ellipsis ~~~ ~~~

Step 5/8 : RUN curl https://bootstrap.pypa.io/get-pip.py | python
 ---> Running in e7919ffa6f5d
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2509k  100 2509k    0     0  19.1M      0 --:--:-- --:--:-- --:--:-- 19.1M
ERROR: This script does not work on Python 3.4 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.4/get-pip.py instead.
The command '/bin/sh -c curl https://bootstrap.pypa.io/get-pip.py | python' returned a non-zero cod
FROM python:3.4-alpine

MAINTAINER Container Solutions info@container-solutions.com

after fix this probrem, I can build container with Dockerfile.

-Can't generate grafana config file cause of library:grafanalib has bug at version which selected in Dockerfile

taka@taka-master:~/swimmy-project/microservices-demo/graphs$ sudo docker run --rm -it -v ${PWD}:/opt/code takahyon/grafanalib /bin/sh -c 'ls /opt/code/*.dashboard.py | parallel generate-dashboard -o {.}.json {}'

result

Traceback (most recent call last):
  File "/usr/local/bin/generate-dashboard", line 8, in <module>
    sys.exit(generate_dashboard_script())

~~~ ~~~ ellipsis ~~~ ~~~
  File "/usr/local/lib/python3.7/site-packages/grafanalib/core.py", line 308, in Row
    panels = attr.ib(default=attr.Factory(list), convert=_balance_panels)
TypeError: attrib() got an unexpected keyword argument 'convert'

I really don't know why python interpriter recognized attr.ib as attrib, but any way I fixed this probrem by changing Dockerfile:15
from

# Install grafanalib
RUN pip install git+https://github.com/weaveworks/grafanalib@82556ddfbbd6134837d280a7999d35c45cc3c87e

to

# Install grafanalib
RUN pip install git+https://github.com/weaveworks/grafanalib.git@release
  • Describe steps to reproduce the problem
    Everytime use command annouced in graphs/readme.md
    sudo docker build -t {dockerusername}/grafanalib .
    sudo docker run --rm -it -v ${PWD}:/opt/code {dockerusername}/grafanalib /bin/sh -c 'ls /opt/code/*.dashboard.py | parallel generate-dashboard -o {.}.json {}'

I will create PR in few minutes, check it out please.

Takamasa

@takahyon takahyon linked a pull request Nov 20, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant